|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB.NET Screen Stops Refreshing After Losing Focus??I have a .NET form where I am updating a progress bar & counter. As long
as the form never loses focus, everything on the form refreshs fine. But If I open another window (like Windows Explorer) and then re-select my .net form, thos fields no longer refresh. Why and ho wdo I make it start refreshing again? Thanks On Thu, 01 Jun 2006 13:29:45 -0700, Chris Moore wrote:
> I have a .NET form where I am updating a progress bar & counter. As long It sounds like you're accessing some of your UI controls from a worker> as the form never loses focus, everything on the form refreshs fine. But If > I open another window (like Windows Explorer) and then re-select my .net > form, thos fields no longer refresh. Why and ho wdo I make it start > refreshing again? thread (the progress bar and the counter probably). UI controls must be accessed from the UI thread only. If you have to access them from a worker thread, use Control.Invoke or Control.BeginInvoke to marshall the call to the UI thread. Mehdi <vio***@REMOVEME.gmail.com> wrote in
I have no idea what you just said, sorry. What I have is 1 form with a button, progress bar & label on it. When I run it, I press the button that then calls a procedure (that is in the form) to process some records and update the controls. What am I missing or not understanding? Thanks Show quoteHide quote news:heawgmahabxx.zuvwiijdairp.dlg@40tude.net: > On Thu, 01 Jun 2006 13:29:45 -0700, Chris Moore wrote: > >> I have a .NET form where I am updating a progress bar & counter. As >> long as the form never loses focus, everything on the form refreshs >> fine. But If I open another window (like Windows Explorer) and then >> re-select my .net form, thos fields no longer refresh. Why and ho >> wdo I make it start refreshing again? > > It sounds like you're accessing some of your UI controls from a worker > thread (the progress bar and the counter probably). UI controls must > be accessed from the UI thread only. If you have to access them from a > worker thread, use Control.Invoke or Control.BeginInvoke to marshall > the call to the UI thread. > try putting
Application.DoEvents() within the loop -tom Chris Moore ha scritto: Show quoteHide quote > Mehdi <vio***@REMOVEME.gmail.com> wrote in > I have no idea what you just said, sorry. What I have is 1 form with a > button, progress bar & label on it. When I run it, I press the button > that then calls a procedure (that is in the form) to process some records > and update the controls. > > What am I missing or not understanding? > > Thanks > > news:heawgmahabxx.zuvwiijdairp.dlg@40tude.net: > > > On Thu, 01 Jun 2006 13:29:45 -0700, Chris Moore wrote: > > > >> I have a .NET form where I am updating a progress bar & counter. As > >> long as the form never loses focus, everything on the form refreshs > >> fine. But If I open another window (like Windows Explorer) and then > >> re-select my .net form, thos fields no longer refresh. Why and ho > >> wdo I make it start refreshing again? > > > > It sounds like you're accessing some of your UI controls from a worker > > thread (the progress bar and the counter probably). UI controls must > > be accessed from the UI thread only. If you have to access them from a > > worker thread, use Control.Invoke or Control.BeginInvoke to marshall > > the call to the UI thread. > > That appears to have corrected it.
Thanks. tommaso.gasta***@uniroma1.it wrote in Show quoteHide quote news:1149198501.107577.129780@y43g2000cwc.googlegroups.com: > try putting > > Application.DoEvents() > > within the loop > > -tom > > Chris Moore ha scritto: > >> Mehdi <vio***@REMOVEME.gmail.com> wrote in >> I have no idea what you just said, sorry. What I have is 1 form with >> a button, progress bar & label on it. When I run it, I press the >> button that then calls a procedure (that is in the form) to process >> some records and update the controls. >> >> What am I missing or not understanding? >> >> Thanks >> >> news:heawgmahabxx.zuvwiijdairp.dlg@40tude.net: >> >> > On Thu, 01 Jun 2006 13:29:45 -0700, Chris Moore wrote: >> > >> >> I have a .NET form where I am updating a progress bar & counter. >> >> As long as the form never loses focus, everything on the form >> >> refreshs fine. But If I open another window (like Windows >> >> Explorer) and then re-select my .net form, thos fields no longer >> >> refresh. Why and ho wdo I make it start refreshing again? >> > >> > It sounds like you're accessing some of your UI controls from a >> > worker thread (the progress bar and the counter probably). UI >> > controls must be accessed from the UI thread only. If you have to >> > access them from a worker thread, use Control.Invoke or >> > Control.BeginInvoke to marshall the call to the UI thread. >> > > > good.
Applications are like humans, sometimes they need to breath :) -tom ods ha scritto: Show quoteHide quote > That appears to have corrected it. > > Thanks. > > > tommaso.gasta***@uniroma1.it wrote in > news:1149198501.107577.129780@y43g2000cwc.googlegroups.com: > > > try putting > > > > Application.DoEvents() > > > > within the loop > > > > -tom > > > > Chris Moore ha scritto: > > > >> Mehdi <vio***@REMOVEME.gmail.com> wrote in > >> I have no idea what you just said, sorry. What I have is 1 form with > >> a button, progress bar & label on it. When I run it, I press the > >> button that then calls a procedure (that is in the form) to process > >> some records and update the controls. > >> > >> What am I missing or not understanding? > >> > >> Thanks > >> > >> news:heawgmahabxx.zuvwiijdairp.dlg@40tude.net: > >> > >> > On Thu, 01 Jun 2006 13:29:45 -0700, Chris Moore wrote: > >> > > >> >> I have a .NET form where I am updating a progress bar & counter. > >> >> As long as the form never loses focus, everything on the form > >> >> refreshs fine. But If I open another window (like Windows > >> >> Explorer) and then re-select my .net form, thos fields no longer > >> >> refresh. Why and ho wdo I make it start refreshing again? > >> > > >> > It sounds like you're accessing some of your UI controls from a > >> > worker thread (the progress bar and the counter probably). UI > >> > controls must be accessed from the UI thread only. If you have to > >> > access them from a worker thread, use Control.Invoke or > >> > Control.BeginInvoke to marshall the call to the UI thread. > >> > > > > > Good grief! I've Googled high and low for this answer. I
've been developing Web apps for so long I'd forgotten how to do this. I know this is not the way I used to do it but this is far easier. Thank you so much! -Olice
what's available in WMI
File sitting on a network drive is still open by another applicati popup windows killer Why choose SQL Express over Access? Offset lines appearing over form after delay (NVIDIA Chipset) "select case" statement optimization in VB and C# problems Soap Formatter namespace not found Restart, but after a delay Update database field WTSEnumerateProcesses |
|||||||||||||||||||||||