📄 frmwiz.frm
字号:
End
End
End
Begin VB.Frame fraStep
Caption = "Archive name"
Height = 4695
Index = 0
Left = 3000
TabIndex = 3
Top = 240
Width = 4575
Begin VB.CommandButton cmdBrowse
Caption = "Browse..."
Enabled = 0 'False
Height = 375
Left = 2880
TabIndex = 7
Top = 1080
Width = 1455
End
Begin VB.TextBox txtArchive
Height = 285
Left = 240
TabIndex = 6
Top = 720
Width = 4095
End
Begin VB.Label lblArchive
Caption = "Please enter the name of an archive or press Browse..."
Height = 375
Left = 240
TabIndex = 5
Top = 360
Width = 3975
End
End
Begin VB.Frame fraStep
Caption = "Files to compress"
Height = 4695
Index = 1
Left = 2640
TabIndex = 4
Top = 240
Width = 4575
Begin VB.CommandButton cmdRemove
Caption = "Remove"
Enabled = 0 'False
Height = 375
Left = 1800
TabIndex = 18
Top = 2640
Width = 1455
End
Begin VB.CommandButton cmdAdd
Caption = "Add"
Enabled = 0 'False
Height = 375
Left = 240
TabIndex = 16
Top = 2640
Width = 1455
End
Begin VB.DriveListBox Drive1
Height = 315
Left = 2400
TabIndex = 11
Top = 2230
Width = 1935
End
Begin VB.DirListBox Dir1
Height = 1155
Left = 2400
TabIndex = 10
Top = 960
Width = 1935
End
Begin VB.FileListBox File1
Height = 1560
Left = 240
TabIndex = 9
Top = 960
Width = 2052
End
Begin VB.ListBox lstSelected
Height = 1368
Left = 240
TabIndex = 8
Top = 3120
Width = 4092
End
Begin VB.Label Label2
Caption = "Browse for the files to be compressed to the archive, and add them to the list box"
Height = 375
Left = 240
TabIndex = 15
Top = 360
Width = 4095
End
End
End
Attribute VB_Name = "frmWizard"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private m_iStep As Integer
Private Const m_cMaxSteps = 4
Sub DisplaySummary()
Dim sSummary As String
Dim CRLF As String * 2
Dim I As Integer
CRLF = Chr$(13) & Chr$(10)
sSummary = "Compress the following " & Format$(lstSelected.ListCount) & " file"
If (lstSelected.ListCount > 1) Then
sSummary = sSummary & "s"
End If
sSummary = sSummary & " to the archive " & txtArchive.Text & "." & CRLF & CRLF
For I = 0 To lstSelected.ListCount - 1
sSummary = sSummary & Chr$(9) & lstSelected.List(I) & CRLF
Next I
sSummary = sSummary & CRLF
sSummary = sSummary & "Selected options " & CRLF
If (optFull(0).Value) Then
sSummary = sSummary & Chr(9) & "Full path information saved" & CRLF
Else
sSummary = sSummary & Chr(9) & "Only filenames saved" & CRLF
End If
If (optEncrypt(0).Value) Then
sSummary = sSummary & Chr(9) & "Files will be encrypted" & CRLF
Else
sSummary = sSummary & Chr(9) & "Files will not be encrypted" & CRLF
End If
If (optLevel(0).Value) Then
sSummary = sSummary & Chr(9) & "Files will be stored without compression" & CRLF
ElseIf (optLevel(1).Value) Then
sSummary = sSummary & Chr(9) & "Files will hame minimum compressed" & CRLF
ElseIf (optLevel(2).Value) Then
sSummary = sSummary & Chr(9) & "Files will have normal compression" & CRLF
Else
sSummary = sSummary & Chr(9) & "Files will have maximum compression" & CRLF
End If
If (optSpan(0).Value) Then
sSummary = sSummary & Chr(9) & "Archive may span multiple disks" & CRLF
Else
sSummary = sSummary & Chr(9) & "Archive will not span disks" & CRLF
End If
If (optLFN(0).Value) Then
sSummary = sSummary & Chr(9) & "Long filenames will be stored" & CRLF
Else
sSummary = sSummary & Chr(9) & "Short (8.3) filenames will be stored" & CRLF
End If
If (optComment(0).Value) Then
sSummary = sSummary & Chr(9) & "Archive will have a comment added" & CRLF
End If
txtSummary.Text = Trim$(sSummary)
End Sub
Private Sub cmdAdd_Click()
Dim sFilename As String
sFilename = File1.Path
If (Right$(sFilename, 1) <> "\") Then
sFilename = sFilename & "\"
End If
sFilename = sFilename & File1.filename
lstSelected.AddItem sFilename
If (lstSelected.ListCount = 1) Then
cmdNext.Enabled = True
cmdFinish.Enabled = True
cmdRemove.Enabled = True
End If
End Sub
Private Sub cmdBack_Click()
If (m_iStep > 0) Then
fraStep(m_iStep).Visible = False
If (m_iStep = m_cMaxSteps) Then
cmdNext.Enabled = True
End If
m_iStep = m_iStep - 1
If (m_iStep = 0) Then
cmdBack.Enabled = False
End If
fraStep(m_iStep).Visible = True
End If
End Sub
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdFinish_Click()
If (fraStep(m_cMaxSteps).Visible = False) Then
DisplaySummary
fraStep(m_iStep).Visible = False
fraStep(m_cMaxSteps).Visible = True
m_iStep = m_cMaxSteps
End If
frmZIP.Show 1
End
End Sub
Private Sub cmdNext_Click()
Dim iDrive As Integer
If (m_iStep < m_cMaxSteps) Then
fraStep(m_iStep).Visible = False
If (m_iStep = 0) Then
cmdBack.Enabled = True
If (InStr(txtArchive.Text, ":")) Then
iDrive = Asc(UCase$(Left(txtArchive.Text, 1))) - 65
If (GetDriveType(iDrive) <> DRIVE_REMOVABLE) Then
fraOption(4).Enabled = False
optSpan(0).Enabled = False
optSpan(1).Enabled = False
Else
fraOption(4).Enabled = True
optSpan(0).Enabled = True
optSpan(1).Enabled = True
End If
Else
fraOption(4).Enabled = False
optSpan(0).Enabled = False
optSpan(1).Enabled = False
End If
End If
m_iStep = m_iStep + 1
If (m_iStep = m_cMaxSteps) Then
cmdNext.Enabled = False
DisplaySummary
End If
fraStep(m_iStep).Visible = True
End If
End Sub
Private Sub cmdRemove_Click()
lstSelected.RemoveItem lstSelected.ListIndex
If (lstSelected.ListCount = 0) Then
cmdNext.Enabled = False
cmdFinish.Enabled = False
cmdRemove.Enabled = False
End If
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
cmdAdd.Enabled = False
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
cmdAdd.Enabled = True
End Sub
Private Sub File1_DblClick()
cmdAdd_Click
End Sub
Private Sub Form_Load()
Dim I As Integer
m_iStep = 0
fraStep(m_iStep).ZOrder
For I = 0 To m_cMaxSteps
fraStep(I).Move 2640, 240, 4575, 4695
If (I > 0) Then
fraStep(I).Visible = False
End If
Next I
txtSummary.BackColor = frmWizard.BackColor
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub
Private Sub lstSelected_DblClick()
cmdRemove_Click
End Sub
Private Sub optComment_Click(Index As Integer)
If (Index = 0) Then
lblComment.Enabled = True
txtComment.Enabled = True
Else
lblComment.Enabled = False
txtComment.Enabled = False
End If
End Sub
Private Sub optEncrypt_Click(Index As Integer)
If (Index = 0) Then
txtPassword.Enabled = True
lblPassword.Enabled = True
Else
txtPassword.Enabled = False
lblPassword.Enabled = False
End If
End Sub
Private Sub txtArchive_Change()
If (Len(txtArchive.Text) = 0) Then
cmdNext.Enabled = False
Else
cmdNext.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -