|
-
Nov 18th, 2002, 02:23 PM
#1
Thread Starter
Lively Member
Setting the treeview backcolor to form color
I want to set the backcolor of the treeview control to the same grey shade as the form itself. However, I can't seem to find the exact same grey shade as the form.
Anyone have any ideas ?
-
Nov 18th, 2002, 02:48 PM
#2
Sleep mode
here you go
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object_
, ByVal e As System.EventArgs) Handles MyBase.Load
Dim color_of_Form1 As Color
color_of_Form1 = Me.BackColor
TreeView1.BackColor = color_of_Form1
End Sub
have fun!!
-
Nov 18th, 2002, 03:11 PM
#3
PowerPoster
Look at the backcolor of the form in the properties window. Then figure out what it is set for. It is probably a system color. Then just set the back color of the treeview to the same exact setting (which by default is one of the system colors).
-
Nov 18th, 2002, 04:32 PM
#4
Originally posted by pirate
here you go
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object_
, ByVal e As System.EventArgs) Handles MyBase.Load
Dim color_of_Form1 As Color
color_of_Form1 = Me.BackColor
TreeView1.BackColor = color_of_Form1
End Sub
have fun!!
Whats wrong with: TreeView1.BackColor = Me.BackColor?
Also the systemColors are enumerated in as SystemColors:
TreeView1.BackColor =SystemColors.Control
-
Nov 18th, 2002, 04:36 PM
#5
Sleep mode
nothing wrong with the code. . I was really wondering if there was any worng with that. Guess none.
-
Nov 18th, 2002, 06:00 PM
#6
Thread Starter
Lively Member
Thanks to everyone for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|