Visual Basic offers a simple way to use TreeView and is composing of nodes. TreeView control is very popular to organize file or folders.
Remove all the lines in the TreeView:
Remove all the plus minus sign in the TreeView:
Selection mode to full row select in the TreeView:
Increase the size of all items in the TreeView:
Increase the size of your icons or images in the TreeView:
Change the background Color in your TreeView
Next Post : Search a file
In a previous post, I show how to populate a TreeView with nodes and images: TreeView with Images for beginner.
Now, it is time to give more style to your TreeView. Take a look at the picture:
Honestly, the Windows 7 TreeView is much more interesting than the basic one. Yes, both work the same way. Here is some stuff you could do to enhance your TreeView without any big programming.
Remove all the lines in the TreeView:
Set ShowRootLines to false and ShowLines to false to hide all the lines in your TreeView.
Me.TreeView1.ShowRootLines = False Me.TreeView1.ShowLines = False |
Remove all the plus minus sign in the TreeView:
Set ShowPlusMinus to false in your TreeView.
Me.TreeView1.ShowPlusMinus = False |
Selection mode to full row select in the TreeView:
Set FullRowSelect to true in your TreeView to make it easier to select your item. Also, it improves the view when the user selects his item.
Me.TreeView1.FullRowSelect = True |
Increase the size of all items in the TreeView:
It is practically impossible to appreciate your program if your TreeView is tiny in your screen. Raise the default value to something more logical. Important to remember, it takes Integer values only.
Me.TreeView1.ItemHeight = 32 |
Increase the size of your icons or images in the TreeView:
If you raise the height of your TreeView, is realy not a bad idea to raise the height of your icon or image next to the text. You just need to set the value 1 time in the ImaList with ImageSize. I recommend putting 2 identical values to make a beautiful square. If not, you will have a little background effect
ImageList1.ImageSize = New System.Drawing.Size(24, 24) |
Change the background Color in your TreeView
Everyone knows the white background. Nothing will kill you if you change the background for a different color.
Me.TreeView1.BackColor = Color.DimGray |
So this ends with the basic changes you could do to your TreeView.
If we take a look to the Windows 7 Start Menu, you see there is a little improvement.
Other topics good to read: Extract icon from file
TreeView with Images for beginnerNext Post : Search a file
0 Response to "Customize your TreeView with Images for beginner"
Posting Komentar