⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainform.vb

📁 Mastering VBNet Include Source Code
💻 VB
字号:
Public Class MainForm
    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 bttnMath As System.Windows.Forms.Button
    Friend WithEvents bttnLoan As System.Windows.Forms.Button
    Friend WithEvents bttnGame As System.Windows.Forms.Button

    '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.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.bttnMath = New System.Windows.Forms.Button()
        Me.bttnGame = New System.Windows.Forms.Button()
        Me.bttnLoan = New System.Windows.Forms.Button()
        Me.SuspendLayout()
        '
        'bttnMath
        '
        Me.bttnMath.Font = New System.Drawing.Font("Lucida Sans", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.bttnMath.Location = New System.Drawing.Point(32, 16)
        Me.bttnMath.Name = "bttnMath"
        Me.bttnMath.Size = New System.Drawing.Size(216, 32)
        Me.bttnMath.TabIndex = 0
        Me.bttnMath.Text = "Simple Math"
        '
        'bttnGame
        '
        Me.bttnGame.Font = New System.Drawing.Font("Lucida Sans", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.bttnGame.Location = New System.Drawing.Point(32, 104)
        Me.bttnGame.Name = "bttnGame"
        Me.bttnGame.Size = New System.Drawing.Size(216, 32)
        Me.bttnGame.TabIndex = 2
        Me.bttnGame.Text = "Play a Game!"
        '
        'bttnLoan
        '
        Me.bttnLoan.Font = New System.Drawing.Font("Lucida Sans", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.bttnLoan.Location = New System.Drawing.Point(32, 56)
        Me.bttnLoan.Name = "bttnLoan"
        Me.bttnLoan.Size = New System.Drawing.Size(216, 32)
        Me.bttnLoan.TabIndex = 1
        Me.bttnLoan.Text = "Simple Loan"
        '
        'MainForm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 165)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.bttnGame, Me.bttnLoan, Me.bttnMath})
        Me.Name = "MainForm"
        Me.Text = "CalculatorsForm"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim calcForm As New CalculatorForm()
    Dim loanForm As New LoanForm()
    Private Sub bttnMath_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnMath.Click
        calcForm.Show()
        calcForm.Activate()
    End Sub

    Private Sub bttnLoan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnLoan.Click
        loanForm.Show()
    End Sub

    Private Sub bttnGame_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnGame.Click
        bttnGame.Left = Rnd() * Me.Width * 0.8
        bttnGame.Top = Rnd() * Me.Height * 0.8
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -