v
Not logged inv
SearchAsk a QuestionReport an IssueMake a SuggestionMy Questions and Issues
KB Article
Find By ID

Strange problems when Application.EnableVisualStyles is used

Article Details

A1000
10/25/2011
.NET
n/a

There may be different symptoms of this problem. For example:

I.
We are getting an occasional InteropServices.SEHException when dragging a DockWindow into a new position. It does not seem to be related to our application.

II.
If I have visual styles (XP styles) enabled in the application, the images for the toolbar buttons all go away.

Solution

The problem is caused by the Application.EnableVisualStyles method. It is described in detail in the following article:
http://weblogs.asp.net/rprabhu/archive/2003/09/28/56540.aspx

To make a long story short, you should call the DoEvents method after EnableVisualStyles as shown below.

[VB.NET]

Application.EnableVisualStyles()

Application.DoEvents() ' <<<< NEW LINE

Do you have any comments? We are eager to hear them!

Average rating: 9 out of 9
1 people have rated this page
 
 
 
1
2
3
4
5
6
7
8
9
 
Post Your Vote (Login Required)
v
v
Search
Searching Tips