🔒 Closed Remove Flickering on your Listview/Listbox/TextBox

Status
Not open for further replies.
As you can see, when you use Listview or Listbox, when you load multiple strings you'll notice the flickering

here's the fix for that problem.


CODE:

I made this as static for global usage if you have multiple form that has listview/listbox/textbox

C#:
public static void SetDoubleBuffered(Control control) {
  typeof(Control).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, control, new object[] {
    true
  });
}

USAGE:

Code:
 public partial class TestForm : Form
    {
public TestForm()
{
    InitializeComponent();
    //example the code is in your Utils.css class
    Utils.SetDoubleBuffered(listBox1);
    Utils.SetDoubleBuffered(ListView);
    Utils.SetDoubleBuffered(TextBox)
}
 
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 538
    Views
  • 1
    Participants
Last reply from:
zackmark29

Trending Topics

Online now

Members online
1,205
Guests online
2,724
Total visitors
3,929

Forum statistics

Threads
2,331,843
Posts
29,260,713
Members
1,147,852
Latest member
applemaple11
Back
Top