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

how to use include file in textboxes on class-form

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi!
I did create a log-in form in class.
On that form there are textboxes for user-name and password.
How do I put the statusbartext in those controls ?

In include file I did:
#DEFINE LOGIN_TEXTBOX1 "Type in username"

If I put LOGIN_TEXTBOX1 in textboxproperty Statusbar than at runtime not "Type in username" is shown but "LOGIN_TEXTBOX1".
What am I doing wrong?

TIA
-Bart
 
Bart,

Where do you reference the Include file? If it is from your code, the #DEFINEs will only be visible in your code, not in the properties.

To make #DEFINEs work in the properties of objects, go to the Form menu (in the Form Designer) or the Class menu (in the Class designer), then select "Include File", and enter the name of the file.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,
Thanks for your reply.
As a matter of facts I do reference the Include files as you say.
Nevertheless with unexpected result.
-Bart
 
Well, if you put lcStringvariable into a property it will also not get the value of the variable, but that text. You need =LOGIN_TEXTBOX1 and I'm quite confident vfp will use the constant.

Otherwise you'd need to set the property in the init event of the textbox in code. That will surely work.

Anyway, if your intention is to have localised texts, constants are not the best way, as you need tto recompile before a different .h file will take effect. It's the Precompiler that will replace constant by their value, it's not done at runtime. So localisation of applications is better done with tables and code anyway. Take a look at INTL Toolkit:
Bye, Olaf.

Bye, Olaf.
 
#DEFINE LOGIN_TEXTBOX1 "Type in username"

Try it without the quotes also in the textbox init() type in
This.statusbartext = [LOGIN_TEXTBOX1]
Include the header file using the form menu...
 
sorry just saw you are doing it in a class:

Include the header file using the form Class menu...
 
Olaf and Imaginecorp,
Thansk for prompt information.
The hint to put LOGIN_TEXTBOX1 using init-method did the trick.
Will start new thread about CONSTANTS versus separate table for 'message's etc.
Thanks,
-Bart
 
Olaf
thread 184-1543683
to continue on Constants versus table.
-Bart
 
Hi,
I have a grid containing multiple memo fields on a form in Visual Foxpro 9. I would like the contents of the memo fields to be displayed when the mouse moves over these fields, which it does when show tips is set to true.

The problem is that for one particular memo field I do Not want the contents of the memo to be displayed. I tried putting in text in the ToolTip Text for the text box and column property for this memo field. However, no change, the contents of the memo field is still displayed instead of the text that I entered.

Is there anyway to turn off show tips for one object? I know if I set show tips to false this will turn it off, but it will turn all my other tips off too.

Thanks.
 
Ir145
Better to start new thread for this subject so others will regognize your Q.
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top