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