这个程序
源代码在线查看: 数据文件f3(窗体模块frmfile).frm
VERSION 5.00
Begin VB.Form frmFile
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "提供路径和文件名"
ClientHeight = 6120
ClientLeft = 60
ClientTop = 345
ClientWidth = 6960
LinkTopic = "Form1"
ScaleHeight = 6120
ScaleWidth = 6960
StartUpPosition = 3 '窗口缺省
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 = 3840
TabIndex = 13
ToolTipText = "停止作业,结束程序运行"
Top = 5640
Width = 1575
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 = 1560
TabIndex = 12
ToolTipText = "给出文件名后单击"
Top = 5640
Width = 1575
End
Begin VB.TextBox txtFile
Alignment = 2 'Center
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 11
Top = 5160
Width = 6495
End
Begin VB.TextBox txtNew
Alignment = 2 'Center
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 9
Top = 4200
Width = 2535
End
Begin VB.OptionButton OptNew
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 = 360
TabIndex = 7
Top = 4560
Width = 1335
End
Begin VB.OptionButton OptEdit
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 = 360
TabIndex = 6
Top = 3840
Value = -1 'True
Width = 1335
End
Begin VB.FileListBox File1
Appearance = 0 'Flat
Height = 2010
Left = 360
TabIndex = 2
Top = 1680
Width = 2535
End
Begin VB.DirListBox Dir1
Appearance = 0 'Flat
Height = 3030
Left = 3240
TabIndex = 1
Top = 600
Width = 3495
End
Begin VB.DriveListBox Drive1
Appearance = 0 'Flat
Height = 300
Left = 120
TabIndex = 0
Top = 600
Width = 3015
End
Begin VB.Label Label5
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "数据文件全名"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 495
Left = 1800
TabIndex = 10
Top = 4680
Width = 3375
End
Begin VB.Label Label4
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "新文件名(不带扩展名)"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 3120
TabIndex = 8
Top = 3840
Width = 3735
End
Begin VB.Label Label3
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 = 360
TabIndex = 5
Top = 1200
Width = 2535
End
Begin VB.Label Label2
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 = 3360
TabIndex = 4
Top = 120
Width = 3135
End
Begin VB.Label Label1
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 = 120
TabIndex = 3
Top = 120
Width = 2895
End
End
Attribute VB_Name = "frmFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'文件窗体
'利用文件控件提供路径和文件名
'设定为启动模块
Option Explicit
Private Sub Form_Load()
Label4.Visible = False '暂不显示新建文件指示标签
txtNew.Visible = False '暂不显示容纳新建文件名的文本框
File1.Pattern = "*.dat" '文件列表框只显示数据文件
'缺省设置的文件全名,与应用程序在同一个子目录内
txtFile.Text = App.Path & "\" & "New_Data.dat"
intEdit = 1 '缺省设为编辑
End Sub
'选择目录
Private Sub Dir1_Change()
File1.Path = Dir1.Path
txtFile.Text = Dir1.Path & "\" & txtNew.Text & ".dat"
End Sub
'选择驱动器
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
txtFile.Text = Dir1.Path & "\" & txtNew.Text & ".dat"
End Sub
'确定文件
Private Sub File1_Click()
txtFile.Text = Dir1.Path & "\" & File1.FileName
End Sub
'编辑
Private Sub OptEdit_Click()
Label3.Visible = True '显示打开文件指示标签
File1.Visible = True '显示文件控件
Label4.Visible = False '不显示新建文件指示标签
txtNew.Visible = False '不显示容纳新建文件名的文本框
intEdit = 1 '编辑
End Sub
'新建
Private Sub OptNew_Click()
Label3.Visible = False '不显示打开文件指示标签
File1.Visible = False '不显示文件控件
Label4.Visible = True '显示新建文件指示标签
txtNew.Visible = True '显示容纳新建文件名的文本框
txtNew.SetFocus '取得焦点
intEdit = 0 '新建
End Sub
'新建文件全名
Private Sub txtNew_Change()
txtFile.Text = Dir1.Path & "\" & txtNew.Text & ".dat"
End Sub
'确定,给出文件名后单击
Private Sub cmdOK_Click()
strFileName = txtFile.Text '文件名
If intEdit = 1 And InStr(strFileName, "\.") 0 Then
MsgBox "没有可以进行编辑的文件,考虑新建!"
Exit Sub
End If
If intEdit = 0 And InStr(strFileName, "\.") 0 Then
MsgBox "文件名不对,重新给定!"
txtNew.SetFocus '取得焦点
Exit Sub
End If
Unload Me
'显示行数和列数窗体
frmRoCo.Visible = True
End Sub
'退出,结束程序运行
Private Sub cmdExit_Click()
Unload Me '卸载当前窗体
End
End Sub
|
相关资源 |
|
-
数组排序算法,这个程序的头文件中包含四种排序方法:泡沫排序法(bubble)
-
介绍一下这个程序的功能: 1
-
这个程序是一个Win32程序
-
这个程序是一个个人考勤软件,它从系统时钟获取时间信息,只要上下班时按时在当日考勤栏内点击相应的栏目标题即可逐日记录下个人每天的工作时间,按月统计汇总,按年形成文件.可以随意查看过去的记录,也可把记录按
-
这个程序对于输入的一系列浮点数
-
这个程序不错
-
这个程序不错哟 这个是本人写的 哈哈 见笑了
-
最近在新浪"读书频道"下载了一个小说,有40多个页面,后缀全是shtml的,发现改成html就可以在本地看了,但改起来太麻烦,就写了这个程序,专门用来批量修改某目录下的文件后缀.
|