D
dennist
I have a simple form called frmTopicFromStart with a sub
main in modPrimary. Here is the code for both. In the
form I have a tabcontro with 2 tabs and a quit button.
But when I start the app a no longer existing form1
appears on the screen with no controls. I checked
carefully. The starting entity is submain. form1 no
longer exists. I changed the file and form names to
TopicFromStart and frmTopicFromStart. What's going on.
Module modPrimary
Friend gstrConn As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=H:\Program Files\Microsoft Office\Office10
\Samples\Northwind.mdb;"
Public Sub Main()
Application.Run(New frmTopicFromStart)
End Sub
End Module
Public Class frmTopicFromStart
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
Private 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 btnQuit As
System.Windows.Forms.Button
Friend WithEvents TabControl1 As
System.Windows.Forms.TabControl
Friend WithEvents TabPage1 As
System.Windows.Forms.TabPage
Friend WithEvents TabPage2 As
System.Windows.Forms.TabPage
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.btnQuit = New System.Windows.Forms.Button
Me.TabControl1 = New
System.Windows.Forms.TabControl
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.TabPage2 = New System.Windows.Forms.TabPage
Me.TabControl1.SuspendLayout()
Me.SuspendLayout()
'
'btnQuit
'
Me.btnQuit.Location = New System.Drawing.Point
(504, 456)
Me.btnQuit.Name = "btnQuit"
Me.btnQuit.Size = New System.Drawing.Size(80, 40)
Me.btnQuit.TabIndex = 1
Me.btnQuit.Text = "&Quit"
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Location = New System.Drawing.Point
(168, 48)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size
(432, 344)
Me.TabControl1.TabIndex = 2
'
'TabPage1
'
Me.TabPage1.Location = New System.Drawing.Point
(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(424,
318)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "General"
'
'TabPage2
'
Me.TabPage2.Location = New System.Drawing.Point
(4, 22)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Size = New System.Drawing.Size(424,
318)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "TabPage2"
'
'frmTopicFromStart
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(648, 518)
Me.Controls.Add(Me.TabControl1)
Me.Controls.Add(Me.btnQuit)
Me.Name = "frmTopicFromStart"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Topic From Start"
Me.TabControl1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
End Class
main in modPrimary. Here is the code for both. In the
form I have a tabcontro with 2 tabs and a quit button.
But when I start the app a no longer existing form1
appears on the screen with no controls. I checked
carefully. The starting entity is submain. form1 no
longer exists. I changed the file and form names to
TopicFromStart and frmTopicFromStart. What's going on.
Module modPrimary
Friend gstrConn As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=H:\Program Files\Microsoft Office\Office10
\Samples\Northwind.mdb;"
Public Sub Main()
Application.Run(New frmTopicFromStart)
End Sub
End Module
Public Class frmTopicFromStart
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
Private 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 btnQuit As
System.Windows.Forms.Button
Friend WithEvents TabControl1 As
System.Windows.Forms.TabControl
Friend WithEvents TabPage1 As
System.Windows.Forms.TabPage
Friend WithEvents TabPage2 As
System.Windows.Forms.TabPage
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.btnQuit = New System.Windows.Forms.Button
Me.TabControl1 = New
System.Windows.Forms.TabControl
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.TabPage2 = New System.Windows.Forms.TabPage
Me.TabControl1.SuspendLayout()
Me.SuspendLayout()
'
'btnQuit
'
Me.btnQuit.Location = New System.Drawing.Point
(504, 456)
Me.btnQuit.Name = "btnQuit"
Me.btnQuit.Size = New System.Drawing.Size(80, 40)
Me.btnQuit.TabIndex = 1
Me.btnQuit.Text = "&Quit"
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Location = New System.Drawing.Point
(168, 48)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size
(432, 344)
Me.TabControl1.TabIndex = 2
'
'TabPage1
'
Me.TabPage1.Location = New System.Drawing.Point
(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(424,
318)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "General"
'
'TabPage2
'
Me.TabPage2.Location = New System.Drawing.Point
(4, 22)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Size = New System.Drawing.Size(424,
318)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "TabPage2"
'
'frmTopicFromStart
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(648, 518)
Me.Controls.Add(Me.TabControl1)
Me.Controls.Add(Me.btnQuit)
Me.Name = "frmTopicFromStart"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Topic From Start"
Me.TabControl1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
End Class