Hello all
I am new to VB.NET. I am trying to create dynamically objects and giving them the event handles. Something like this
[code=vbnet]
Dim NewTab As New TabPage
Dim NewTextBox As New TextBox
Dim NewTab2 As New TabPage
Dim b As New Button
AddHandler b.Click, AddressOf b1
Me.TabControl1. Controls.Add(Ne wTab)
NewTab.Controls .Add(NewTextBox )
NewTab.Controls .Add(b)
Private Sub b1(ByVal sender As System.Object, ByVal e As System.EventArg s)
MsgBox("Here I want the value of the textbox")
End Sub
[/code]
I created a new tab and add two controls to it. One button and one textbox. Then i attached click event to the button. Now I want that onclick, I can see the text of the textbox of the tabpage. May be somebody can help me. Thanks in advance.
I am new to VB.NET. I am trying to create dynamically objects and giving them the event handles. Something like this
[code=vbnet]
Dim NewTab As New TabPage
Dim NewTextBox As New TextBox
Dim NewTab2 As New TabPage
Dim b As New Button
AddHandler b.Click, AddressOf b1
Me.TabControl1. Controls.Add(Ne wTab)
NewTab.Controls .Add(NewTextBox )
NewTab.Controls .Add(b)
Private Sub b1(ByVal sender As System.Object, ByVal e As System.EventArg s)
MsgBox("Here I want the value of the textbox")
End Sub
[/code]
I created a new tab and add two controls to it. One button and one textbox. Then i attached click event to the button. Now I want that onclick, I can see the text of the textbox of the tabpage. May be somebody can help me. Thanks in advance.
Comment