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

Visual FoxPro 6 forms program

Status
Not open for further replies.

Phil Thoms

Programmer
Oct 31, 2005
245
GB
Thanks to Mike Lewis and JRBBLDR for your valuable comments.
I have just migrated to Visual FP from the earlier FoxPro and still going through the learning curve. I will compile this program as you suggested and make it accessible from the desktop. Everything now works well and looking good.
Just one further question:-
In forms can you join a label with a textfield as you could with the old foxpro with @ SAY command, eg.
@ 10,10 SAY 'Account No. '+fieldname so you don't end up with an input area ?
 
Hi Philthoms,

Good to hear you're making progress.

The @ .. SAY command works exactly as it does in older versions of FoxPro. If a form is active, the row and column numbers are relative to the form (so the text and field will appear within the form).

However, that is definitely not the recommeded way to do it. Although @ .. SAY and @ .. GET still work, there would be no point in moving to Visual FoxPro if you stick with those commands.

It is much better to use labels, textboxes and other visual controls in your forms. Using the form designer, you place these control directly on the surface on the form, then use their properties to customise their appearance and behaviour.

You use a label to display static text (text that the user doesn't edit). You use a textbox to display a data-entry field - or an edit box for a multi-line field, such as a memo field. There is also a combo box, listbox, grid and many more.

I recommend you read the Help topic "Working with forms", then try out some of these features.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
In VFP forms are objects and controls on it are objects too. They have properties. The .caption is the property having the text displayed, so you can do

Label1.Caption = "Account No. "+fieldname.

But you can also use an "input area", a textbox and set it's controlsource to the fieldname, then make it Readonly=.T. and it's not editable. Make it Enebled = .F. and you cannot even select and copy the account no. You can set the textbox to have no border, have a transparent background and it ooks like a label, an the advantage is if you change record and do a form.refresh(), the account no is updated from the controlsource.

I think you could also have done this in the old times, but whatever applies: Do you really think creating the screen look at runtime via commands printing at a certain position is good? The Visual in Visual Foxpro is meaning visually designing forms, you see what you get in advance. Isn't that a big advantage for the form layout process? It may be a pain to migrate, but there are converting tools for screens to forms, aren't there? What's their result?

I see from this article you only get the one or the other converted: design or functionality. If neither gives you an acceptable result think about keeping the old screen and convert by a rewrite. I'd perhaps not even try to change the functional or visual conversion in some cases.


Also keep in mind the converters where not updated to create VFP6+ forms, you get VFP5 forms not making use of all features which came in with VFP6-9.

Bye, Olaf.
 
If you're serious about learning to use VFP 6 after having worked with FP2.6, I strongly recommend you get a copy of Whil Hentzen's book "The Fundamentals" and work your way through it.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top