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. Checkedlistbox, different font (style) for each item?

Checkedlistbox, different font (style) for each item?

Scheduled Pinned Locked Moved C#
tutorialhelpquestion
4 Posts 2 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.
  • K Offline
    K Offline
    Karavaev Denis
    wrote on last edited by
    #1

    Hello, everyone. A little help needed ) Is there any posibility to use different font style for different items in checkedlistbox? For example, if I want to strike item if it's checked? Can't find how to do that with standart checkedlistbox ( Thanks,

    D 1 Reply Last reply
    0
    • K Karavaev Denis

      Hello, everyone. A little help needed ) Is there any posibility to use different font style for different items in checkedlistbox? For example, if I want to strike item if it's checked? Can't find how to do that with standart checkedlistbox ( Thanks,

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      I think you'll need to handle the drawing yourself to do that. You can get the same effect by using a ListView with the View set to List and CheckBoxes to true, then set the Font of any ListViewItems that you need to have different. [edit] Just had a look, and the CheckedListBox doesn't support DrawItem so it's going to be a little more difficult if you don't want to use a ListView. You'd have to derive your own class from CheckedListBox and override OnDrawItem there.[/edit]

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      K 1 Reply Last reply
      0
      • D DaveyM69

        I think you'll need to handle the drawing yourself to do that. You can get the same effect by using a ListView with the View set to List and CheckBoxes to true, then set the Font of any ListViewItems that you need to have different. [edit] Just had a look, and the CheckedListBox doesn't support DrawItem so it's going to be a little more difficult if you don't want to use a ListView. You'd have to derive your own class from CheckedListBox and override OnDrawItem there.[/edit]

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        K Offline
        K Offline
        Karavaev Denis
        wrote on last edited by
        #3

        I've tryed to handle drawing, but it draws all control and I need one item (

        D 1 Reply Last reply
        0
        • K Karavaev Denis

          I've tryed to handle drawing, but it draws all control and I need one item (

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          See the edit to my previous post.

          Dave
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

          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