Click here to Skip to main content
15,031,495 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 is works for me..

        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);

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);

What I am done here wrong...

1 solution

Hi, you might want to consider running code to update your UI in a separate thread to the main thread of execution.

I have experienced similar problems with Winforms before and have found that the flickering behaviour you described is usually caused when you're trying to update your UI whilst performing another operation.
rajesh@1989 17-Jun-13 1:39am
Thank you Laurence!! and many many thank to Jonas
I got the using Jonas answer

I will soon update the exact answer for it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900