' Project Secret Public Class frmSecret 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 Friend WithEvents lstMsg As System.Windows.Forms.ListBox 'Required by the Windows Form Designer Private components As System.ComponentModel.Container '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 btnShowSecret As System.Windows.Forms.Button Friend WithEvents btnClose As System.Windows.Forms.Button Private Sub InitializeComponent() Me.lstMsg = New System.Windows.Forms.ListBox Me.btnShowSecret = New System.Windows.Forms.Button Me.btnClose = New System.Windows.Forms.Button Me.SuspendLayout() ' 'lstMsg ' Me.lstMsg.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lstMsg.ItemHeight = 20 Me.lstMsg.Location = New System.Drawing.Point(24, 56) Me.lstMsg.Name = "lstMsg" Me.lstMsg.Size = New System.Drawing.Size(232, 64) Me.lstMsg.TabIndex = 0 ' 'btnShowSecret ' Me.btnShowSecret.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnShowSecret.Location = New System.Drawing.Point(24, 8) Me.btnShowSecret.Name = "btnShowSecret" Me.btnShowSecret.Size = New System.Drawing.Size(232, 32) Me.btnShowSecret.TabIndex = 1 Me.btnShowSecret.Text = "Show Secret Message" ' 'btnClose ' Me.btnClose.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnClose.Location = New System.Drawing.Point(88, 144) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(104, 32) Me.btnClose.TabIndex = 2 Me.btnClose.Text = "Close" ' 'frmSecret ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(288, 190) Me.Controls.Add(Me.btnClose) Me.Controls.Add(Me.btnShowSecret) Me.Controls.Add(Me.lstMsg) Me.Name = "frmSecret" Me.Text = "frmSecret" Me.ResumeLayout(False) End Sub #End Region Private Sub btnShowSecret_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnShowSecret.Click If frmMain.PasswordAccepted Then lstMsg.Items.Clear() lstMsg.Items.Add("Smile and keep") lstMsg.Items.Add("your chin up.") Else lstMsg.Items.Clear() lstMsg.Items.Add("Invalid") lstMsg.Items.Add("password.") End If End Sub Private Sub btnClose_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnClose.Click Me.Hide() End Sub Private Sub frmSecret_Closing(ByVal sender As Object, _ ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing e.Cancel = True Me.Hide() End Sub End Class