CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Posts
    91

    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

  2. #2
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    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

  3. #3
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    516

    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.

  4. #4
    Join Date
    May 2001
    Posts
    91

    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
  •  





Click Here to Expand Forum to Full Width

Featured