Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a modal form only appear when needed???
Message
 
To
17/08/1999 10:57:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00254532
Message ID:
00254596
Views:
23
>I have a big problem. I am writting an international application and I needed a messagebox with the ability to change the button text. So I thought I'd make my own, all was lovely until I tried to make the form automatically adjust its width depending on the amount of text being sent.
>
>I have tried several ways including calculating the width using FONTMETRIC AND TXTWIDTH but because they work on an average width of a character for a font it was no good. So I got around it by placing the text into a label and setting the label to AutoSize. Then referencing the width of the label to calculate the form width. I have got it to resize but what I need to do is make the form only be shown after the form width has been changed. At present the form resizes itself so everyone can see it, which looks crap to put it plainly.
>
>Does anyone know of a way around this???
>
Hi Lee,

Depends on whether your form is being run with DO FORM or an object is created. In the former case, use the NAME and NOSHOW clauses. This will allow you to get a reference to the form prior to its being displayed. You can then size the form appropriately, and issue something like oForm.Show. You can use basically the same idea if you're using CREATEOBJECT() to instantiate the class.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform