-
September 4th, 2006, 07:23 AM
#1
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
have a nice day
Patzer
_____________________________
Philo will never be forgotten
-
September 4th, 2006, 07:53 AM
#2
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
If you find my answers helpful, dont forget to rate me
-
September 4th, 2006, 10:35 PM
#3
Re: Usercontrol & Mousepointer
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.
-
September 5th, 2006, 05:07 AM
#4
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
have a nice day
Patzer
_____________________________
Philo will never be forgotten
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|