📄 form1.frm
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "拖放事件演示"
ClientHeight = 2505
ClientLeft = 240
ClientTop = 1545
ClientWidth = 7230
Icon = "form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 7230
StartUpPosition = 2 '屏幕中心
Begin RichTextLib.RichTextBox RichTextBox1
Height = 2415
Left = 3120
TabIndex = 1
Top = 0
Width = 4095
_ExtentX = 7223
_ExtentY = 4260
_Version = 393217
ScrollBars = 3
RightMargin = 10000
TextRTF = $"form1.frx":000C
End
Begin VB.ListBox List1
Height = 2400
ItemData = "form1.frx":0296
Left = 0
List = "form1.frx":0298
OLEDropMode = 1 'Manual
TabIndex = 0
Top = 0
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
List1.OLEDropMode = 1
List1.OLEDragMode = 1
RichTextBox1.OLEDropMode = 1
End Sub
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim i%
If Data.GetFormat(vbCFFiles) Then
Caption = Data.Files.Count & " object(s) selected"
List1.Clear
For i = 1 To Data.Files.Count
List1.AddItem Data.Files(i%)
Next i
End If
End Sub
Private Sub RichTextBox1_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
If Data.GetFormat(vbCFText) Then
RichTextBox1.LoadFile Data.GetData(vbCFText), rtfText
End If
If Data.GetFormat(vbCFFiles) Then
RichTextBox1.LoadFile Data.Files(1), rtfText
End If
Caption = RichTextBox1.FileName
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -