how to create dynamic textbox object [modified]
-
greetings to you all, guys i need your help very badly.. on how to create a dynamic textbox object in runtime... using VB.NET 2005 the code below suppossedly can display 5 textbox, but sad to say i cannot see any textbox in my form. Can someone help me on this: For xcnt = 0 To 4 Dim text As New TextBox text.Visible = True text.Location = New Point(33 + xcnt, 27) text.Size = New Size(104, 21) Next pls help here... thank you so much.... links/codes are highly appreciated..:-D -- modified at 6:21 Monday 24th September, 2007
start a new beginning in every ending; thats what life for......
-
greetings to you all, guys i need your help very badly.. on how to create a dynamic textbox object in runtime... using VB.NET 2005 the code below suppossedly can display 5 textbox, but sad to say i cannot see any textbox in my form. Can someone help me on this: For xcnt = 0 To 4 Dim text As New TextBox text.Visible = True text.Location = New Point(33 + xcnt, 27) text.Size = New Size(104, 21) Next pls help here... thank you so much.... links/codes are highly appreciated..:-D -- modified at 6:21 Monday 24th September, 2007
start a new beginning in every ending; thats what life for......
Main problem is that you are not adding text boxes to Forms control collection. Try following code – --------------------Start Code--------------- Dim xcnt As Integer Dim x As Integer x = 20 Dim txt As TextBox For xcnt = 0 To 4 txt = New TextBox Me.Controls.Add(txt) ‘you were missing this line txt.Location = New Point(33 + x, 27 + x) x += 25 Next -------------------Code End--------------------- I hope this helps:). -Dave.
Dave Traister, ComponentOne LLC. www.componentone.com
-
Main problem is that you are not adding text boxes to Forms control collection. Try following code – --------------------Start Code--------------- Dim xcnt As Integer Dim x As Integer x = 20 Dim txt As TextBox For xcnt = 0 To 4 txt = New TextBox Me.Controls.Add(txt) ‘you were missing this line txt.Location = New Point(33 + x, 27 + x) x += 25 Next -------------------Code End--------------------- I hope this helps:). -Dave.
Dave Traister, ComponentOne LLC. www.componentone.com
thank you sir dave, your help is very highly appreciated.. looking forward to you soon, many thanks.. :-D
start a new beginning in every ending; thats what life for......