I have a form that is currently being displayed in a split container with panel 1 holding a treeview and panel2 holding the form. my code for this is here. This is when selecting a item from the treeview.
When I view this in action however it cuts off about a quarter inch from the right of any form I use. Can anyone shed some light onto this for me?
Code:
Dim CurrentForm As New Form
Select Case TreeView1.SelectedNode.Text
Case Is = "Customer"
CurrentForm = Customer
Case Is = "Quote"
CurrentForm = Quote
End Select
CurrentForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
CurrentForm.ShowInTaskbar = False
CurrentForm.IsMdiContainer = False
CurrentForm.TopLevel = False
CurrentForm.Visible = True
CurrentForm.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
SplitContainer1.Panel2.Controls.Clear()
SplitContainer1.Panel2.Controls.Add(CurrentForm)
Comment