Re: Frozen Gui

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
> > >
> > >
> >
> >
> >
.



Relevant Pages

  • Re: Frozen Gui
    ... 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 built dome dialog that can show the progress and make some actions. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Command Button Request
    ... The only way I can think of to terminate running code is to modify the loop ... whose value would be set by your command button. ... declare a Public variable named Done as a Boolean in the ...
    (microsoft.public.excel.programming)
  • Re: VB6, VB2005, or Something Else?
    ... If this is not an exclusive condition then ... There is no reason you have to resort to ... otherwise keep running code for awhile and then test to see if a ... stop the loop; ...
    (microsoft.public.vb.general.discussion)
  • Re: Controlling Pressure
    ... there is no guarantee that the "data" local on the right is read before it even receives a reasonable value from inside the loop. ... As Dennis said, your AO belong inside the loop, where you can wire the "data" directly, without any need for local variables. ... Your problem would become immediately obvious if you would run your VI using execution highlighting. ...
    (comp.lang.labview)
  • Re: please help on multithreading
    ... But the loop runs in a thread, therefore the Load method should ... you must call Show instead of ShowDialog. ... AND the progressForm while at the same time the loop is running.... ... progress form in the forerground. ...
    (microsoft.public.dotnet.languages.vb)