📄 targetfile.frm
字号:
VERSION 5.00
Begin VB.Form Dialog1
BorderStyle = 3 'Fixed Dialog
Caption = "Dialog Caption"
ClientHeight = 3195
ClientLeft = 5430
ClientTop = 3960
ClientWidth = 6030
Icon = "targetfile.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 6030
ShowInTaskbar = 0 'False
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4680
TabIndex = 7
Top = 960
Width = 1215
End
Begin VB.FileListBox File1
Height = 2790
Left = 2520
TabIndex = 5
Top = 360
Width = 2055
End
Begin VB.DirListBox Dir1
Height = 2400
Left = 120
TabIndex = 4
Top = 720
Width = 2295
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 120
TabIndex = 3
Top = 360
Width = 2295
End
Begin VB.TextBox Text1
Height = 270
Left = 120
Locked = -1 'True
TabIndex = 2
Top = 0
Width = 5775
End
Begin VB.CommandButton CancelButton
Caption = "Cancel"
Height = 375
Left = 4680
TabIndex = 1
Top = 2640
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Height = 375
Left = 4680
TabIndex = 0
Top = 2160
Width = 1215
End
Begin VB.Label Label1
Caption = "请输入你想生成的文件名:"
Height = 375
Left = 4680
TabIndex = 6
Top = 480
Width = 1215
End
End
Attribute VB_Name = "Dialog1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub CancelButton_Click()
Form1.Targetfile.Caption = "目的文件(.mif)"
Form1.Target_File_Name = ""
Dialog1.Hide
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text2.Text = ""
If Right$(Dir1.Path, 1) = "\" Then
Text1.Text = Dir1.Path + File1.FileName
Else
Text1.Text = Dir1.Path + "\" + File1.FileName
End If
End Sub
Private Sub File1_PathChange()
File1.FileName = "*.mif"
Text1.Text = Dir1.Path
End Sub
Private Sub Form_Load()
Drive1.Drive = App.Path
File1.FileName = "*.mif"
Text1.Text = Dir1.Path
End Sub
Private Sub OKButton_Click()
Dim Fnum As Integer
If Right$(Text1.Text, 4) = ".mif" Then
If Trim(Text2.Text) = "" Then
Form1.Targetfile.Caption = "目的文件(.mif) " + File1.FileName
Else
Form1.Targetfile.Caption = "目的文件(.mif) " + Trim(Text2.Text) + ".mif"
End If
'Get a free file number
Fnum = FreeFile
'Open the file.
Open Trim(Text1.Text) For Output As #Fnum
'Create mif file hander
Print #Fnum, "Version 300"
Print #Fnum, "Charset " + Chr(34) + "WindowsSimpChinese" + Chr(34)
Print #Fnum, "Delimiter " + Chr(34) + "," + Chr(34)
Print #Fnum, "CoordSys Earth Projection 1, 0"
Print #Fnum, "Columns 1"
Print #Fnum, " NAME Char(60)"
Print #Fnum, "Data"
Print #Fnum, ""
Close #Fnum
Form1.Target_File_Name = Text1.Text
Dialog1.Hide
Else
MsgBox ("请创建一个mif文件!")
End If
End Sub
Private Sub Text2_Change()
If Trim(Text2.Text) = "" Then
Else
Text1.Text = Dir1.Path + "\" + Trim(Text2.Text) + ".mif"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -