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. How to format ugly treeview checkbox?

How to format ugly treeview checkbox?

Scheduled Pinned Locked Moved C#
questionbusinesshelptutorial
3 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.
  • P Offline
    P Offline
    pliu_2000
    wrote on last edited by
    #1

    Hi, I am writing an application containing a treeview. The requirements state that the treeview should have checkboxes to help multi-selection. However, the checkboxes on the treeview do not look nice at all :sigh:. The checkbox outline is thick and looks rather silly. How can I change this? :confused: Is it possible to make the outline thinner? Any help is much appreciated :-D Regards Peter

    J 1 Reply Last reply
    0
    • P pliu_2000

      Hi, I am writing an application containing a treeview. The requirements state that the treeview should have checkboxes to help multi-selection. However, the checkboxes on the treeview do not look nice at all :sigh:. The checkbox outline is thick and looks rather silly. How can I change this? :confused: Is it possible to make the outline thinner? Any help is much appreciated :-D Regards Peter

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      First, there are some free controls on Codeproject that do this already. Check them out if you haven't yet. Secondly, you can try drawing the checkbox using either the system drawing (which is unthemed):

      System.Windows.Forms.ControlPaint.DrawCheckBox

      Or if you're using .NET 2.0, you can try drawing the system themed checkbox which looks a lot nicer:

      using System.Windows.Forms.VisualStyles;
      ...

      if(VisualStyleInformation.IsSupportedByOS == true)
      {
      VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.CheckedNormal);
      renderer.DrawBackground(myGraphicsSurface, rectangleToDrawIn);
      }

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Little House on the Flickr Judah Himango

      P 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        First, there are some free controls on Codeproject that do this already. Check them out if you haven't yet. Secondly, you can try drawing the checkbox using either the system drawing (which is unthemed):

        System.Windows.Forms.ControlPaint.DrawCheckBox

        Or if you're using .NET 2.0, you can try drawing the system themed checkbox which looks a lot nicer:

        using System.Windows.Forms.VisualStyles;
        ...

        if(VisualStyleInformation.IsSupportedByOS == true)
        {
        VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.CheckedNormal);
        renderer.DrawBackground(myGraphicsSurface, rectangleToDrawIn);
        }

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Little House on the Flickr Judah Himango

        P Offline
        P Offline
        pliu_2000
        wrote on last edited by
        #3

        Thanks for your reply :-D I'm using .NET 1.1 so will try the System.Windows.Forms.ControlPaint.DrawCheckBox approach. I'll also have a look for the controls you talked about too.

        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