📄 savefile.frm
字号:
VERSION 5.00
Begin VB.Form savefile
Caption = "文件保存"
ClientHeight = 4260
ClientLeft = 60
ClientTop = 465
ClientWidth = 6630
LinkTopic = "Form2"
ScaleHeight = 4260
ScaleWidth = 6630
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo1
Height = 300
Left = 840
TabIndex = 10
Text = "Combo1"
Top = 3720
Width = 3135
End
Begin VB.CommandButton Command3
Caption = "HELP"
Height = 375
Left = 5280
TabIndex = 9
Top = 3720
Width = 975
End
Begin VB.TextBox Text1
Height = 270
Left = 840
TabIndex = 5
Text = "Text1"
Top = 3120
Width = 3135
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 4080
TabIndex = 4
Top = 3720
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 4080
TabIndex = 3
Top = 3120
Width = 975
End
Begin VB.DirListBox Dir1
Height = 2190
Left = 600
TabIndex = 2
Top = 600
Width = 3375
End
Begin VB.FileListBox File1
Height = 2790
Left = 4080
TabIndex = 1
Top = 120
Width = 2295
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 600
TabIndex = 0
Top = 240
Width = 3375
End
Begin VB.Label Label3
Caption = "保存在"
Height = 375
Left = 0
TabIndex = 8
Top = 240
Width = 615
End
Begin VB.Label Label2
Caption = "保存类型:"
Height = 495
Left = 0
TabIndex = 7
Top = 3720
Width = 1215
End
Begin VB.Label Label1
Caption = "文件名:"
Height = 375
Left = 120
TabIndex = 6
Top = 3120
Width = 855
End
End
Attribute VB_Name = "savefile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim filenumber As Integer
Dim houzhui, road As String
fname = Text1.Text
filenumber = FreeFile
Select Case Combo1.ListIndex
Case -1
houzhui = ".dat"
Case 0
houzhui = ".mdb"
Case 1
houzhui = ".bmp"
End Select
road = Dir1.Path + "\" + fname + houzhui
If Combo1.ListIndex < 1 Then
Open road For Binary As filenumber
Close #filenumber
If fname <> "" Then
FileCopy "C:\Documents and Settings\tempfile.dat", road
Kill "C:\Documents and Settings\tempfile.dat"
Close #filenumber
savefile.Hide
Else
msg = MsgBox("文件名不能为空!", vbOKOnly, "警告")
End If
Else
'????保存图片save Form1.picture1
End If
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
Private Sub Command3_Click()
msg = MsgBox("DO BY YOURSELF!", vbOKOnly, "提示!")
End Sub
Private Sub Dir1_Change()
File1.FileName = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
Combo1.Text = ".dat"
Combo1.AddItem ".mdb"
Combo1.AddItem ".bmp"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -