本文介绍了列表视图中的闪烁问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了很多谷歌搜索,但我没有得到正确的解决方案,以阻止在listview中闪烁,因为我在richtextbox中停止闪烁,但我没有停止在列表视图中闪烁。
以下代码我以前在Richtexbox中停止闪烁...它对我有用..
[System.Runtime。 InteropServices.DllImport( user32.dll)]
private extern static IntPtr SendMessage( IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
// 每2秒后重新加载代码...
SendMessage(RichText_MessageData.Handle,0xb,( IntPtr ) 0 , IntPtr的跨度> .Zero);
// 在richtextbox中进行一些更改...
SendMessage(RichText_MessageData.Handle,0xb,( IntPtr ) 1 , IntPtr的跨度> .Zero);
RichText_MessageData.Invalidate();
我使用下面的代码来停止闪烁在listview中.....它没有用..
SendMessage(lv_employeelist.Handle,0xb,( IntPtr ) 0 , IntPtr .Zero);
// 每2秒在listview中添加一行..
SendMessage( lv_employeelist.Handle,0xb,( IntPtr ) 1 , IntPtr 跨度> .Zero);
lv_employeelist.Invalidate();
我在这做错了什么...
解决方案
I have do lots googling but I did not get right solution to stop flickering in listview as I am stop flickering in richtextbox but I did not stop flickering in listview.
following code I used to stop flickering in Richtexbox...it is works for me..
[System.Runtime.InteropServices.DllImport("user32.dll")] private extern static IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); //below code reloaded after every 2 seconds... SendMessage(RichText_MessageData.Handle, 0xb, (IntPtr)0, IntPtr.Zero); //doing some changes in richtextbox... SendMessage(RichText_MessageData.Handle, 0xb, (IntPtr)1, IntPtr.Zero); RichText_MessageData.Invalidate();
and I am using below code to stop flickering in listview.....It is not worked..
SendMessage(lv_employeelist.Handle, 0xb, (IntPtr)0, IntPtr.Zero); //adding rows in listview in every 2 seconds.. SendMessage(lv_employeelist.Handle, 0xb, (IntPtr)1, IntPtr.Zero); lv_employeelist.Invalidate();
What I am done here wrong...
解决方案
这篇关于列表视图中的闪烁问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!