Recently, the system.windows.form.treeView has been renovated due to the needs of the company's products, allowing it to have a better appearance, which can display text, button, link text at the same time on the tree knot point. . . You can also customize your own display, such as the text, as shown below
Ok, let's take a look at how to achieve it.
First create class OwntreeView inherit from System.Windows.form.treeView, need to complete the main heavy draw features in it.
Then create a virtual TreeViewColStyle for custom tree nodes.
Finally, by inheritance overwriting the false category, generate the column TreeViewButtonStyle displaying Button, the list of the link is displayed, and the column TreeViewTextStyle of the general text is displayed.
code show as below
1. OwntreeView Class Source Code:
#Region "Implement the overall TreeView Heavy Picture" Public Class OwntreeView Inherits System.Windows.Forms.treeView
#Region "Windows Form Designer Generated Code"
Public Sub new () mybase.new ()
'This call is required for the Windows Form Designer. InitializeComponent ()
'In the InitializeComponent add any initialization Me.SetStyle () after the call (ControlStyles.UserPaint Or ControlStyles.Selectable, True)' Me.SetStyle (ControlStyles.UserMouse, True) Me.SetStyle (ControlStyles.StandardClick Or ControlStyles.StandardDoubleClick, False) Me .SetStyle (ControlStyles.ResizRedraw, true) me.setStyle (Controlstyles.allpaintingInwmpaint or Controlstyls.doublebuffer, true)
End Sub
'UserControl1 Rewinds Dispose to clean the component list. Protected overloads overrides sub dispose (byval disposing as boolean) ing disponation kiln (Components Is Nothing) Then components.dispose () end if endiffs) End Sub
'Windows Form Designer Supply Private Components as System.comPonentModel.icontainer
'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor.
#End Region # Region "class variables were defined" 'Save Style object Private m_TVColumnStyles As ArrayList' triggered the click event Public Event TreeViewClick (ByVal ClickNode As TreeNode, ByVal CurrentCol As Integer) 'separate display symbols of node.text Private m_Seperator As String = "," The Route Private M_INDENT AS INTEGER = Me.indent 'plus size Private PWID AS INTEGER = 6' mousedown When the mouse is located in the Node Private selnode as treenode 'mousedown Mouse Location PRIVATE currentStyle As Integer 'when the mouse cursor mousedown cell bounds Private SelNodeBound As Rectangle' own graphics object Private m_graphics As Graphics = Me.CreateGraphics 'color wired Private m_LineColor As color = Color.DarkGreen' plus and minus button frame Color private m_plusminusbordercolor as color = color.darkgreen 'Dickstered button color Private m_plusminuscolor as color = color.darkorange # End Region
#Region "Class Out" 'Settings List Public Property SEPERATOR () AS String Get Return Me.m_seperator End Get Set (Byval Value As String) Me.m_seperator = Value End End Property' Connection Colors of Public Property LineColor () As color Get Return Me.m_LineColor End Get Set (ByVal Value As color) Me.m_LineColor = Value End Set End Property 'plus and minus button outline color Public Property PlusMinusBorderColor () As color Get Return Me.m_PlusMinusBorderColor End Get Set (ByVal Value As color) Me.m_PlusMinusBorderColor = color Public Value End Set End Property 'plus and minus buttons Property PlusMinusColor () As color Get Return Me.m_PlusMinusColor End Get Set (ByVal Value As color) Me.m_PlusMinusColor = Value End set End Property # End Region # Region "Class Panel" Add Column Style Public Sub AddTreeViewColumnStyles (Byval ColStyle As TreeViewColstyle) ColStyle.ParentControl = ME m_tvcolumnstyles.add (color) End Sub # end region
#Region "Private Method Zone" 'Heavy painting of the main function to achieve the allocation of Bounds for each node and the separated protected overrides sub-onpaint (byval e as system.windows.forms.painteventargs) if ISNothing (me.nodes ) The return if me.nodes.count <1 Then Return Dim Node As Treenode = me.nodes (0) IF not isnothing (node) THEN PAINTNODES (E.GRAPHICS, NODE) End if End Sub 'Heavy Picture of the slave function, The IF G ASExpanded (ByRef GREEXPADE) The current node if IF isnothing (node) The current node if isnothing (node) The current node if isnothing (node) The return DrawNode (g, node) if node.isexpanded The first child node PainTnodes (g, node.firstnode) Else 'paint number end if' draws a node node = node.nextnode if isnothing (node) THEN RETURN ELSE PAINTNODES (G, Node) Endix End Sub
'The location node, the acquired style bounds Private Function GetStyleBounds (ByRef g As Graphics, ByRef node As TreeNode, ByVal StylePosition As Integer) As Rectangle Dim str As String = node.Text Dim arrstr As String () = str.Split (Me .m_seperator) Str = string.join (Me.m_seperator, arrstr, 0, styleposition) Dim Presize as sizef if str = "" "" "" "" = new sizef (0) else presize = g.MeasureString (Str, Me.Font ) End If Dim nxtSize As SizeF = g.MeasureString (Me.m_Seperator & arrstr (StylePosition), Font) Dim bounds As Rectangle = node.Bounds Dim rect As Rectangle = New Rectangle (bounds.X preSize.Width, bounds.Y NXTSIZE.WIDTH, BOUNDS.HEIGHT) RETURN Rect End Function 'Draws a given node, performs their respective Paint Method in different columns' Paint Method' Drawing and Dicking Cards Private Sub DrawNode (byref g AS Graphics, Byref Node As Treenode) Dim Bounds as Rectangle = node.bounds' Draws Dim Strarr () AS String = Node.Text.Split (me.m_seperator) DIM i As Integer For i = 0 To Me.m_TVColumnStyles.Count - 1 If i 'Painting IF Me.Showlines Then Dim Points () As Point Dim NextNode As Treenode = Node.NextNode if Isnotting () {New Point (Bounds.x - m_INDENT / 2, Bounds.y ), _ New point (Bounds.x - m_indent / 2, bounds.y me.pwid), _ new point (bounds.x - pwid / 2, bounds.y me.pwid)} else points = new point ) {New point (bounds.x - m_indent / 2, bounds.y), _ new point (bounds.x - m_indent / 2, bounds.y bounds.height), _ new point (bounds.x - m_indent / 2 Bounds.y me.pwid, _ new point (bounds.x - pwid / 2, bounds.y me.pwid)} 'has the next brother node, painting DIM _POINTS () As point = new point () {new point (bounds.x - m_indent / 2, bounds.y), _ new P Oint (Bounds.x - m_indent / 2, nextnode.bounds.y)} Drawlines (g, _points) End if Drawlines (G, Points) endiff 'painted plus reduction IF me.ShowPlusminus kilnode.getnodecount (True) > 0 THEN DIM RECT AS Rectangle = New Rectangle (Bounds.x - (m_indent me.pwid) / 2, Bounds.y Me.PWID / 2, PWID, PWID) If Node.isexpanded the 'Draw Drawsymble (G, RECT, FALSE) Else' drawing Drawsymble (G, RECT, TRUE) end if end if end if end sub 'Pictures PRIVATE SUB DRAWLINES (Byref) g as graphics, byref points () as point) g.drawlines (New Pen (me.m_linecolor), Points) End Sub 'draws a minus private subduration (byref g AS Graphics, Byval Rect As Rectangle, BYVAL ISPLUS AS BOOLEAN G. DrawRectangle (New Pen (me.m_plusminusbordercolor), Rect) g.drawline (New Pen (me.m_plusminuscolor), Rect.x, Rect.y Cint (Rect.width / 2), Rect.x Rect. Width, Rect.y Cint (Rect.width / 2)) IF Isplus Then g.drawline (New Pen (Me.m_plusminusColor), Rect.x Cint (Rect.width / 2), Rect.y, Rect.x CINT (Rect.Width / 2), Rect.y Rect.Heart) end if End sub 'is implemented in mousedown is updated, and performs a complete Click event to record and control Protected Overrides Sub onmousedown (Byval e as system) .Windows.Forms.mouseev entArgs) MyBase.OnMouseDown (e) Me.Refresh () Dim g As Graphics = m_graphics Dim pointmouse As Point = (New Point (eX, eY)) Dim node As TreeNode = Me.GetNodeAt (pointmouse) If IsNothing (node) Then Return selnode = node DIM string = node.text.split (me.m_seperator) DIM I as integer for i = 0 to me.m_tvcolumnstyles.count - 1 IF i 'Background color Videos Protected Overrides Sub OnPaintBackground (ByVal pevent As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = pevent.Graphics If IsNothing (Me.BackgroundImage) Then g.FillRectangle (New SolidBrush (BackColor), pevent.ClipRectangle ) Else g.DrawImage (Me.BackgroundImage, pevent.ClipRectangle) End If End Sub '' is implemented in a mousedown update, and at the same time to achieve a complete determination of the Click event Protected Overrides Sub OnMouseUp (ByVal e As System.Windows.Forms. MouseEventArgs) MyBase.OnMouseUp (e) Me.Refresh () 'Dim g As Graphics = Me.CreateGraphics Dim pointmouse As Point = (New Point (eX, eY)) Dim node As TreeNode = Me.GetNodeAt (pointmouse) If IsNothing ( node) Then Return If SelNodeBound.Contains (pointmouse) Then RaiseEvent TreeViewClick (SelNode, currentStyle) End If End Sub '' realization of the mouse image change Protected Overrides Sub OnMouseMove (ByVal e As System.Windows.Forms.MouseEventArgs) Dim g As Graphics = m_graphics Dim pointmouse As Point = (New Point (eX, eY)) Dim node As TreeNode = Me.GetNodeAt (pointmouse) If IsNothing (node) Then Return Dim IsChangeCursor As Boolean = False Dim strArr () As String = node.Text. Split (Me.m_Seperator) Dim i As Integer Dim ChangedCursor As Cursor For i = 0 To Me.m_TVColumnStyles.Count - 1 If i CType (Me.m_TVColumnStyles (i), TreeViewColStyle) .GetCellBounds (bound) If rect.Contains (pointmouse) Then ChangedCursor = CType (Me.m_TVColumnStyles (i), TreeViewColStyle) .Cursor If ChangedCursor Is Cursors.Default Then Else IsChangeCursor = True EXIT for end if Endiffs in me.cursor = ChangedCursor else me.cursor = cursorse.default endiff = curs.default endiff = curs.onmouseMove (e) end sub # end regionnd class2. TreeViewColStyle Class source code: #Region "Custom TreeView Column Style base class, all column Style must inherit it" Public Mustinherit Class TreeViewColStyle # Region "must rewrite the method" '' "in the selection of the given information Free Public Mustoverride Overloads Sub Paint (Byval Bounds as Rectangle, _ Byval Source As String, _ Byval Font As Font, _ Byval isselected as boolean '' gets the Bounds that is cut by you according to the given Bounds for based on a determination whether the mouse is in this bounds Public MustOverride Function getCellBounds (ByVal bounds As Rectangle) As Rectangle # End Region 'where treeview Public WithEvents ParentControl As TreeView' '' Private m_Cursor mouse image display As Cursor = Cursors. DEFAULT PUBLIC Property CURSOR () AS CURSOR GET RETURN M_CURSOR END GET SET (BYVAL VALUE AS CURSOR) M_CURSOR = Value End End Propertyend Class # End Region 3. TreeViewButtonStyle Class source code for two-color Button: #Region "custom column style, to achieve color display button type" Public Class TreeViewButtonStyle: Inherits TreeViewColStyle # Region "class variable region" 'determines if the mouse is pressed, the mouse is pressed to display image Private IsMouseDown As Boolean = FalsePrivate xMagin As Integer = 2 Private yMagin As Integer = 2 foreground Private m_ForeColor 'Private m_BackColor buttons background color As color = Color.BurlyWood' button As color = Color.White 'button style Private m_Style As style = Style.RectStyle' size Private M_SIZE As Size = New Size (20, 10) Public Enum Style RectStyle = 0 EllipseStion = 1 CircleStyle = 2 End Enum # end region #Region "对 对 属区" '------------------- 对 属 属 --------------' bright color PUBLIC Property LightColor ) As Color Get Return m_ForeColor End Get Set (ByVal Value As Color) m_ForeColor = Value End Set End Property 'dark Public Property GrayColor () As Color Get Return Me.m_BackColor End Get Set (ByVal Value As Color) Me.m_BackColor = Value End set End Property Public Property ButtonStyle () As Style Get Return Me.m_Style End Get set (ByVal Value As Style) Me.m_Style = Value End set End Property 'size setting button Public Property size () As size Get Return Me. M_Size End Get Set (Byval Value As Size) Me.m_size = Value End End Property # End Region #Region "Class Out]" provides upper-layer calls, knowing the actual PAINT of Bounds under the upper floor Bounds Public Overrides Function getcellbounds (Byval Bounds as Rectangle) As Rectangle Dim Rect As Rectangle if Isnotting (M_SIZE) THEN Rect = Bounds Else if m_size.width> Bounds.width or m_size.height> Bounds.Height1 Rect = Bounds else Rect = New Rectangle (Bounds.x (Bounds.width - m_size.width) / 2, Bounds.y (Bounds. Height - m_size.Height) / 2, m_size.Width, m_size.Height) End If End If Return rect End Function 'is provided to the upper layer paint method called Public Overrides Sub paint (ByRef g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal Source As String, ByVal Font As Font, ByVal IsSelected As Boolean) Dim rect As Rectangle = getCellBounds (bounds) Dim brush As Drawing.Drawing2D.LinearGradientBrush Dim brush1 As Drawing.Drawing2D.LinearGradientBrush brush = New Drawing .Drawing2d.Lineargra dientBrush (New PointF (rect.X, rect.Y), New PointF (rect.X, rect.Y rect.Height), Me.m_ForeColor, Me.m_BackColor) 'brush = New Drawing.Drawing2D.LinearGradientBrush (New PointF (0, 0), new pointf (0, me.height), m_backcolor, me.m_forecolor If Me.IsMouseDown AndAlso rect.Contains (Me.ParentControl.PointToClient (Me.ParentControl.MousePosition)) Then brush1 = New Drawing.Drawing2D.LinearGradientBrush (New PointF (rect.X xMagin, rect.Y yMagin), New PointF (Rect.x Xmagin, Rect.y Rect.height), Color.Fromargb (0, 255, 255, 255), Color.Fromargb (150, 255, 255, 255)) Else Brush1 = new drawing.drawing2d. LineargradientBrush (New Pointf (Rect.x Xmagin, Rect.y Ymagin), New Pointf (Rect.x Xmagin, Rect.y Rect.Height / 2), Color.Fromargb (150, 255, 255, 255) , Color.FromArgb (0, 255, 255, 255)) End If brush.WrapMode = Drawing.Drawing2D.WrapMode.TileFlipX brush1.WrapMode = Drawing.Drawing2D.WrapMode.TileFlipX Dim rect1 As Rectangle = New Rectangle (rect.X XMagin, Rect.y Ymagin, Rect.Width - 2 * xmagin, Rect.Height / 2) Select Case Me.m_Style Case Style.RectStyle Me.drawRectStyle (G, Rect, Rect1, Brush, Brush1) Case Style.ellipsestyl e Me.DrawEllipseStyle (g, rect, rect1, brush, brush1) Case Style.CircleStyle Me.DrawEllipseStyle (g, rect, rect1, brush, brush1) Case Else Me.DrawRectStyle (g, rect, rect1, brush, brush1) End Select End Sub # End Region #Region "private methods the class area" 'Videos oval button Private Sub DrawEllipseStyle (ByRef g As Graphics, ByVal rect As Rectangle, ByVal rect1 As Rectangle, ByVal bbrush As Brush, ByVal fbrush As Brush) g.SmoothingMode = Drawing.Drawing2D. SmoothingMode.AntiAlias g.FillEllipse (bbrush, rect) g.FillEllipse (fbrush, rect) g.DrawEllipse (New Pen (m_BackColor), rect) End Sub 'Videos square button Private Sub DrawRectStyle (ByRef g As Graphics, ByVal rect As Rectangle , ByVal rect1 As Rectangle, ByVal bbrush As Brush, ByVal fbrush As Brush) g.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias g.FillRectangle (bbrush, rect) g.FillRectangle (fbrush, rect) g.DrawRectangle (New Pen ( m_BackColor), rect) End SubPrivate Sub XpStyleButton_MouseDown (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ParentControl.MouseDown isMouseDown = True End Sub Private sub xpstylebutton_mouseup (Byval e as system.windows.forms.mouseeventargs) Handles Parentcontrol.Mouseup ismousedown = false end sub # End Regionend Class4. TreeViewTextStyle Class source code, custom column style, implementation of general text type: #Region "custom column style, to realize the general text type display" Public Class TreeViewTextStyle: Inherits TreeViewColStyle # Region "class variable region" Private xMagin As Integer = 2 Private yMagin As Integer = 2 'Font color Private m_TextColor As Color = SystemColors. ControlDarkdark # end region #REGON "对 外" public property textcolor () As color get return me.m_textColor End get set (byval value as color) me.m_textcolor = value end vendy # end region #REGON "Class Out]" Provides the upper-layer call, to know the actual PAINT's Bounds Public Overrides Function getCellbounds (BYVAL Bounds as Rectangle) As Rectangle Return Bounds End Function 'under the upper layer provided by PAINT Method for the upper layer PAINT method overrides Sub Paint (ByRef g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal Source As String, ByVal Font As Font, ByVal IsSelected As Boolean) 'according to a text drawn bounds g.DrawString (Source, Font , New Solidbrush (Me.m_TextColor), Bounds.x Xmagin, Bounds.y Ymagin) End Sub # End Region Class # end region5. TreeViewLinkTextStyle Class source code, custom column style, implementation of general link text types: #REGON "Custom Column Style, Implementing General Link Text Types" Public Class TreeViewLinkTextStyle: Inherits TreeViewColstyle # Region "Class Variable Zone" determines whether the mouse is pressed to display the image Press' private ismousedown as boolean = false Private xmagin as integer = 2 private ymagin as integer = 2 'font color private m_textcolor as color = systemcolors.controldarkdark # end region #REGON "对 外" public property textcolor () As color get return me.m_textColor End get set (byval value as color) me.m_textcolor = value end vendy # end region #REGON "Class Out]" Provides the upper-layer call, to know the actual PAINT's Bounds Public Overrides Function getCellbounds (BYVAL Bounds as Rectangle) As Rectangle Return Bounds End Function 'under the upper layer provided by PAINT Method for the upper layer PAINT method overrides Sub Paint (ByRef g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal Source As String, ByVal Font As Font, ByVal IsSelected As Boolean) 'according to a text drawn bounds Dim f As New Font (Font , Fontstyle.underline) g.drawstring (Source, F, New Solidbrush (Me.m_TextColor), Bounds.x Xmagin, Bounds.y Ymagin) End Sub # End Region 'When Mouse Mousemove is shaped as a small hand public subneware ( Cursor = CURSORS.HAND End Subend Class # end region If you don't meet the above Button column, the link column is displayed, you can override TreeViewColStyle yourself, generate the columns you want. The event left an interface Public Event TreeViewClick (Byval ClickNode As Treenode, Byval Currentcol As Integer) The above-mentioned click event can be obtained through TreeViewClick. In fact, every column has this event. Judging that Currentcol is issued when it is used, thank you, thank you, hope to contact me, ganenping @ mainone .com.cn QQ: 44460100 The following is the test program source code: Public class form1 inherits system.windows.Forms.form #Region "Windows Form Designer Generated Code" Public Sub new () mybase.new () 'This call is required for the Windows Form Designer. InitializeComponent () 'Added after InitializeComponent () call to any initialization buttonstyle = New CustomTreeview.TreeViewButtonStyle TextStyle = New CustomTreeview.TreeViewTextStyle LinkTextStyle = New CustomTreeview.TreeViewLinkTextStyle LinkTextStyle.TextColor = Color.Blue' TreeView1.BackgroundImage = Image.FromFile (Application.StartupPath & "/ begin.gif ") TreeView1.AddTreeViewColumnStyles (TextStyle) TreeView1.AddTreeViewColumnStyles (buttonstyle) TreeView1.AddTreeViewColumnStyles (LinkTextStyle) End Sub 'form overrides dispose to clean up the component list. Protected overloads overrides sub dispose (byval disposing as boolean) ing disponation kiln (Components Is Nothing) Then components.dispose () end if endiffs) End Sub 'Windows Form Designer Supply Private Components as System.comPonentModel.icontainer 'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor. Friend WithEvents OwnTreeView1 As CustomTreeview.OwnTreeView Friend WithEvents TreeView1 As CustomTreeview.OwnTreeView Friend WithEvents Button1 As System.Windows.Forms.Button Private buttonstyle As CustomTreeview.TreeViewButtonStyle Private TextStyle As CustomTreeview.TreeViewTextStyle Private LinkTextStyle As CustomTreeview.TreeViewLinkTextStyle Friend WithEvents TreeView2 As System.Windows .Forms.TreeView Node 2, FGAS ", New System.Windows.Forms.treenode () {new system.windows.Forms.treenode (" Node 3, HHHH ", New System.Windows.Forms.treenode () {new system.windows.Forms .Treenode ("Node 4, DFGG")}}})})}, new system.windows.forms.treenode ("Node 9, FFFF")}, new system.windows.Forms.treenode (" Node 10, FFFF ")}})}), new system.windows.Forms.treenode (" Node 1, WDDD, www.sohu.com "), New System.Windows.Forms.treenode (" Node 2, HGDS ") New System.Windows.Forms.treenode ("Node 3, HGFS"), New System.Windows.Forms.treenode ("Node 4, Jhgf, www.sina.com", New System.Windows.Forms.treenode () {New system.windows.Forms.treenode ("Node 5, HGFD")}), New System.Windows.Forms.treenode ("Node 8, FFF, China Enterprise Network"), New System.Windows.Forms.treenode ( "Node 0"), New System.Windows.Forms.treenode ("Node 1"), New System.Windows.Forms.treenode ("Node 2"), New System.Windows.Forms.treenode ("Node 3") New system.windows.Forms.treenode ("Node 4"), New System.Windows.Forms.treenode ("Node 5"), New System.Windows.Forms.treenode ("Node 6")}) Me.TreeView1 .Plusminusbordercolor = system.drawing.color. DarkGreen Me.TreeView1.PlusMinusColor = System.Drawing.Color.DarkOrange Me.TreeView1.SelectedImageIndex = -1 Me.TreeView1.Seperator = "," Me.TreeView1.Size = New System.Drawing.Size (272, 208) Me. TreeView1.tabindex = 1 'button1' me.button1.location = new system.drawing.point (40, 232) me.button1.name = "button1" me.button1.size = new system.drawing.size (56, 24) me.button1.tabindex = 2 me.button1.text = "Button1" ' 'TreeView2' Me.TreeView2.ImageIndex = -1 Me.TreeView2.Location = New System.Drawing.Point (56, 56) Me.TreeView2.Name = "TreeView2" Me.TreeView2.Nodes.AddRange (New System.Windows. Forms.treenode () {new system.windows.Forms.treenode ("Node 0"), New System.Windows.Forms.treenode ("Node 1"), New System.Windows.Forms.treenode ("Node 2", New system.windows.Forms.treenode () {new system.windows.forms.treenode ("Node 10", new system.windows.forms.treenode () {new system.windows.forms.treenode ("Node 11") })}), New system.windows.Forms.treenode ("Node 3", new system.windows.forms.treenode () {new system.windows.forms.treenode ("Node 8", New System.Windows.Forms, NEW .Treenode () {new system.windows.forms.treenode ("Node 9")})}, new system.windows.forms.treenode ("Node 4"), New System.Windows.Forms.treenode ("Node 5 "), new system.windows.Forms.treenode (" Node 6 ", new system.windows.forms.treenode () {new system.windows.forms.treenode (" Node 12 ", New System.Windows.Forms. Treenode () {new system.windows.Forms.treenode ("Node 1 3 ")})}, new system.windows.Forms.treenode (" Node 7 ")}) Me.TreeView2.SelectedImageIndex = -1 me.treeview2.size = new system.drawing.size (96, 128) ME .Treeview2.tabindex = 3 '' form1 'me.autoscalebasesize = new system.drawing.size (6, 14) me.clientsize = new system.drawing.size (632, 273) Me.Controls.add (Me.TreeView2) Me.Controls.add (me.button1) me.controls.add (me.treeview1) me.name = "form1" me.text = "form1" me.resumeLayout (false) end sub #Endregionend class