Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Programmatically Created Textbox 1

Status
Not open for further replies.

marcusmco

IS-IT--Management
Oct 9, 2006
30
AU
Hello,

I have with vb.net created a couple of text boxes programmatically. Now I cannot figure out how to access the text boxes' text properties further down in the code. Normally one just write e.g. txtFirstName.Text but that obviously does not work because the code does not recognise txtFirstName since it does not exist when the application is not running...

Any ideas?

Thanks.
 
>> txtFirstName since it does not exist when the application is not running...

what exactly does "running" to here means? because everytime you create it you can access it...

Known is handfull, Unknown is worldfull
 
You are correct, it doesn't exist at design time. You will have to use FindControl() in your code to finde the control you create dynamically, then set it's properties.
 
>> it doesn't exist at design time

oh! thats what not running meant. he he. [2thumbsup]

Known is handfull, Unknown is worldfull
 
Aha, I will look into that one (FindControl). Sorry for not using the proper terminology. I am used to the wonderful world of windows client applications... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top