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

SET FOCUS on FORM

Status
Not open for further replies.

stlrain95

Programmer
Joined
Sep 21, 2001
Messages
224
Location
US
I have a form that I need to set focus on when it is activated. What are the commands for this?

Currently it is a top form.

Also has a text box that I want focus on as well?


And last but not least is there a tab correction that I need to make so that when I hit enter it will actually execute the form?
 
object.setfocus is for focus.

I dont understand last question. If u want to button acting as a ENTER, change default property to .t.
 
By the last question I mean I have a form for user to put in a desired file name.

There is one text box and one command button.

When the form opens I want the focus set on the form with cursor mark in the text box.

Then when user is done they can hit enter to activate the command button.

Does this help a little?
 
Set your OK button's property 'Default' to .T. (as stated before) and give your textbox's property 'tabindex' the value of 1 so it will get the focus as the first control on that form.
if you wish to add a cancel button, you can add a button and set its property Cancel to .T.
When the user presses 'ESC' the cancel button's click event will be executed, so you can release or hide the form using the cancel button's click event.

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