Usercontrol & Mousepointer
Hi out there,
I have a problem around a usercontrol that I've developed.
On a Form I have several instances of the usercontrol. On changing a combo on that control it gets data from a database, populates some controls on the form. fills some classes etc.
This takes some time, and as long as it takes, the form should be visible but not availabe while showing the usual hourglass.
I tried form.enabled = false but then the hourglas disappears
Re: Usercontrol & Mousepointer
Could you not do somthing like
Dim x As Control
For Each x In Me
x.Enabled = False
Next
at the begining then do the same at the ned setting enable to true
Re: Usercontrol & Mousepointer
Quote:
Originally Posted by Bill Crawley
Could you not do somthing like
Dim x As Control
For Each x In Me
x.Enabled = False
Next
at the begining then do the same at the ned setting enable to true
The only problem I would see with this approach is that it would grey all of the controls on the form. The only way a user would be able to interact with the form when your code was executing would be if you had DoEvents calls. Granted, user interaction would be added to the event que, but nothing would happen until you were done executing. I would personally set a global "in process" boolean, and only allow critical controls' code to execute when it was false. If you want to form to refresh during code, change any DoEvents to .Refresh calls and that should do it.
Re: Usercontrol & Mousepointer
Hi Comintern,
I like your idea with the boolean, though I hoped that there may exist a method (maybe of the form) that could handle that. Now sadly I have to write some code :)