468,740 Members | 2,073 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,740 developers. It's quick & easy.

Dynamically Created Eventhandler and passing the textbox value

Hello all
I am new to VB.NET. I am trying to create dynamically objects and giving them the event handles. Something like this

Expand|Select|Wrap|Line Numbers
  1. Dim NewTab As New TabPage
  2. Dim NewTextBox As New TextBox
  3. Dim NewTab2 As New TabPage
  4. Dim b As New Button
  6. AddHandler b.Click, AddressOf b1
  8. Me.TabControl1.Controls.Add(NewTab)
  10. NewTab.Controls.Add(NewTextBox)
  11. NewTab.Controls.Add(b)
  13. Private Sub b1(ByVal sender As System.Object, ByVal e As System.EventArgs)
  14. MsgBox("Here I want the value of the textbox")
  15. End Sub
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.
Actually i am making on pressing F4
key a new tabpage, and on that page i have a button and a text box. I call a button:
Dim b as new Button and box as Dim t as new Textbox

Now I added a handler for click.

Now How can I pass the text box value to a handler function? i.e. how can I see the text box value after clciking the button.
May be somebody can help me.
Mar 9 '08 #1
0 1894

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Bhavin | last post: by
5 posts views Thread by Andrei Pociu | last post: by
8 posts views Thread by Donald Xie | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.