Link to home
Start Free TrialLog in
Avatar of sopheak
sopheak

asked on

Easy question

How do I make it so that when a user click on btnSave,

The cursor turns into an hourglass
and nothing else can be done while save is in progress.

Thanks
Avatar of AnswerTheMan
AnswerTheMan

Screen.MousePointer=vbHourGlass
to release :
Screen.MousePointer=vbDefault
Avatar of sopheak

ASKER

I tried it, but I can still click on other buttons (even with the hourglas cursor) while the save is in progress.  Am I missing something?

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sopheak

ASKER

Thanks, that was it
I usually do this to deal with that problem :

 I don't know how heavy your application is but, I usually put all my buttons on a container
( Ex. PictureBox ).

Then put the picturebox without border and the correct BackColor so that you can not tell that there is a picturebox on the form. When the "Save" is in progress, put the picturebox like so :

 MousePointer = vbHourGlass
 Picture1.enabled = false
 
 'Job...
 'Job...
 'Job...
 'Job finished

 Picture1.enabled = true
 Mousepointer = vbDefault

 OK !