Textbox Array

netpicker9

Member
Joined
Dec 8, 2004
Messages
17
Programming Experience
1-3
Hi,

I have a VB6 form converted into VB.net (2005).
The for has row of textboxes populated from datbase, like

EmpNo EmpName Salary Department Job DOB
1 ABC 5000 IT SE 1980
2 XYZ 4500 IT SE 1981

Each value in row will be populated into textbox (array), and its Dynamic.. Depends on the number of records in a table

Problem is:
After Conversion using Wizard, when i run VB.net application, form is showing Blank and looks like hanged.

When i look at the code the textboxes converted like..
_txtName_0
Public WithEvents _txtName_0 As System.Windows.Forms.TextBox
shows this in FrmEMP.Designer.VB

What is solution, data is coming from database and fine, only thing is i need to know, how to manuplate with textboxes arrays in vb.net

Please give me detailed replies , if possible with examples.

Thanks
 
Here is an example that might help...
VB.NET:
[SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] AddBoxes()[/SIZE]
 
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][SIZE=2] MynewPos [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Point(50, 40)[/SIZE]
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] i [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
 
[SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][SIZE=2] i = 0 [/SIZE][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][SIZE=2] 5 - 1[/SIZE]
 
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] box [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] System.Windows.Forms.TextBox[/SIZE]
[SIZE=2]box.Size = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] System.Drawing.Size(100, 20)[/SIZE]
[SIZE=2]box.Location = MynewPos[/SIZE]
[SIZE=2]box.Text = [/SIZE][SIZE=2][COLOR=#800000]"Textbox "[/COLOR][/SIZE][SIZE=2] & i[/SIZE]
[SIZE=2]MynewPos.Y += 30[/SIZE]
 
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Controls.Add(box)[/SIZE]
 
[SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE]
 
[SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
 
Back
Top