Page 1 of 1

Lock App Window

Posted: Fri May 06, 2016 4:25 pm
by melliott42
Hello,

In some long running processes how can I lock the main window so no controls can be clicked on until my process is done?

I could individually disable all the controls but some controls I am using do not have a Enabled property. In Visual Basic I'd simply lock the window then unlock it until the freeze was over. I may have needed an API function to do this back in VB.

Does a Progress Bar control stop users from clicking on all other controls on a window?

What method do you use when doing these type operations where you want to stop anyone from being able to click on a control?


Thanks,

Michael

Re: Lock App Window

Posted: Fri May 06, 2016 4:55 pm
by mol
Create simple modal window wirh label "Please wait until process ends..." with no title bar.
After finishing your function, release this window.

Re: Lock App Window

Posted: Fri May 06, 2016 5:37 pm
by melliott42
I found the WAIT WINDOW example that that works perfect.

Thanks!

Re: Lock App Window

Posted: Fri May 06, 2016 6:48 pm
by srvet_claudio
See:

Code: Select all

<FormName>.Enabled := .F.
	...
<FormName>.Enabled := .T.

Re: Lock App Window

Posted: Fri May 06, 2016 8:25 pm
by EduardoLuis
Hi Melliot:

I use another option: i create a Window MODAL where i put - as your example - a progress bar control.-
Modal window must be defined with this properties:

NOSIZE ;
NOSYSMENU ;
NOCAPTION ;

This way you en user only see progress bar and wait till it ends meanwhile he can't do anythings.-

When progressbar or any process end, the window MODAL must be closed and end user returns to controll the app.-
Hopping this helps you.
With regards.
Eduardo

Re: Lock App Window

Posted: Fri May 06, 2016 9:05 pm
by mol
That is exactly what I mean :-D

Re: Lock App Window

Posted: Mon May 09, 2016 11:53 am
by melliott42
The Modal Window as you guys described is the best method I think.

I implemented the WAIT WINDOW because it was the quickest route but will change it accordingly. The modal window, as you guys described, will look more professional.

The WAIT WINDOW is pretty cool. Just wish it had more options.

Thanks!