Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Inherits System.Windows.Forms.Form
- Dim hey As New form2
- #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 Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
- Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
- Friend WithEvents Button1 As System.Windows.Forms.Button
- Friend WithEvents Button2 As System.Windows.Forms.Button
- Friend WithEvents Button3 As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
- Me.Label1 = New System.Windows.Forms.Label
- Me.Label2 = New System.Windows.Forms.Label
- Me.TextBox1 = New System.Windows.Forms.TextBox
- Me.TextBox2 = New System.Windows.Forms.TextBox
- Me.Button1 = New System.Windows.Forms.Button
- Me.Button2 = New System.Windows.Forms.Button
- Me.Button3 = New System.Windows.Forms.Button
- Me.SuspendLayout()
- '
- 'Label1
- '
- Me.Label1.BackColor = System.Drawing.Color.Transparent
- Me.Label1.ForeColor = System.Drawing.Color.DarkGray
- Me.Label1.Location = New System.Drawing.Point(40, 48)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(72, 24)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "USERNAME:"
- '
- 'Label2
- '
- Me.Label2.BackColor = System.Drawing.Color.Transparent
- Me.Label2.ForeColor = System.Drawing.Color.DarkGray
- Me.Label2.Location = New System.Drawing.Point(40, 72)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(80, 24)
- Me.Label2.TabIndex = 1
- Me.Label2.Text = "PASSWORD:"
- '
- 'TextBox1
- '
- Me.TextBox1.Location = New System.Drawing.Point(128, 40)
- Me.TextBox1.Name = "TextBox1"
- Me.TextBox1.Size = New System.Drawing.Size(120, 20)
- Me.TextBox1.TabIndex = 2
- Me.TextBox1.Text = ""
- '
- 'TextBox2
- '
- Me.TextBox2.Location = New System.Drawing.Point(128, 72)
- Me.TextBox2.Name = "TextBox2"
- Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(164)
- Me.TextBox2.Size = New System.Drawing.Size(120, 20)
- Me.TextBox2.TabIndex = 3
- Me.TextBox2.Text = ""
- '
- 'Button1
- '
- Me.Button1.ForeColor = System.Drawing.Color.Black
- Me.Button1.Location = New System.Drawing.Point(24, 120)
- Me.Button1.Name = "Button1"
- Me.Button1.Size = New System.Drawing.Size(80, 24)
- Me.Button1.TabIndex = 4
- Me.Button1.Text = "OK"
- '
- 'Button2
- '
- Me.Button2.ForeColor = System.Drawing.Color.Black
- Me.Button2.Location = New System.Drawing.Point(112, 120)
- Me.Button2.Name = "Button2"
- Me.Button2.Size = New System.Drawing.Size(80, 24)
- Me.Button2.TabIndex = 5
- Me.Button2.Text = "Cancel"
- '
- 'Button3
- '
- Me.Button3.ForeColor = System.Drawing.Color.Black
- Me.Button3.Location = New System.Drawing.Point(200, 120)
- Me.Button3.Name = "Button3"
- Me.Button3.Size = New System.Drawing.Size(72, 24)
- Me.Button3.TabIndex = 6
- Me.Button3.Text = "Reset"
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
- Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
- Me.ClientSize = New System.Drawing.Size(296, 166)
- Me.Controls.Add(Me.Button3)
- Me.Controls.Add(Me.Button2)
- Me.Controls.Add(Me.Button1)
- Me.Controls.Add(Me.TextBox2)
- Me.Controls.Add(Me.TextBox1)
- Me.Controls.Add(Me.Label2)
- Me.Controls.Add(Me.Label1)
- Me.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(0, Byte), CType(5, Byte))
- Me.Name = "Form1"
- Me.Text = "Login Form"
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- TextBox1.Clear()
- TextBox2.Clear()
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- End
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim identifier As Integer = 0
- If Not TextBox1.Text = "John Bernie" Then
- identifier = 1
- MsgBox("Wrong Username", MsgBoxStyle.Exclamation, "Login")
- TextBox1.Clear()
- End If
- If Not TextBox2.Text = "07500163" Then
- identifier = 1
- MsgBox("Wrong Password", MsgBoxStyle.Exclamation, "Login")
- TextBox2.Clear()
- End If
- If identifier = 0 Then
- hey.TextBox1.Text = "John Bernie"
- hey.TextBox2.Text = "07500163"
- hey.Show()
- Me.Hide()
- TextBox1.Clear()
- TextBox2.Clear()
- End If
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- TextBox1.Clear()
- TextBox2.Clear()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement