here is a copy of the form I inherit from.. it's only this windows generated code b/c that's all there is to it.
Imports Microsoft.Win32
Imports System.Runtime.InteropServices 'allows dll import
Imports System.Threading
Public Class Basic_Form
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Protected components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ButtonClose As System.Windows.Forms.Button
Friend WithEvents ButtonResize As System.Windows.Forms.Button
Friend WithEvents ButtonMinimize As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.ButtonClose = New System.Windows.Forms.Button
Me.ButtonResize = New System.Windows.Forms.Button
Me.ButtonMinimize = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'ButtonClose
'
Me.ButtonClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonClose.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ButtonClose.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ButtonClose.Location = New System.Drawing.Point(532, 8)
Me.ButtonClose.Name = "ButtonClose"
Me.ButtonClose.Size = New System.Drawing.Size(32, 17)
Me.ButtonClose.TabIndex = 36
Me.ButtonClose.Text = "C"
'
'ButtonResize
'
Me.ButtonResize.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonResize.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ButtonResize.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ButtonResize.Location = New System.Drawing.Point(500, 8)
Me.ButtonResize.Name = "ButtonResize"
Me.ButtonResize.Size = New System.Drawing.Size(32, 17)
Me.ButtonResize.TabIndex = 35
Me.ButtonResize.Text = "R"
'
'ButtonMinimize
'
Me.ButtonMinimize.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonMinimize.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ButtonMinimize.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ButtonMinimize.Location = New System.Drawing.Point(468, 8)
Me.ButtonMinimize.Name = "ButtonMinimize"
Me.ButtonMinimize.Size = New System.Drawing.Size(32, 17)
Me.ButtonMinimize.TabIndex = 34
Me.ButtonMinimize.Text = "M"
'
'Basic_Form
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(580, 300)
Me.ControlBox = False
Me.Controls.Add(Me.ButtonClose)
Me.Controls.Add(Me.ButtonResize)
Me.Controls.Add(Me.ButtonMinimize)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Basic_Form"
Me.Text = "Basic Form"
Me.ResumeLayout(False)
End Sub
#End Region
Here is a code sample from the new form in which I inherit from the previous one. This code is simple
Public Class Form_Main
Inherits Basic_Form
End Class
This code works and the form behaves just as it should on the IDE and when called. But, when I add a control to it say a button, then the buttons I placed on the previous form lose the anchoring properties. In order to make it work I had to position the MyBase.buttons each time during resizing. WHy did the anchor properties not transfer? And also, I tried reassigning the anchor properties to the base buttons but that didn't work either.