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

  • SEARCH
  • Home
  • 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 6853733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:32:48+00:00 2026-05-27T01:32:48+00:00

I am using CheckedListBox , but I need to highlight individual items with different

  • 0

I am using CheckedListBox , but I need to highlight individual items with different colors/fonts or some other highlighting method.

But it allows to change visual properties for the whole control only and not for individual items.

Additional Info:
I am using 2 such lists (because need checkboxes for easier selection) and 2 buttons (>> <<) for include/exclude type functionality. Is there any other better way to implement such whereby my requirement as above also gets fulfilled ?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-27T01:32:49+00:00Added an answer on May 27, 2026 at 1:32 am

    I’ve only dabbled with DevExpress controls, but I think you have to subscribe to the DrawItem event and set the e.Handled property to true.

    Something like this (CheckedListBox items with different colors):

    private void checkedListBoxControl1_DrawItem(object sender, ListBoxDrawItemEventArgs e) {
      CheckedListBoxControl clbControl = sender as CheckedListBoxControl;
      ButtonState state = ButtonState.Normal;
      if (clbControl.GetItemChecked(e.Index))
        state = ButtonState.Checked;
    
      ControlPaint.DrawCheckBox(e.Graphics, new Rectangle(e.Bounds.X, e.Bounds.Y, 15, 15), state);
    
      string itemText = e.Item.ToString();
      Rectangle textRect = new Rectangle(e.Bounds.X + 15, e.Bounds.Y, e.Bounds.Width - 15, e.Bounds.Height);
      if ((e.State & DrawItemState.Selected) != 0) {
        e.Graphics.FillRectangle(SystemBrushes.Highlight, textRect);
      }
    
      if (state== ButtonState.Checked)
        e.Graphics.DrawString(itemText, e.Appearance.Font, new SolidBrush(Color.Red), textRect, e.Appearance.GetStringFormat());
      else
        e.Graphics.DrawString(itemText, e.Appearance.Font, new SolidBrush(Color.Black), textRect, e.Appearance.GetStringFormat());
    
      e.Handled = true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I create an array containing the checked items in a checkedlistbox using
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using C#, I need a class called User that has a username, password, active
I'm writing an windforms application using .NET (actually IronPython, but that's not relevant), and
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
using a binary search tree I need to add to a vector all int
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using C# How can I show a document in richtextbox without scrollbars, But I
Using Visual Studio / C#, I've been debugging some nunit tests recently, and am
i've added a checkbox to a checkedlistbox using the following code: CheckBox cb =

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.