Lock App Window

Moderator: Rathinagiri

Post Reply
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Lock App Window

Post 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
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Lock App Window

Post by mol »

Create simple modal window wirh label "Please wait until process ends..." with no title bar.
After finishing your function, release this window.
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Re: Lock App Window

Post by melliott42 »

I found the WAIT WINDOW example that that works perfect.

Thanks!
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Lock App Window

Post by srvet_claudio »

See:

Code: Select all

<FormName>.Enabled := .F.
	...
<FormName>.Enabled := .T.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Lock App Window

Post 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
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Re: Lock App Window

Post 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!
Post Reply