-
April 27th, 2013, 01:49 AM
#1
VB.Net - Tab Pages with Controls
Sir,
I beginner for VB.Net programming,
MS-Access is my DataBase, According to database single person has Few Rows. That mean when their repeat comes new row (record) will be added.
In Repeat Table of database has Few Fields like "PerID", "Repeat Times", "Company", "Date"
I need create Tab Pages to equal of repeat times and insert other Details into that Tab Page.
I code like this and its creates Tab Pages equal to repeat time. If person comes repeatedly 04 times Tab Control will added 04 New pages into Tab Control.
Code:
Dim newPageAA As New TabPage()
Dim RecCount As Integer
While QReaderQ.Read()
RecCount = RecCount + 1 ' Count How many Rows
End While
TabControl1.TabPages.Clear()
For xXx = 1 To RecCount
newPageAA = New TabPage 'create new instance
If xXx = 1 Then
newPageAA.Text = "Repeat - 1"
Else
newPageAA.Text = "Repeat - " & xXx.ToString
End If
TabControl1.TabPages.Add(newPageAA)
Next
Now I want to put other details ("PerID", "Repeat Times", "Company", "Date") into Tab Pages with Text Boxes or Labels.
In 1st Tab page -----> I want to see 1st repeat time "PerID", "Repeat Times", "Company", "Date"
In 4th Tab page -----> I want to see 4th repeat time "PerID", "Repeat Times", "Company", "Date" .......
Please tell me, how to do this..
I not asking full code, but show me with little example code, because I am beginner for VB.Net.
-
April 27th, 2013, 03:54 PM
#2
Re: VB.Net - Tab Pages with Controls
Code:
tabPage1.Text = "tabPage1"
tabPage1.Size = New System.Drawing.Size(256, 214)
tabPage1.TabIndex = 0
tab2CheckBox3.Location = New System.Drawing.Point(32, 136)
tab2CheckBox3.Text = "checkBox3"
tab2CheckBox3.Size = New System.Drawing.Size(176, 32)
tab2CheckBox3.TabIndex = 2
tab2CheckBox3.Visible = True
tab3RadioButton2.Location = New System.Drawing.Point(40, 72)
from: http://msdn.microsoft.com/en-us/libr...code-snippet-1
-
April 28th, 2013, 12:37 AM
#3
Re: VB.Net - Tab Pages with Controls
Sir,
Thank you for your reply.
In my task, Before debug, We don't know how many rows belong to each person.
because of that, I think declare the textboxes or labels with array types. Is it possible ?
From my code, RecCount given how many record for each person.
After Create Tab Pages according to RecCount Value.
My problem is:
1. When after creation of Tab Pages How I add controls (TextBox or Label) to new Tab Page. (It depend on RecCount) ---I think we should use Loop to do this until RecCount
2. How I put Record details (example "PerID", "Company" ) into that TextBox or Labels.
From 1st row of Database to 1st Tab Page
From 2nd row of Database to 2nd Tab Page
I attached Tab Control Screen print for Your convenience.
(It shows How Many Records for selected person.)
Please Explain me How to do this 1 and 2 questions
Attachment 31351
-
April 28th, 2013, 02:48 PM
#4
Re: VB.Net - Tab Pages with Controls
not a valid link (or picture)
-
April 29th, 2013, 01:20 AM
#5
Re: VB.Net - Tab Pages with Controls
Is it correct,
This is My Database. There are 02 tables for it. "Master" data and "Repeat"
I want to do, when click any Tab page, "Repeat" tables data of selected person must be there, as my second picture.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|