Textboxes & Visible Property

stewarts

Newcomer
Joined
Apr 8, 2003
Messages
22
Visual Basic .NET.... I have a textbox on my form whose text property is bound to a datasource. If I set the Visible property to FALSE, I can no longer see the textbox.text value in my code. When the Visible property is set to TRUE, no problem. Any ideas???
 
I can't duplicate this. I can see the Text property regardless of the Visible property, bound or unbound. I'm using C# but I can't imagine it works different in VB.NET.

-Nerseus
 
I created a test form...added a textbox...added a MS Access database connection & data adapter, generated the dataset. I bound the textbox.text to a field in the dataset. I filled the dataset. I added a button and in the button_click event I displayed a messagebox showing textbox1.text. When the textbox1 visible property is set to true, I get the first value retrieved from the database table in my message display. When the Visible property is set to false, I get nothing displayed in my message display. ????
 
Not sure if still applicable, but I have run into the same problem in VS.Net 2003. I simply removed the border on the text box, set the background and fore color to "Control" (to match the color of the form), set ReadOnly to true, and TabStop to false. Then I hid them behing the other related components on the form. Problem solved! :) You have probably already figured out a way around this, but hopefully this will be helpful to others with the same problem...
 
Back
Top