Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If you set a property on a Windows Forms control which forces the creation of the control (e.g. the SelectedIndex property on the ComboBox class), the control (and perhaps the rest of the form) will not render with visual styles enabled.
The resolution is to place the code that sets these properties in an event handler for the Load event on the form/control.
Comments
- Anonymous
April 28, 2004
I came across EnableVisualStyles a few days ago but using it caused an SEHException. There are some references on the web that you need to call DoEvents straight afterwards, but opinions differ as to whether this works 100%. See, for example, http://weblogs.asp.net/jkey/archive/2003/07/16/10157.aspx.
Is there an answer to this because usign a manifest file (the alternative) is rather messy. - Anonymous
April 28, 2004
there are many controls which do not support EnableVisualStyles properly. i round the best thing to do is use a manifest file as in .net 1.0. - Anonymous
April 29, 2004
Question, not sure if related.
I have a progress form with a progress bar. I open this form when my program launches. However, if I call Show() in a timer (I currently wait 1 sec before launching the form so that it can appear centered over the parent) the progress bar is not drawing using theming. However if I open the form in the main form's Load method then it draws using theming. However, I can't load it in the form's main method because the center parent property doesn't work since the parent form does not exist in the screen yet.
Is there a way to fix this? - Anonymous
April 30, 2004
Raghavendra has got some great tips on how to work with visual styles in Windows Forms at http://blogs.msdn.com/rprabhu/category/2838.aspx - Anonymous
June 27, 2004
http://www.favourite-links.com
http://www.links4you.biz - Anonymous
December 27, 2004
[http://itpeixun.51.net/][http://aissl.51.net/][http://kukuxz003.freewebpage.org/][http://kukuxz001.51.net/][http://kukuxz003.51.net/][http://kukuxz005.51.net/][http://kukuxz002.51.net/][http://kukuxz004.freewebpage.org/][http://kukuxz007.51.net/][http://kukuxz001.freewebpage.org/][http://kukuxz006.51.net/][http://kukuxz002.freewebpage.org/][http://kukuxz004.51.net/][http://kukuxz008.51.net/][http://kukuxz009.51.net/][http://kukuxz005.freewebpage.org/][http://kukuxz006.freewebpage.org/][http://kukuxz007.freewebpage.org/][http://kukuxz009.freewebpage.org/]