📄 frmfilechoose.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmFileChoose
BorderStyle = 4 'Fixed ToolWindow
Caption = "文件发送"
ClientHeight = 2625
ClientLeft = 45
ClientTop = 285
ClientWidth = 4380
Icon = "frmFileChoose.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 175
ScaleMode = 3 'Pixel
ScaleWidth = 292
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdSend
Caption = "发送(&S)"
Height = 255
Left = 120
TabIndex = 5
Top = 2280
Width = 855
End
Begin MSComDlg.CommonDialog cdgSelect
Left = 240
Top = 1320
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox txtComments
Appearance = 0 'Flat
Height = 1215
Left = 120
MaxLength = 200
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 4
Top = 960
Width = 4125
End
Begin VB.CommandButton cmdBrowse
Caption = "浏览(&B)"
Height = 285
Left = 3360
TabIndex = 2
Top = 360
Width = 855
End
Begin VB.TextBox txtFile
Appearance = 0 'Flat
Height = 285
Left = 120
TabIndex = 1
Top = 360
Width = 3135
End
Begin VB.Label lblComments
AutoSize = -1 'True
Caption = "文件备注:"
Height = 180
Left = 120
TabIndex = 3
Top = 720
Width = 810
End
Begin VB.Label lblFile
AutoSize = -1 'True
Caption = "请选择发送文件: "
Height = 180
Left = 120
TabIndex = 0
Top = 120
Width = 1440
End
End
Attribute VB_Name = "frmFileChoose"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim MyID As Long
Dim SendClicked As Boolean
Private Sub cmdBrowse_Click()
'Setup error handling
On Error GoTo Err_DetermineErr
'Set Properties for the Common Dialog Control
With cdgSelect
'An error will occur if user clicks Cancel
.CancelError = True
.DialogTitle = "请选择传送文件:"
.Filter = "所有文件 (*.*)|*.*"
.ShowOpen
End With
'Show the user the selected file
txtFile = cdgSelect.FileName
Exit Sub
Err_DetermineErr:
'Cancel Was Selected, Do Nothing
End Sub
Private Sub cmdCancel_Click()
'unload the form
Unload Me
End Sub
Private Sub cmdSend_Click()
With ftSend(MyID)
.Comment = txtComments
.FileSize = CDbl(FileLen(txtFile))
.FileToSend = txtFile
.frmSend.InitTransfer MyID
End With
SendClicked = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim MsgRet As VbMsgBoxResult 'Message Box Return Value
'If there is a valid file displayed in txtFile, Prompt
'the user to verify the cancel command
If (cmdSend.Enabled = True) And (SendClicked = False) Then
Set frmFileChoose = Nothing
Else
'Remove the form from memory
Set ftSend(MyID).frmChoose = Nothing
End If
End Sub
Private Sub txtFile_Change()
On Error GoTo ErrHandler
'Disable the send command button if no file is selected
If FileLen(txtFile) <> 0 Then cmdSend.Enabled = True Else _
cmdSend.Enabled = False
Exit Sub
ErrHandler:
'The file doesnt exist, so disable the send button
cmdSend.Enabled = False
End Sub
Public Function ChooseSend(ByVal id As Long)
MyID = id
Me.Visible = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -