Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 49215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:24:06+00:00 2026-05-10T16:24:06+00:00

All I want is to update an ListViewItem’s text whithout seeing any flickering. This

  • 0

All I want is to update an ListViewItem’s text whithout seeing any flickering.

This is my code for updating (called several times):

listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString();    // update the state listViewItem.SubItems[1].Text = progress.ToString(); // update the progress listView.EndUpdate(); 

I’ve seen some solutions that involve overriding the component’s WndProc():

protected override void WndProc(ref Message m) {     if (m.Msg == (int)WM.WM_ERASEBKGND)     {         m.Msg = (int)IntPtr.Zero;     }     base.WndProc(ref m); } 

They say it solves the problem, but in my case It didn’t. I believe this is because I’m using icons on every item.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:24:07+00:00Added an answer on May 10, 2026 at 4:24 pm

    To end this question, here is a helper class that should be called when the form is loading for each ListView or any other ListView’s derived control in your form. Thanks to ‘Brian Gillespie’ for giving the solution.

    public enum ListViewExtendedStyles {     /// <summary>     /// LVS_EX_GRIDLINES     /// </summary>     GridLines = 0x00000001,     /// <summary>     /// LVS_EX_SUBITEMIMAGES     /// </summary>     SubItemImages = 0x00000002,     /// <summary>     /// LVS_EX_CHECKBOXES     /// </summary>     CheckBoxes = 0x00000004,     /// <summary>     /// LVS_EX_TRACKSELECT     /// </summary>     TrackSelect = 0x00000008,     /// <summary>     /// LVS_EX_HEADERDRAGDROP     /// </summary>     HeaderDragDrop = 0x00000010,     /// <summary>     /// LVS_EX_FULLROWSELECT     /// </summary>     FullRowSelect = 0x00000020,     /// <summary>     /// LVS_EX_ONECLICKACTIVATE     /// </summary>     OneClickActivate = 0x00000040,     /// <summary>     /// LVS_EX_TWOCLICKACTIVATE     /// </summary>     TwoClickActivate = 0x00000080,     /// <summary>     /// LVS_EX_FLATSB     /// </summary>     FlatsB = 0x00000100,     /// <summary>     /// LVS_EX_REGIONAL     /// </summary>     Regional = 0x00000200,     /// <summary>     /// LVS_EX_INFOTIP     /// </summary>     InfoTip = 0x00000400,     /// <summary>     /// LVS_EX_UNDERLINEHOT     /// </summary>     UnderlineHot = 0x00000800,     /// <summary>     /// LVS_EX_UNDERLINECOLD     /// </summary>     UnderlineCold = 0x00001000,     /// <summary>     /// LVS_EX_MULTIWORKAREAS     /// </summary>     MultilWorkAreas = 0x00002000,     /// <summary>     /// LVS_EX_LABELTIP     /// </summary>     LabelTip = 0x00004000,     /// <summary>     /// LVS_EX_BORDERSELECT     /// </summary>     BorderSelect = 0x00008000,     /// <summary>     /// LVS_EX_DOUBLEBUFFER     /// </summary>     DoubleBuffer = 0x00010000,     /// <summary>     /// LVS_EX_HIDELABELS     /// </summary>     HideLabels = 0x00020000,     /// <summary>     /// LVS_EX_SINGLEROW     /// </summary>     SingleRow = 0x00040000,     /// <summary>     /// LVS_EX_SNAPTOGRID     /// </summary>     SnapToGrid = 0x00080000,     /// <summary>     /// LVS_EX_SIMPLESELECT     /// </summary>     SimpleSelect = 0x00100000 }  public enum ListViewMessages {     First = 0x1000,     SetExtendedStyle = (First + 54),     GetExtendedStyle = (First + 55), }  /// <summary> /// Contains helper methods to change extended styles on ListView, including enabling double buffering. /// Based on Giovanni Montrone's article on <see cref='http://www.codeproject.com/KB/list/listviewxp.aspx'/> /// </summary> public class ListViewHelper {     private ListViewHelper()     {     }      [DllImport('user32.dll', CharSet = CharSet.Auto)]     private static extern int SendMessage(IntPtr handle, int messg, int wparam, int lparam);      public static void SetExtendedStyle(Control control, ListViewExtendedStyles exStyle)     {         ListViewExtendedStyles styles;         styles = (ListViewExtendedStyles)SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle, 0, 0);         styles |= exStyle;         SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);     }      public static void EnableDoubleBuffer(Control control)     {         ListViewExtendedStyles styles;         // read current style         styles = (ListViewExtendedStyles)SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle, 0, 0);         // enable double buffer and border select         styles |= ListViewExtendedStyles.DoubleBuffer | ListViewExtendedStyles.BorderSelect;         // write new style         SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);     }     public static void DisableDoubleBuffer(Control control)     {         ListViewExtendedStyles styles;         // read current style         styles = (ListViewExtendedStyles)SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle, 0, 0);         // disable double buffer and border select         styles -= styles & ListViewExtendedStyles.DoubleBuffer;         styles -= styles & ListViewExtendedStyles.BorderSelect;         // write new style         SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know if there's any way to update from all versions (Example:
All I want to do is update a text field on my page with
This is my problem: all I want to do is update a contact entity
I want to update the code on all my record to what they currently
What I want: Update all new commits from server with my local repository in
i want to update all records in my database(mongodb),I tried to use command below
I want to select multiple rows from checkbox and want to update them all
I have an ORM mapped object, that I want to update. I have all
I want to perform an update on all the rows in an XML column
I want to update all field values (of a custom field) to a specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.