-
Jul 11th, 2011, 06:37 AM
#1
Thread Starter
New Member
VB 2010 - Getting Information from a Dynamically created textbox
Hi,
On my form, A user can select a few chec box options, then clicks OK.
A new tabpage with a textbox and two buttons is created and added to my form, the textbox can be seen as a sort of 'receipt', and one button is a close button, which deletes that tab, the other button is an edit button.
When the user selects edit, I would like the selection page to open up, checking, (through a couple of If conditions, whether a text is contained in the text box), then if a certain text is found in the box, a corresponding checkbox on my form is checked.
So basically, my problem is trying to check the text from a textbox which doesnt exist until after my form is loaded... I need someway to reference this new text box, not forgetting there may be many tabs at one stage.
I tried a method in which each new texbox was added to a list, then when the edit button was clicked, it checked the tab index and checked the corresponding textbox, but this would only work for the first tab/textbox and caused issues with the close button, So what I am thinking, is if someone could help me find a way, perhaps when the edit button is pressed, VB checks my selected tab, and somehow finds the textbox which is on that tab.
-
Jul 11th, 2011, 03:50 PM
#2
Re: VB 2010 - Getting Information from a Dynamically created textbox
If you want to get the text of a dynamic textbox when it changes, use AddHandler to create an Event Handler link.
If you want to get the text of a dynamic textbox at any other time, just loop through the .Controls collection of it's parent object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|