Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resize method causes the error
Message
From
10/01/2023 12:20:49
 
 
To
10/01/2023 12:18:09
General information
Forum:
Visual FoxPro
Category:
Contracts, agreements and general business
Miscellaneous
Thread ID:
01685755
Message ID:
01685775
Views:
21
>>>>>>Hi,
>>>>>>
>>>>>>I have a form with a grid in the left side of the form. The grid is data driven (that is created when the form is instantiated).
>>>>>>What happens is when a user resized the form to such small size that the left-side grid is just a line (or maybe two vertical lines), the run-time error occurs:
>>>>>>
>>>>>>Error with left_pane_grid - width : Expression evaluates to an illegal value
>>>>>>
>>>>>>
>>>>>>How do you suggest to prevent this problem?
>>>>>>
>>>>>>UPDATE. There is a custom (my) code in the method RESIZE. The code in this methods set the .Width of the grid.
>>>>>>I need to "catch" it before it gets too small.
>>>>>
>>>>>Check MinWidth in Help...!
>>>>
>>>>It looks like this property (in Help) is only applied to form or _screen. When I view all the properties of the grid, I don't see this property.
>>>
>>>That's correct, it applies to the form. Seems like exactly what you are looking for? Just set it to a value that's big enough to avoid the error.
>>>
>>>Having said that, have you considered using anchors for all the objects? That's the modern way to do it.
>>
>>I do use anchors for all controls. This grid has the value of 5 in the Anchor property. Which worked, until user wants to resize the form to very small.
>
>...until user wants to resize the form to very small. Which you avoid by setting form properties MinWidth and MinHeight to the minimum values you can accept.

You see, the FORM MinWidth and MinHeight are still within the allowed. It is just when the form is being resized, the grid (in the left-side) is being resized too. And getting the grid too small causes the problem.
Which, btw, Dragan's suggestion solved.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform