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

📄 frmset.frm

📁 这是书上的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSet 
   Caption         =   "Unix主机信息设置"
   ClientHeight    =   2295
   ClientLeft      =   4965
   ClientTop       =   2535
   ClientWidth     =   2880
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   ScaleHeight     =   2295
   ScaleWidth      =   2880
   Begin VB.Frame Frame1 
      Height          =   2175
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   2655
      Begin VB.CommandButton cmdCancel 
         Caption         =   "取消"
         Height          =   375
         Left            =   1560
         TabIndex        =   8
         Top             =   1680
         Width           =   855
      End
      Begin VB.CommandButton cmdYes 
         Caption         =   "确定"
         Height          =   375
         Left            =   600
         TabIndex        =   7
         Top             =   1680
         Width           =   855
      End
      Begin VB.TextBox txtPassword 
         Alignment       =   2  'Center
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   960
         PasswordChar    =   "*"
         TabIndex        =   6
         Text            =   "Text3"
         Top             =   1080
         Width           =   1455
      End
      Begin VB.TextBox txtUserName 
         Alignment       =   2  'Center
         Height          =   270
         Left            =   960
         TabIndex        =   5
         Text            =   "Text2"
         Top             =   720
         Width           =   1455
      End
      Begin VB.TextBox txtIP 
         Alignment       =   2  'Center
         Height          =   270
         Left            =   960
         TabIndex        =   4
         Text            =   "21.30.2.8"
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label Label3 
         Caption         =   "登录密码"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "登录用户"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "IP地址"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   615
      End
   End
End
Attribute VB_Name = "frmSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'======|  取消信息设置 |======
Private Sub cmdCancel_Click()
Unload Me
End Sub

'======| 设置信息 |======
Private Sub cmdYes_Click()
strIP = txtIP.Text
strUserName = txtUserName.Text
strPassword = txtPassword.Text
Call SetUnixInfo
Unload Me
End Sub
'========| 载入窗体 |========
Private Sub Form_Load()
If Not GetUnixInfo Then
    Call InitUnixInfo
    txtIP.Text = ""
    txtUserName.Text = ""
    txtPassword.Text = ""
Else
    txtIP.Text = strIP
    txtUserName.Text = strUserName
    txtPassword.Text = strPassword
End If
End Sub


Private Sub txtIP_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Trim(txtIP.Text) = "" Then
        MsgBox "IP地址不允许为空!", 16
        txtIP.SetFocus
    Else
        txtUserName.SetFocus
    End If
ElseIf (KeyAscii < 48 Or KeyAscii > 57) _
       And KeyAscii <> Asc(".") _
       And KeyAscii <> 8 Then
            MsgBox "非法的字符:" + Chr(KeyAscii)
            KeyAscii = 0
End If
End Sub
Private Sub txtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Trim(txtUserName.Text) = "" Then
        MsgBox "登录用户名不允许为空!", 16
        txtUserName.SetFocus
    Else
        txtPassword.SetFocus
    End If
End If
End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdYes.SetFocus
End Sub

⌨️ 快捷键说明

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