Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To lock screen or not
Message
 
 
To
15/04/2011 08:43:59
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01507393
Message ID:
01507462
Views:
68
What harm would it cause if after grid does Refresh() it sets the Lockscreen to false?

>Beg to disagree - Craig's code is fine
>
>Suppose a control on the form - say a grid - also sets and resets LockScreen in its Refresh()
>
>Thisform.Refresh() triggers grid.Refresh()
>
>If LockScreen is true when the grid does its Refresh(), it should not set it to false upon exit
>
>___
>
>>I don't see how your code makes this less dangerous. If I always unlock the screen after .Refresh() then I am already doing it as safe as possible. The only thing your code will do is possibly leave the screen in locked state (if prior to this code the screen was locked) and this could be harmful. Thank you.
>>
>>>IMO, that's dangerous code. Always save the current value going in and reset to that going out, so the code would look like:
>>>
>>>llLockScreen = ThisForm.LockScreen
>>>ThisForm.LockScreen = .T.
>>>ThisForm.Refresh()
>>>ThisForm.LockScreen = llLockScreen
>>>
>>>
>>>>Hi,
>>>>
>>>>When I started developing in VFP (I think around 1998) I read somewhere that it is a good idea to call .LockScreen .T. before calling form.refresh(). So I have in a lot of places in my application call to method Thisform.MyRefresh(). And the code in the MyRefresh() is
>>>>
>>>>
>>>>thisform.Lockscreen = .T.
>>>>thisform.refresh()
>>>>thisform.Lockscreen= .F.
>>>>
>>>>
>>>>Does it still make sense to keep this code? Or with the hardware we have today the refresh is just as fast with or without Lockscreen?
"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
Next
Reply
Map
View

Click here to load this message in the networking platform