Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. having user thread update listViewItem.BackColor

having user thread update listViewItem.BackColor

Scheduled Pinned Locked Moved C#
questionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yccheok
    wrote on last edited by
    #1

    Hello all, I try to have user thread to perform update on the window form list view item back color. However, I can see the new item was added each time. However, the back color just not changed until I move the window around. May I noe what code I had missing out? Thank you very much! delegate void OnGUIDelegate(int msgID, object param1, object param2); public void OnGUI(int msgID, object param1, object param2) { // Make sure we're on the right thread if(listView1.InvokeRequired == false) { switch(msgID) { case GUIMessage.MSG_ERR: if(param1 is string) { string strDate = DateTime.Now.ToLongTimeString(); string[] s = {strDate, (string)param1}; ListViewItem listViewItem = new ListViewItem(s); listViewItem.StateImageIndex = 2; listViewItem.BackColor = Color.FromArgb(255, 224, 192); listView1.Items.Add(listViewItem); isSave = false; } break; case GUIMessage.MSG_INFO: if(param1 is string) { string strDate = DateTime.Now.ToLongTimeString(); string[] s = {strDate, (string)param1}; ListViewItem listViewItem = new ListViewItem(s); listViewItem.StateImageIndex = 0; listViewItem.BackColor = Color.FromArgb(192, 255, 192); listView1.Items.Add(listViewItem); isSave =

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups