EnableVisualStyle issue in Windows XP on Windows Forms

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal Hi,<br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal I have a listview on Windows Form, which has groups and 2 columns. First column should show up image and other one is for the text. The listview is set
to View = Tile and ImageList is supplied to LargeImageList property. <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal Now, when i run the application in Windows XP mode the Image doesnt show up where as when the same application when runned on Windows 7, the image shows
up in the list. <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal Application already has code to EnableVisualStyle, please see below.<br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal <br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal if (Application.RenderWithVisualStyles == false)<br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal {<br style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal
<span style="color:#111111; font-family:Segoe UI,Arial,sans-serif; font-size:14px; line-height:normal var listView1 = new List<listviewitem style="color:#111111;font-family:Segoe UI, Arial, sans-serif;font-size:14px;line-height:normal; ();<br/>
Application.EnableVisualStyles();<br/>
<br/>
// If visual styles did not turn on (we are in Citrix or they are turned <br/>
// off in Windows), we dont want DoEvents to post messages<br/>
if (Application.RenderWithVisualStyles)<br/>
Application.DoEvents();<br/>
}<br/>
<br/>
When this code is executed in Windows XP, the inside look doesnt execute DoEvent().<br/>
Secondly, even if forcefully executed DoEvents(), still the image doesnt show up in Windows XP.<br/>
<br/>
If anybody could shed some light on this and help me resolve it...<br/>
<br/>
Thank You,<br/>
Rachna</listviewitem>

View the full article
 
Back
Top