📄 数据文件f1(窗体文件frmroco).frm
字号:
VERSION 5.00
Begin VB.Form frmRoCo
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "参数窗体"
ClientHeight = 2460
ClientLeft = 60
ClientTop = 450
ClientWidth = 4140
LinkTopic = "Form1"
ScaleHeight = 2460
ScaleWidth = 4140
StartUpPosition = 3 '窗口缺省
Begin VB.OptionButton OptGrid
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "使用网格"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 2280
TabIndex = 7
Top = 1440
Width = 1215
End
Begin VB.OptionButton OptText
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "使用文本框"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 480
TabIndex = 6
Top = 1440
Value = -1 'True
Width = 1455
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "退 出"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 5
ToolTipText = "结束程序运行"
Top = 1920
Width = 1215
End
Begin VB.CommandButton cmdOK
Caption = "确 定"
Default = -1 'True
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 4
ToolTipText = "按列数和行数,或转到文本框录入,或转到网格录入"
Top = 1920
Width = 1215
End
Begin VB.TextBox txtRow
Alignment = 2 'Center
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 0
Top = 600
Width = 855
End
Begin VB.TextBox txtCol
Alignment = 2 'Center
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 3
Top = 600
Width = 975
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "行数 * 列数 = 样本数或分组数"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 480
TabIndex = 8
Top = 1080
Width = 3135
End
Begin VB.Label lblRow
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "行数"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 480
TabIndex = 2
Top = 120
Width = 1095
End
Begin VB.Label lblCol
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "列数"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 495
Left = 2400
TabIndex = 1
Top = 120
Width = 1335
End
End
Attribute VB_Name = "frmRoCo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'参数窗体
'提供数据文件的行数和列数
'行数*列数=样本数或分组数
Option Explicit
Private Sub Form_Load()
If intEdit = 1 Then '编辑
intFileNumber = FreeFile '取得文件号码
Open strFileName For Input As intFileNumber '打开文件
Input #intFileNumber, intRow, intCol '读行数、列数
txtRow = intRow '在文本框中显示行数
txtCol = intCol '在文本框中显示列数
txtRow.TabStop = False '不接受Tab键
txtCol.TabStop = False '不接受Tab键
End If
End Sub
'确定
Private Sub cmdOK_Click()
intRow = Val(txtRow) '行数
intCol = Val(txtCol) '列数
If (intRow > 38 Or intCol > 9) And (OptGrid.Value <> True) Then
MsgBox "由于数据量超出范围,程序将自动使用网格!", , _
"拒绝文本框"
OptGrid.Value = True
End If
If OptGrid.Value Then '决定使用文本框还是网格
frmGrid.Visible = True '显示网格窗体
Else
frmText.Visible = True '显示文本框窗体
End If
Unload Me '卸载当前窗体
End Sub
'结束
Private Sub cmdExit_Click()
Unload Me
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -