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

ENTER key act as RETURN key

Status
Not open for further replies.

gforrest

Programmer
Apr 26, 2000
39
0
0
CA
Hi,

I want to have the ENTER key act as a RETURN key inside a Memo box so that users may enter multiple lines of text.

Currently, if the user presses the ENTER key the form closes which I don't want to have happen. I have set the default property on the OK button on the form to FALSE.

Thanks
 
Set the WantReturns property of the Memo to true (although, in my case, it's true by default).
If it doesn't work, see if there isn't an OnKey... event that messes around (if you're debugging/working on someone else's code).
You should still be able to insert return-characters by pressing Ctrl+Enter.
And remember:
"If everything else fails, plug it in" -Murphy :) Raz (just trying to be useful)
 
gforrest,

Adding to razvanj's reply, it sounds like your OK button has it's Default property set to TRUE. This is especially easy to do if you're using a tBItBtn with a Kind set to bkOK.

In this case, you'll want to set Default to FALSE. You may also want to set Kind to bkCustom and then use the button's OnClick event to set ModalResult := TRUE after validating any data inputs.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top