Live Chat Icon For mobile
Live Chat Icon

Is EnableVisualStyles method to support XP styles in my app broken?

Platform: WinForms| Category: Framework

Microsoft has confirmed that calling EnableVisualStyles in the main method resulting in some ImageList corruption is a bug. There however seems to be a workaround posted by Martin Robins in the newsgroup which worksaround this issue:


public virtual void Main() { 
Application.EnableVisualStyles(); 
// Calling DoEvents after the above method call seems to fix this issue:
Application.DoEvents(); 
Application.Run(new Form1()); 
}

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.