📄 frminputbox.frm
字号:
VERSION 5.00
Begin VB.Form frmInputBox
Caption = "数据输入"
ClientHeight = 1665
ClientLeft = 60
ClientTop = 345
ClientWidth = 5280
Icon = "frmInputBox.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1665
ScaleWidth = 5280
StartUpPosition = 1 '所有者中心
Begin VB.TextBox txtInput
Height = 315
Left = 90
TabIndex = 0
Top = 1260
Width = 5085
End
Begin VB.CommandButton cmdArray
Caption = "放弃"
Height = 315
Index = 1
Left = 4200
TabIndex = 2
Top = 465
Width = 945
End
Begin VB.CommandButton cmdArray
Caption = "确定"
Default = -1 'True
Height = 315
Index = 0
Left = 4200
TabIndex = 1
Top = 105
Width = 945
End
Begin VB.Label lblPrompt
Caption = "数据输入:"
Height = 210
Left = 135
TabIndex = 3
Top = 105
Width = 1485
End
End
Attribute VB_Name = "frmInputBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public strTitle As String '标题参数
Public strPrompt As String '说明主题参数
Public strInputDefa As String '缺省值
Public strInputText As String '输入数据 用于返回
Public intMaxLen As Integer '允许输入的最大字符串长度
Private Sub cmdArray_Click(Index As Integer)
Select Case Index
Case 0 '确定
strInputText = Trim(Me.txtInput)
Case 1 '放弃
strInputText = ""
Case Else
MsgBox "按扭功能未定义", vbOKOnly + vbExclamation, "警告"
End Select
Unload Me
End Sub
Private Sub Form_Load()
Me.Caption = IIf(Trim(strTitle) = "", "数据输入", Trim(strTitle))
Me.lblPrompt.Caption = IIf(Trim(strPrompt) = "", "数据输入", Trim(strPrompt))
Me.txtInput.Text = Trim(strInputDefa)
Me.txtInput.MaxLength = intMaxLen
strInputText = Trim(strInputDefa)
End Sub
Private Sub txtInput_GotFocus()
Me.txtInput.SelStart = 0
Me.txtInput.SelLength = Len(Me.txtInput)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -