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

How to fix: after entering the value of the maximum length, the focus is immediately lost 1

Status
Not open for further replies.

sashaDG

Programmer
Jun 20, 2022
112
0
16
BY
When the full value is entered in the textbox, the focus moves to another
Code:
when the full value is entered in the Box, the focus moves to another
I understand that the maximum length has been exceeded, but I need the focus to remain on the textBox and I can only move the cursor with a click. Also, TABSTOP = .F. does not work for me. No more code in textbox
 
You can [tt]SET CONFIRM ON[/tt], then arriving at max length the focus does not automatically change.

Chriss
 
Great, just what you need! Thx Chris
 
TABSTOP = .F. does not work for me

TABSTOP = .F. prevents the user from moving to a control via the TAB key, but it doesn't prevent the control from receiving focus. The user will still be able to click on it, or use an access key; and you can still SetFocus programmatically. It has nothing to do with losing focus when the textbox is full.

Regarding SET CONFIRM, the default is OFF, but almost every application I've seen explicitly sets it to ON, which reflects the normal Windows behaviour. The default setting is for backward compatibility all the way back to dBASE.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top