Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen and Forms Width
Message
From
20/07/1998 08:06:55
 
 
To
17/07/1998 19:31:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00118753
Message ID:
00119222
Views:
24
>>>Using VFP 5.0
>>>
>>>I'm using sysmetric() to know the configuration
>>>of the screen (monitor).
>>>
>>>I want to change the form width depending on the
>>>user's screen width.
>>>
>>>In the form designer there is any way to change
>>>the width using a constant???
>>>
>>>I tried:
>>>
>>>ThisForm.Width = MyWidth
>>>
>>>But it doesn't work.
>>>
>>>MyWidth is a constant of the screen width.
>>>
>>>
>>>Any suggestion.
>>>
>>>Thanks in advance
>>>
>>>Francisco Cabeza
>>
>>As long as MyWidth is defined, it should work. What do you mean by "It doesn't work"? What does it do?
>>
>>Bill
>
>I used a memvar or constant, but the main problem is this:
>
>In the form designer, in properties you have Witdh, and there
>you can't put a memvar or constant. You have to put a number
>(10,120,640 etc) so I'm forced to put 640.
>
>In the Activate Event I put:
>
>ThisForm.Width=MyWidth (memvar or constant)
>
>Suppose MyWidth is 800. I also tried in the Init Event.
>
>When I run the form: The Width is still 640.
>
>I can't change it to 800 unles I put 800 in
>the Width Property of the form.
>
>So the width is always constant and I can't change it,
>dependign of sysmetric().
>
>Any suggestions.
>
>Thanks for your help and time.
>
>Francisco

Uh ... it works for me in both the Activate and the Init of the form. I would guess that you have either a scoping problem on the MyWidth variable ( you might want to make it a property of the form to stay OOP or make it a public variable ) or the value of MyWidth is either not being set properly or getting reset somehow.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform