Re: Frozen Gui
- From: "Gabi" <Gabi@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 21:33:01 -0700
Hi All,
Thanks for your suggestins
Gabi
"Dennis" wrote:
> I have some long running code and at the start I show a status form using
> ShowDialog and disable the background form. In the long running loop, I
> update the showdialog form via a property called countdone and an
> application.DoEvents that gets called in each loop. I have tested it and the
> user can't close the form until either the loop completes or the user presses
> cancel in the dialog form. It seems to work ok and prevents the user from
> killing the application except thru the task manager.
> --
> Dennis in Houston
>
>
> "JP" wrote:
>
> > Oh.. oh.. be very careful with the DoEvents(). Don't use it straight in the
> > loop or work code.
> > The application will become slow as well and you can kill your application
> > without cleaning up if you use DoEvents()...
> > Instead use it with a timer something like with a status/statusbar property
> >
> > Private Sub tmStatusMonitor_Tick(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles tmStatusMonitor.Tick
> > If strStatus <> "Ready" Then 'strStatus is the custom property
> > sbStatus.Text = strStatus
> > Application.Doevents()
> > End If
> > End Sub
> >
> > Hope this helps
> >
> > --
> > Cheers,
> > JP
> > ------------------------------------------------------------------
> > A program is a device used to convert,
> > data into error messages
> > ------------------------------------------------------------------
> > "Mona" <mona@xxxxxxxxxxxxxxx> wrote in message
> > news:eoqbk9irFHA.3216@xxxxxxxxxxxxxxxxxxxxxxx
> > > Hello Gabi,
> > > How are you doing?
> > >
> > > For preventing an application from freezing, if you applicaiton uses some
> > > loop. Try using
> > > Application.DoEvents() method
> > > MSDN URL:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassdoeventstopic.asp
> > > This will enable the user to take actions while your form/procedure works.
> > >
> > > I hope this helps.
> > >
> > > Thanks
> > > Mona
> > > [Grapecity]
> > > "Gabi" <Gabi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:B4A69277-8853-4DEF-B5A8-387B56C05F83@xxxxxxxxxxxxxxxx
> > >> Hi All,
> > >> i built dome dialog that can show the progress and make some actions.
> > >> when im activating it, and do not touch any screen i can see the progress
> > >> bar progress and evrything work nice.
> > >> but when im open a new window (my computer for example)
> > >> the gui frozen and not respons until the gui finish the task.
> > >> is any one can tell me how can i can solve this kind of problem???
> > >> Thanks
> > >
> > >
> >
> >
> >
.
- References:
- Re: Frozen Gui
- From: JP
- Re: Frozen Gui
- From: Dennis
- Re: Frozen Gui
- Prev by Date: Multline -textbox
- Next by Date: Custom Control RaiseEvent
- Previous by thread: Re: Frozen Gui
- Next by thread: Re: Frozen Gui
- Index(es):
Relevant Pages
|