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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to highlight text box when it gets the focus

Status
Not open for further replies.

angelleynes

Programmer
Dec 28, 2001
46
US
How to highlight text box when it gets the focus even if it's empty? format "K" doesn't work!

thanks!
 
Actually if it's empty, there is nothing to highlight! The best I've found, is to create a text box class that changes it's background color in the gotfocus() and lostfocus() events. I suppose you could also fill the field with a character that "looks" like a space, but it's really not. However, you'd then have to add this code to gotfocus() and lostfocus() [to get rid of the "funny" character] also.

Rick


 
okay, thanks!, I have another question, I'm trying to pass 3 parameters in a form but how can I return 3 parameters?

thanks!
 
You cannot return more than 1 variable in ANY function. There are a few workarounds:

1) Declare PUBLIC variables and set them in the form. The calling program can then access the variables.

2) Declare PRIVATE variables in the calling program and have the form manipulate those.

3) Use form properties, set the form to MODAL (WindowType=1) and have the form HIDE() instead of RELEASE(). After being hidden, the calling program can still access its properties and release the form when it's done.

Hope that helps.

Ian
 
thanks I'll try that!, another question, how to find out which object has the focus?

thanks!
 
How about:
ThisForm.ActiveControl.Name

Please note: It's a good idea to start a new thread for each new question. That way someone who doesn't "care" or know about the original topic, will actually see the new question. Also, it makes searching for Q & A's much easier.

Rick
 
To answer the question about passing values, every instantiation of every object in VFP can be used to 'talk' to.
This is one of the very important things in object programming. So passing values should not be that difficult when using methods and properties.

You can even pass a whole object as a paranmeter and talk to that object within a fucntion/procedure or method.

HTH,
Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top