M
mp
I have a wpf form with progress bar
searching files and parsing text takes time so prog bar is supposed to show
activity
the lines to increment it don't error but the control isn't repainting till
the end
Help says Application.DoEvents();
when i put that in the code i get compile error:
'System.Windows.Application' does not contain a definition for 'DoEvents'
but the help is for Windows forms not wpf
is there an equivalent in wpf? or how do i make the prog bar refresh
(i find no refresh or update or paint methods)
or maybe i'm not incrementing it correcxtly
foreach (string FileName in
System.IO.Directory.GetFiles(FolderName,"*.lsp"))
{
if (progressBar1.Value != progressBar1.Maximum)
{ progressBar1.Value++;} //<--------- does this not increment .Value ... it
was just a guess on my part as i thought ++ meant add one but maybe it won't
work on a property like that?
// do i need to do progressBar1.Value = progressBar1.Value +1?
//i was surprised not to find an .Increment or similar property on progbar
else
{
progressBar1.Value = progressBar1.Minimum;
}
thanks
mark
searching files and parsing text takes time so prog bar is supposed to show
activity
the lines to increment it don't error but the control isn't repainting till
the end
Help says Application.DoEvents();
when i put that in the code i get compile error:
'System.Windows.Application' does not contain a definition for 'DoEvents'
but the help is for Windows forms not wpf
is there an equivalent in wpf? or how do i make the prog bar refresh
(i find no refresh or update or paint methods)
or maybe i'm not incrementing it correcxtly
foreach (string FileName in
System.IO.Directory.GetFiles(FolderName,"*.lsp"))
{
if (progressBar1.Value != progressBar1.Maximum)
{ progressBar1.Value++;} //<--------- does this not increment .Value ... it
was just a guess on my part as i thought ++ meant add one but maybe it won't
work on a property like that?
// do i need to do progressBar1.Value = progressBar1.Value +1?
//i was surprised not to find an .Increment or similar property on progbar
else
{
progressBar1.Value = progressBar1.Minimum;
}
thanks
mark