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

Form Wizard YIKES!

Status
Not open for further replies.

johnod33

Programmer
Mar 17, 2003
34
US
Fox Pro 6.0
I used the Fox Pro form wizard to create a way to view and edit a table. I am finding out that wasn't such a good idea. I should have built my own gui.

Each fields data is displayed in a text box. Each text box has a defined length.

My question is concerning a numeric field.
When I want to change the data in a specific field I double click on the text box so the data is highlighted (or I could use the K setting in FORMAT property)and start typing the new data the problem is when you type beyond the specified length of the text box you are typing in it jumps to the next text box (in the tab index) and starts over writing that data.
Any ideas on how to keep focus on the textbox you are working in?
 
The usual way of solving that problem is to execute:

SET CONFIRM ON

at the start of your program.

By the way, the form wizard is OK for generating quick-and-dirty forms, but is seldom used as part of a real development project.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike,

That's what this is. A quick and dirty way to display a table for my boss. She needs to edit it every twice in a while. It also runs in a secure environment where all the data tables are encrypted. I have found some weird things happening. thought maybe this was one of them.
 
If the user has typed in the maximum number of characters, why does he need to stay in the textbox? What behavior do you want to see instead?

pamela
 
Pamela,

One of the problems is the input mask. She wants to see the commas to make it easier to read long numbers i.e. 600,000 If you don't know you need to place the cursor in a particular position to edit (backspace or delete) you get unwanted results. So if you place the cursor as you enter the textbox at the second 0 from the right in 600,000 and type 650000 you end up with 600,065,000,0 and going into the next text box and overwriting data there.
It would be ideal if when you reach the right most length of the text box that you just won't be able write anymore and get some annoying beeps.

Sorry my job doesn't usually take me into the world of user input from a textbox.
John
 
1001 Things You Wanted to Know about Visual FoxPro" available from Hentzenwerke.com comes with a numeric textbox that solves a number of problems with VFP's native number data handling. That control alone is worth the price of the downloaded book.

pamela
 
John,

If I have a numeric field with an input mask (e.g. 99,999.99"), I usually remove the mask in the GotFocus, and restore it in the LostFocus. That way, you don't see the commas while you're editing, but you do see them the rest of the time, and it avoids the behaviour you described.

Did you try my SET CONFIRM ON suggestion?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Pamela, I will look into that book.

Mike, Yes, I tried the SET CONFIRM ON and it worked great. Trouble is now if you back space it will jump into the textbox before the one you are in. Believe me the user will do this!
I am trying the GEt and Lost Focus thing now. It seems to be working well.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top