Question Problem in ToolStripProgressBar painting (VS.Net 2010, WinForms).

priyamtheone

Well-known member
Joined
Sep 20, 2007
Messages
94
Programming Experience
Beginner
Ensure ApplyVisualStyles is enabled in your system. Place a ToolStripProgressBar on a toolstrip, run your application and minimize the form. Now change the theme of your computer to Windows Classic and restore the form. See the interior of the ToolStripProgrssBar becomes black. It doesn't even change if you refresh the form. How does the user know the status of the progress if it remains black always? Any approach to fugure it out? Regards.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,412
Location
Norway
Programming Experience
10+
It seems to be a bug, I can reproduce that. One way to remedy it is to handle SystemEvents.UserPreferenceChanged for e.Category=VisualStyle and change the progressbar.Style to something and back again.
 

priyamtheone

Well-known member
Joined
Sep 20, 2007
Messages
94
Programming Experience
Beginner
Repainting the control by Invalidating or Refreshing it doesn't work too. Thanks for your code. It worked. Nice thing to know.
 
Top Bottom