473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
  5.  
  6. AddHandler b.Click, AddressOf b1
  7.  
  8. Me.TabControl1.Controls.Add(NewTab)
  9.  
  10. NewTab.Controls.Add(NewTextBox)
  11. NewTab.Controls.Add(b)
  12.  
  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
  16.  
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 2106

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

Similar topics

6
by: Bhavin | last post by:
Anybody quickly replies it, would be a great help! I try to create dynamic array of textboxes control in ASP.NET(C#). I got the following error while I tried to assign value to ID property of...
5
by: Andrei Pociu | last post by:
Inside a method some controls are created at runtime. I added an event handler to one of these controls: tracker.Scroll += new System.EventHandler(this.tracker_Scroll); So in the event handler...
7
by: Gelios | last post by:
Hello all! I have a Windows.Forms code where I dynamically created controls. How can I access to properties from event handler? For example: createSomeControls() { TextBox textBox = new...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
3
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
2
by: JaM | last post by:
Hi all, I have created a gridview vith dynamic textbox columns (they are in variable number, it depends on what things I select from database) aspx code:...
3
by: StevenT | last post by:
Hello, I am trying to dynamically create a table based on the information I have in my cookie for a shopping cart. I can create it and display it and all is good. I put the contents of the...
3
by: ahmadbaseet | last post by:
Hello all I am new to VB.NET. I am trying to create dynamically objects and giving them the event handles. Something like this Dim NewTab As New TabPage Dim NewTextBox As New...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.