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

📄 startupform.vb

📁 是一个用SQL和VB.NET来做的源码。
💻 VB
字号:
Imports System.IO
Public Class StartUpForm
    Inherits System.Windows.Forms.Form

#Region " Windows Form 设计工具产生的程序代码 "

    Public Sub New()
        MyBase.New()

        '此调用为 Windows Form 设计工具的必要项。
        InitializeComponent()

        '在 InitializeComponent() 调用之后加入所有的初始设定

    End Sub

    'Form 覆盖 Dispose 以清除组件列表。
    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

    '为 Windows Form 设计工具的必要项
    Private components As System.ComponentModel.IContainer

    '注意: 以下为 Windows Form 设计工具所需的程序
    '您可以使用 Windows Form 设计工具进行修改。
    '请勿使用程序代码编辑器来修改这些程序。
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents btnOpen As System.Windows.Forms.Button
    Friend WithEvents FormsToRun As System.Windows.Forms.ComboBox
    Friend WithEvents btnClose As System.Windows.Forms.Button
    Friend WithEvents Label2 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(StartUpForm))
        Me.Label1 = New System.Windows.Forms.Label()
        Me.FormsToRun = New System.Windows.Forms.ComboBox()
        Me.btnOpen = New System.Windows.Forms.Button()
        Me.btnClose = New System.Windows.Forms.Button()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
        Me.Label1.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
        Me.Label1.Location = New System.Drawing.Point(40, 32)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(336, 23)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "请选择您所要执行的 Windows Form:"
        '
        'FormsToRun
        '
        Me.FormsToRun.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.FormsToRun.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
        Me.FormsToRun.Location = New System.Drawing.Point(376, 32)
        Me.FormsToRun.Name = "FormsToRun"
        Me.FormsToRun.Size = New System.Drawing.Size(264, 28)
        Me.FormsToRun.TabIndex = 1
        '
        'btnOpen
        '
        Me.btnOpen.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
        Me.btnOpen.Location = New System.Drawing.Point(232, 256)
        Me.btnOpen.Name = "btnOpen"
        Me.btnOpen.Size = New System.Drawing.Size(104, 32)
        Me.btnOpen.TabIndex = 2
        Me.btnOpen.Text = "打开"
        '
        'btnClose
        '
        Me.btnClose.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
        Me.btnClose.Location = New System.Drawing.Point(360, 256)
        Me.btnClose.Name = "btnClose"
        Me.btnClose.Size = New System.Drawing.Size(75, 32)
        Me.btnClose.TabIndex = 3
        Me.btnClose.Text = "关闭"
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("宋体", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
        Me.Label2.ForeColor = System.Drawing.Color.Red
        Me.Label2.Location = New System.Drawing.Point(64, 120)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(552, 88)
        Me.Label2.TabIndex = 4
        Me.Label2.Text = "数据绑定---章立民制作"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'StartUpForm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 18)
        Me.ClientSize = New System.Drawing.Size(680, 320)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label2, Me.btnClose, Me.btnOpen, Me.FormsToRun, Me.Label1})
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "StartUpForm"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "起始窗体"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub StartUpForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim WinAppDir As String = Environment.CurrentDirectory
        Dim WinFormDir As New DirectoryInfo(WinAppDir)
        Dim WinForms As FileInfo() = WinFormDir.GetFiles("BindingDemoForm*.vb")
        Dim WinFormFile As FileInfo
        For Each WinFormFile In WinForms
            FormsToRun.Items.Add(WinFormFile.Name)
        Next
    End Sub

    Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
        If FormsToRun.SelectedIndex >= 0 Then
            Dim choice As String = FormsToRun.SelectedItem.ToString()

            Select Case choice
                Case "BindingDemoForm1.vb"
                    Dim dlg As New BindingDemoForm1()
                    dlg.Show()
                Case "BindingDemoForm2.vb"
                    Dim dlg As New BindingDemoForm2()
                    dlg.Show()
                Case "BindingDemoForm3.vb"
                    Dim dlg As New BindingDemoForm3()
                    dlg.Show()
                Case "BindingDemoForm4.vb"
                    Dim dlg As New BindingDemoForm4()
                    dlg.Show()
                Case "BindingDemoForm5.vb"
                    Dim dlg As New BindingDemoForm5()
                    dlg.Show()
                Case "BindingDemoForm6.vb"
                    Dim dlg As New BindingDemoForm6()
                    dlg.Show()
                Case "BindingDemoForm7.vb"
                    Dim dlg As New BindingDemoForm7()
                    dlg.Show()
                Case "BindingDemoForm8.vb"
                    Dim dlg As New BindingDemoForm8()
                    dlg.Show()
                Case "BindingDemoForm9.vb"
                    Dim dlg As New BindingDemoForm9()
                    dlg.Show()
                Case "BindingDemoForm10.vb"
                    Dim dlg As New BindingDemoForm10()
                    dlg.Show()
                Case "BindingDemoForm11.vb"
                    Dim dlg As New BindingDemoForm11()
                    dlg.Show()
                Case "BindingDemoForm12.vb"
                    Dim dlg As New BindingDemoForm12()
                    dlg.Show()
                Case "BindingDemoForm13.vb"
                    Dim dlg As New BindingDemoForm13()
                    dlg.Show()
                Case "BindingDemoForm14.vb"
                    Dim dlg As New BindingDemoForm14()
                    dlg.Show()
                Case "BindingDemoForm15.vb"
                    Dim dlg As New BindingDemoForm15()
                    dlg.Show()
            End Select
        End If
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

End Class

⌨️ 快捷键说明

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