Windows XP中的EnableVisualStyles [英] EnableVisualStyles in Windows XP

查看:125
本文介绍了Windows XP中的EnableVisualStyles的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在Windows窗体上有一个列表视图,它有组和2列。第一列应显示图像,另一列用于文本。列表视图设置为View = Tile,ImageList提供给LargeImageList属性。



现在,当我在Windows XP模式下运行应用程序时,图像并没有显示在Windows 7上运行相同应用程序的位置时,图像显示在列表中。



应用程序已经有EnableVisualStyle的代码,请参阅下文。

Hi,

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.

Now, when i run the application in Windows XP mode the Image doesn''t show up where as when the same application when runned on Windows 7, the image shows up in the list.

Application already has code to EnableVisualStyle, please see below.

if (Application.RenderWithVisualStyles == false)
				{
				    var listView1 = new List<listviewitem>();
                    Application.EnableVisualStyles();

                    // If visual styles did not turn on (we are in Citrix or they are turned 
                    // off in Windows), we don't want DoEvents to post messages
                    if (Application.RenderWithVisualStyles)
                        Application.DoEvents();
                }



当在Windows XP中执行此代码时,内部外观不会执行 DoEvent()

其次,即使强行执行 DoEvents(),图像仍然不会出现在Windows XP中。 />


如果有人能对此有所了解并帮我解决它...



谢谢你,

Rachna



已添加代码块[/ Edit]


When this code is executed in Windows XP, the inside look doesn''t execute DoEvent().
Secondly, even if forcefully executed DoEvents(), still the image doesn''t show up in Windows XP.

If anybody could shed some light on this and help me resolve it...

Thank You,
Rachna

Code block added[/Edit]

推荐答案

启用VisualStyle后,可能需要一段时间才能获得RenderWithVisualStyles属性的True。在检查此属性之前尝试执行另一个DoEvents()。
After enabling VisualStyle it may take sometime to get True for RenderWithVisualStyles property. Try executing another DoEvents() before checking this property.


这篇关于Windows XP中的EnableVisualStyles的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆