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

📄 formsqlreg.vb

📁 不知道怎么用
💻 VB
字号:
Public Class FormSQLreg
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 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 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents AxNiceButton2 As AxNiceFormControl.AxNiceButton
    Friend WithEvents AxNiceButton1 As AxNiceFormControl.AxNiceButton
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormSQLreg))
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.TextBox2 = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.TextBox3 = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.AxNiceButton2 = New AxNiceFormControl.AxNiceButton
        Me.AxNiceButton1 = New AxNiceFormControl.AxNiceButton
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        CType(Me.AxNiceButton2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxNiceButton1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'TextBox1
        '
        Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox1.Location = New System.Drawing.Point(96, 24)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(144, 21)
        Me.TextBox1.TabIndex = 0
        Me.TextBox1.Text = "house"
        '
        'TextBox2
        '
        Me.TextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox2.Location = New System.Drawing.Point(96, 48)
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.Size = New System.Drawing.Size(144, 21)
        Me.TextBox2.TabIndex = 1
        Me.TextBox2.Text = "sa"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.Location = New System.Drawing.Point(40, 48)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(54, 17)
        Me.Label1.TabIndex = 2
        Me.Label1.Text = "登陆名:"
        '
        'TextBox3
        '
        Me.TextBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox3.Location = New System.Drawing.Point(96, 72)
        Me.TextBox3.Name = "TextBox3"
        Me.TextBox3.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.TextBox3.Size = New System.Drawing.Size(144, 21)
        Me.TextBox3.TabIndex = 3
        Me.TextBox3.Text = ""
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.Color.Transparent
        Me.Label2.Location = New System.Drawing.Point(48, 72)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(42, 17)
        Me.Label2.TabIndex = 4
        Me.Label2.Text = "密码:"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.BackColor = System.Drawing.Color.Transparent
        Me.Label3.Location = New System.Drawing.Point(40, 24)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(54, 17)
        Me.Label3.TabIndex = 5
        Me.Label3.Text = "数据库:"
        '
        'AxNiceButton2
        '
        Me.AxNiceButton2.Location = New System.Drawing.Point(248, 128)
        Me.AxNiceButton2.Name = "AxNiceButton2"
        Me.AxNiceButton2.OcxState = CType(resources.GetObject("AxNiceButton2.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxNiceButton2.Size = New System.Drawing.Size(67, 22)
        Me.AxNiceButton2.TabIndex = 4
        '
        'AxNiceButton1
        '
        Me.AxNiceButton1.Location = New System.Drawing.Point(168, 128)
        Me.AxNiceButton1.Name = "AxNiceButton1"
        Me.AxNiceButton1.OcxState = CType(resources.GetObject("AxNiceButton1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxNiceButton1.Size = New System.Drawing.Size(67, 22)
        Me.AxNiceButton1.TabIndex = 3
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.Color.Transparent
        Me.Label4.Image = CType(resources.GetObject("Label4.Image"), System.Drawing.Image)
        Me.Label4.Location = New System.Drawing.Point(-24, 104)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(400, 16)
        Me.Label4.TabIndex = 93
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.Color.Transparent
        Me.Label5.Image = CType(resources.GetObject("Label5.Image"), System.Drawing.Image)
        Me.Label5.Location = New System.Drawing.Point(16, 120)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(32, 32)
        Me.Label5.TabIndex = 94
        '
        'FormSQLreg
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.ClientSize = New System.Drawing.Size(328, 159)
        Me.ControlBox = False
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.AxNiceButton2)
        Me.Controls.Add(Me.AxNiceButton1)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.TextBox3)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.TextBox2)
        Me.Controls.Add(Me.TextBox1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Name = "FormSQLreg"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "配置数据连接"
        CType(Me.AxNiceButton2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxNiceButton1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region
    Private Shared m_Form As New FormSQLreg
    Public Shared ReadOnly Property NewForm() As FormSQLreg
        Get
            If m_Form Is Nothing OrElse m_Form.IsDisposed Then
                m_Form = New FormSQLreg
            End If
            Return m_Form
        End Get
    End Property


    Private Sub FormSQLreg_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxNiceButton1.Style = NiceFormControl.MnuStyle.红色管道
        AxNiceButton2.Style = NiceFormControl.MnuStyle.红色管道

        TextBox1.Text = GetSetting("lin077", "宿舍管理系统", "SQLdb", "house") '取注册表
        TextBox2.Text = GetSetting("lin077", "宿舍管理系统", "SQLuid", "sa")        '取注册表
        TextBox3.Text = GetSetting("lin077", "宿舍管理系统", "SQLpwd", "")       '取注册表

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If TextBox1.Text = "" Then TextBox1.Text = "rsglxt"
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        If TextBox2.Text = "" Then TextBox2.Text = "sa"
    End Sub

    Private Sub AxNiceButton1_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxNiceButton1.ClickEvent
        SaveSetting("lin077", "宿舍管理系统", "SQLdb", TextBox1.Text) '保存到注册表
        SaveSetting("lin077", "宿舍管理系统", "SQLuid", TextBox2.Text) '保存到注册表
        SaveSetting("lin077", "宿舍管理系统", "SQLpwd", TextBox3.Text) '保存到注册表
        Me.Close()
    End Sub
    Private Sub AxNiceButton2_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxNiceButton2.ClickEvent
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

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