J
Joshua Kendall
I have a script in which it keeps opening the same form
instead of only one instance. I also need help with a
form that has a password. Where do I put the actual
password? can I use a database for multiple users?
opens multiple instances of password form instead of one:
Public Class Splash
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 SplashIMG As
System.Windows.Forms.PictureBox
Friend WithEvents SplashTimer As
System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.components = New
System.ComponentModel.Container()
Dim resources As System.Resources.ResourceManager
= New System.Resources.ResourceManager(GetType(Splash))
Me.SplashIMG = New System.Windows.Forms.PictureBox
()
Me.SplashTimer = New System.Windows.Forms.Timer
(Me.components)
Me.SuspendLayout()
'
'SplashIMG
'
Me.SplashIMG.Image = CType(resources.GetObject
("SplashIMG.Image"), System.Drawing.Bitmap)
Me.SplashIMG.Name = "SplashIMG"
Me.SplashIMG.Size = New System.Drawing.Size(600,
300)
Me.SplashIMG.TabIndex = 0
Me.SplashIMG.TabStop = False
'
'SplashTimer
'
Me.SplashTimer.Enabled = True
Me.SplashTimer.Interval = 1000
'
'Splash
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(600, 300)
Me.Controls.AddRange(New
System.Windows.Forms.Control() {Me.SplashIMG})
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.None
Me.Name = "Splash"
Me.ShowInTaskbar = False
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "KS.IntraNet"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub SplashIMG_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SplashIMG.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SplashTimer.Tick
Dim frmLogin As New Login()
frmLogin.Show()
End Sub
End Class
Password Form:
Public Class Login
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 UserLbl As
System.Windows.Forms.Label
Friend WithEvents UserINP As
System.Windows.Forms.TextBox
Friend WithEvents PassINP As
System.Windows.Forms.TextBox
Friend WithEvents PassLbl As
System.Windows.Forms.Label
Friend WithEvents LoginBTN As
System.Windows.Forms.Button
Friend WithEvents CancelBTN As
System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.UserLbl = New System.Windows.Forms.Label()
Me.UserINP = New System.Windows.Forms.TextBox()
Me.PassINP = New System.Windows.Forms.TextBox()
Me.PassLbl = New System.Windows.Forms.Label()
Me.LoginBTN = New System.Windows.Forms.Button()
Me.CancelBTN = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'UserLbl
'
Me.UserLbl.Location = New System.Drawing.Point(0,
10)
Me.UserLbl.Name = "UserLbl"
Me.UserLbl.Size = New System.Drawing.Size(64, 16)
Me.UserLbl.TabIndex = 0
Me.UserLbl.Text = "Username:"
'
'UserINP
'
Me.UserINP.Location = New System.Drawing.Point
(56, 8)
Me.UserINP.Name = "UserINP"
Me.UserINP.Size = New System.Drawing.Size(120, 20)
Me.UserINP.TabIndex = 1
Me.UserINP.Text = ""
'
'PassINP
'
Me.PassINP.Location = New System.Drawing.Point
(56, 32)
Me.PassINP.Name = "PassINP"
Me.PassINP.PasswordChar =
Microsoft.VisualBasic.ChrW(42)
Me.PassINP.Size = New System.Drawing.Size(120, 20)
Me.PassINP.TabIndex = 2
Me.PassINP.Text = ""
Me.Validate.Equals(3224)
'
'PassLbl
'
Me.PassLbl.Location = New System.Drawing.Point(0,
34)
Me.PassLbl.Name = "PassLbl"
Me.PassLbl.Size = New System.Drawing.Size(64, 16)
Me.PassLbl.TabIndex = 3
Me.PassLbl.Text = "Password:"
'
'LoginBTN
'
Me.LoginBTN.Location = New System.Drawing.Point
(16, 56)
Me.LoginBTN.Name = "LoginBTN"
Me.LoginBTN.Size = New System.Drawing.Size(66, 24)
Me.LoginBTN.TabIndex = 4
Me.LoginBTN.Text = "Login"
'
'CancelBTN
'
Me.CancelBTN.Location = New System.Drawing.Point
(96, 56)
Me.CancelBTN.Name = "CancelBTN"
Me.CancelBTN.Size = New System.Drawing.Size(66,
24)
Me.CancelBTN.TabIndex = 5
Me.CancelBTN.Text = "Cancel"
'
'Login
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(186, 88)
Me.Controls.AddRange(New
System.Windows.Forms.Control() {Me.CancelBTN,
Me.LoginBTN, Me.UserINP, Me.PassINP, Me.PassLbl,
Me.UserLbl})
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "Login"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = " Network Login"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Login_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Login_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UserLbl.Click
End Sub
Private Sub CancelBTN_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CancelBTN.Click
End
End Sub
Private Sub PassINP_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
PassINP.TextChanged
End Sub
End Class
Thanks for the help in advance
Joshua Kendall
instead of only one instance. I also need help with a
form that has a password. Where do I put the actual
password? can I use a database for multiple users?
opens multiple instances of password form instead of one:
Public Class Splash
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 SplashIMG As
System.Windows.Forms.PictureBox
Friend WithEvents SplashTimer As
System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.components = New
System.ComponentModel.Container()
Dim resources As System.Resources.ResourceManager
= New System.Resources.ResourceManager(GetType(Splash))
Me.SplashIMG = New System.Windows.Forms.PictureBox
()
Me.SplashTimer = New System.Windows.Forms.Timer
(Me.components)
Me.SuspendLayout()
'
'SplashIMG
'
Me.SplashIMG.Image = CType(resources.GetObject
("SplashIMG.Image"), System.Drawing.Bitmap)
Me.SplashIMG.Name = "SplashIMG"
Me.SplashIMG.Size = New System.Drawing.Size(600,
300)
Me.SplashIMG.TabIndex = 0
Me.SplashIMG.TabStop = False
'
'SplashTimer
'
Me.SplashTimer.Enabled = True
Me.SplashTimer.Interval = 1000
'
'Splash
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(600, 300)
Me.Controls.AddRange(New
System.Windows.Forms.Control() {Me.SplashIMG})
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.None
Me.Name = "Splash"
Me.ShowInTaskbar = False
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "KS.IntraNet"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub SplashIMG_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SplashIMG.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SplashTimer.Tick
Dim frmLogin As New Login()
frmLogin.Show()
End Sub
End Class
Password Form:
Public Class Login
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 UserLbl As
System.Windows.Forms.Label
Friend WithEvents UserINP As
System.Windows.Forms.TextBox
Friend WithEvents PassINP As
System.Windows.Forms.TextBox
Friend WithEvents PassLbl As
System.Windows.Forms.Label
Friend WithEvents LoginBTN As
System.Windows.Forms.Button
Friend WithEvents CancelBTN As
System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.UserLbl = New System.Windows.Forms.Label()
Me.UserINP = New System.Windows.Forms.TextBox()
Me.PassINP = New System.Windows.Forms.TextBox()
Me.PassLbl = New System.Windows.Forms.Label()
Me.LoginBTN = New System.Windows.Forms.Button()
Me.CancelBTN = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'UserLbl
'
Me.UserLbl.Location = New System.Drawing.Point(0,
10)
Me.UserLbl.Name = "UserLbl"
Me.UserLbl.Size = New System.Drawing.Size(64, 16)
Me.UserLbl.TabIndex = 0
Me.UserLbl.Text = "Username:"
'
'UserINP
'
Me.UserINP.Location = New System.Drawing.Point
(56, 8)
Me.UserINP.Name = "UserINP"
Me.UserINP.Size = New System.Drawing.Size(120, 20)
Me.UserINP.TabIndex = 1
Me.UserINP.Text = ""
'
'PassINP
'
Me.PassINP.Location = New System.Drawing.Point
(56, 32)
Me.PassINP.Name = "PassINP"
Me.PassINP.PasswordChar =
Microsoft.VisualBasic.ChrW(42)
Me.PassINP.Size = New System.Drawing.Size(120, 20)
Me.PassINP.TabIndex = 2
Me.PassINP.Text = ""
Me.Validate.Equals(3224)
'
'PassLbl
'
Me.PassLbl.Location = New System.Drawing.Point(0,
34)
Me.PassLbl.Name = "PassLbl"
Me.PassLbl.Size = New System.Drawing.Size(64, 16)
Me.PassLbl.TabIndex = 3
Me.PassLbl.Text = "Password:"
'
'LoginBTN
'
Me.LoginBTN.Location = New System.Drawing.Point
(16, 56)
Me.LoginBTN.Name = "LoginBTN"
Me.LoginBTN.Size = New System.Drawing.Size(66, 24)
Me.LoginBTN.TabIndex = 4
Me.LoginBTN.Text = "Login"
'
'CancelBTN
'
Me.CancelBTN.Location = New System.Drawing.Point
(96, 56)
Me.CancelBTN.Name = "CancelBTN"
Me.CancelBTN.Size = New System.Drawing.Size(66,
24)
Me.CancelBTN.TabIndex = 5
Me.CancelBTN.Text = "Cancel"
'
'Login
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(186, 88)
Me.Controls.AddRange(New
System.Windows.Forms.Control() {Me.CancelBTN,
Me.LoginBTN, Me.UserINP, Me.PassINP, Me.PassLbl,
Me.UserLbl})
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "Login"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = " Network Login"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Login_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Login_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UserLbl.Click
End Sub
Private Sub CancelBTN_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CancelBTN.Click
End
End Sub
Private Sub PassINP_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
PassINP.TextChanged
End Sub
End Class
Thanks for the help in advance
Joshua Kendall