这个程序
源代码在线查看: 数据文件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
|
相关资源 |
|
-
数组排序算法,这个程序的头文件中包含四种排序方法:泡沫排序法(bubble)
-
介绍一下这个程序的功能: 1
-
这个程序是一个Win32程序
-
这个程序是一个个人考勤软件,它从系统时钟获取时间信息,只要上下班时按时在当日考勤栏内点击相应的栏目标题即可逐日记录下个人每天的工作时间,按月统计汇总,按年形成文件.可以随意查看过去的记录,也可把记录按
-
这个程序对于输入的一系列浮点数
-
这个程序不错
-
这个程序不错哟 这个是本人写的 哈哈 见笑了
-
最近在新浪"读书频道"下载了一个小说,有40多个页面,后缀全是shtml的,发现改成html就可以在本地看了,但改起来太麻烦,就写了这个程序,专门用来批量修改某目录下的文件后缀.
|