![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | statusbar textblock update in long running operation I have a status bar on my window that contains a TextBlock. I am trying to update the text in the textblock during a long operation that's running inside a button click handler on the same window. The text doesn't update until the end, which is not what I want. I've tried several combinations of InvalidateArrange(), InvalidateVisual() and UpdateLayout() on both the TextBlock and it's parent StatusBar without success. How can I do this? Thanks, Scott |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: statusbar textblock update in long running operation It needs to be on a different thread - best way is probably to spawn a new thread on button click. Plenty of examples around. "Scott Walters" <scottw512@hotmail.com> wrote in message news:O1CkIyUzHHA.3400@TK2MSFTNGP03.phx.gbl... >I have a status bar on my window that contains a TextBlock. I am trying to >update the text in the textblock during a long operation that's running >inside a button click handler on the same window. The text doesn't update >until the end, which is not what I want. I've tried several combinations of >InvalidateArrange(), InvalidateVisual() and UpdateLayout() on both the >TextBlock and it's parent StatusBar without success. How can I do this? > > Thanks, > Scott |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: statusbar textblock update in long running operation Are you saying the long running operation should run in a second thread with a sync context so it can update the status bar ui on it's thread? If there's no other way, I guess that's what I have to do...but it seems like I should be able to call into the framework from the UI thread and tell it to refresh/repaint the status bar contents. Radek Cerny wrote: > It needs to be on a different thread - best way is probably to spawn a new > thread on button click. Plenty of examples around. > > "Scott Walters" <scottw512@hotmail.com> wrote in message > news:O1CkIyUzHHA.3400@TK2MSFTNGP03.phx.gbl... >> I have a status bar on my window that contains a TextBlock. I am trying to >> update the text in the textblock during a long operation that's running >> inside a button click handler on the same window. The text doesn't update >> until the end, which is not what I want. I've tried several combinations of >> InvalidateArrange(), InvalidateVisual() and UpdateLayout() on both the >> TextBlock and it's parent StatusBar without success. How can I do this? >> >> Thanks, >> Scott > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: statusbar textblock update in long running operation Its actually internally very complex, but externally simple, and the simple answer is no. If the UI thread is busy, nothing will redraw. "Scott Walters" <scottw512@hotmail.com> wrote in message news:OOb$oA4zHHA.5160@TK2MSFTNGP05.phx.gbl... > Are you saying the long running operation should run in a second thread > with a sync context so it can update the status bar ui on it's thread? > > If there's no other way, I guess that's what I have to do...but it seems > like I should be able to call into the framework from the UI thread and > tell it to refresh/repaint the status bar contents. > > Radek Cerny wrote: >> It needs to be on a different thread - best way is probably to spawn a >> new thread on button click. Plenty of examples around. >> >> "Scott Walters" <scottw512@hotmail.com> wrote in message >> news:O1CkIyUzHHA.3400@TK2MSFTNGP03.phx.gbl... >>> I have a status bar on my window that contains a TextBlock. I am trying >>> to update the text in the textblock during a long operation that's >>> running inside a button click handler on the same window. The text >>> doesn't update until the end, which is not what I want. I've tried >>> several combinations of InvalidateArrange(), InvalidateVisual() and >>> UpdateLayout() on both the TextBlock and it's parent StatusBar without >>> success. How can I do this? >>> >>> Thanks, >>> Scott >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running C# (.NET Framework 2.0) Application from long path (>127)crashes! | Stefan Pascal | .NET General | 1 | 06-05-2008 09:42 AM |
| Why would the statusbar and Go To functionality be inactive in not | klegg | Vista General | 3 | 05-10-2007 04:26 PM |
| Running disk defragmenter again still takes long | Mickey Segal | Vista performance & maintenance | 4 | 04-09-2007 11:52 PM |
| A Friendly Warning for those of you Running Windows Long Horn Server Build 6001. | Kevin John Panzke | Vista General | 15 | 02-16-2007 02:45 PM |