coding a text box in a tabpage

August 18, 2010 at 13:38:27
Specs: Windows XP
ThaiCoder provided sample code...
For i = 1 To 3 'or use Me.Controls.Count -1
Me.Controls.Item("GroupBox1").Controls.Item("TextBox" & i).Text() = "Test Loop No." & i
Next i

and im trying to do the same but i have my textboxes in a TabControl on TabPage1

This is what i have...
For i = 0 to 13
TankInfoResult = ds.Tables("Test").Rows(0).Item(i).ToString
Form2.Controls.Item("TabControl").Controls.Item("TextBox" & i).Text() = TankInfoResult

I want to get the data from my dataset to individual textboxes (0-14 of them). It works when the textboxes are not in the TabPage but in a general place in the Form.

Any help would be great. as you can tell im a beginner to programming


See More: coding a text box in a tabpage

Report •

August 18, 2010 at 13:44:36
Solved my own problem.... :)
Hope this helps anyone else with a similar problem..

Form2.Controls.Item("TabControl1").Controls.Item("TextBox" & i).Text() = TankInfoResult

Correct Code:
Form2.Controls.Item("TabControl1").Controls.Item("TabPage1").Controls.Item("TextBox" & i).Text() = TankInfoResult

Im just a beginner but i think i needed to dig deeper in to the TabControl1 and reference the TabPage that the textboxes were associated to.

Report •
Related Solutions

Ask Question