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!

Editable Text Box

Status
Not open for further replies.

EKelly

Programmer
Jul 3, 2002
49
IE
Hi all,
I have a text box which I want my users to be able to enter information into. They do so by clicking a button next to the text box which opens a new screen, and selecting what they want from there. They click 'ok' on the new screen and the text box is filled with their selection - simple. The problem is that I only want them to enter text in this manner, i.e. they can't enter text directly into the text box. To do this I've set the locked property of the text box to true. This stops users being able to type into the text box but if they click on it a blinking cursor appears in the box giving the impression that u can type into it. I want to get rid of this blinking cursor. If I set the enable property of the text box to false the cursor goes and the user can't type into the text box but when they do put in information via the other screen the text appears greyed out. I don't want this either. Can anyone help with this?
Thanks
Erin
 
Use a label, set borderstyle=1, and backcolor=vbwhite.


------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
Hi Erin,

Instead of using enabled, use the locked property (set it to true).

This allows your code to modify the text, but stops users.

You might also consider using a Label instead. With the right properties, they can be made to resemble TextBoxes...

mmilan
 
Sorry vbSun - you didn't have a response when I started writing mine...

mmilan
 
Hi Erin,

How about when the textbox receives focus you set focus to the command button they need to click to enter text??

Thus in theory not allowing the user to enter text.

Hope this helps

Harleyquinn

 
Another good idea Harlequin - Erin's going to be spoilt for choice!

mmilan
 
Your right mmilan, i am spoilt for choice! The set focus idea was a winner! Worked like a charm.
Thanks again guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top