form1.frm
来自「vb 的例子」· FRM 代码 · 共 67 行
FRM
67 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1125
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 1125
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtSource
DragIcon = "Form1.frx":0000
Height = 390
Left = 30
TabIndex = 1
Text = "被拖动的内容"
Top = 0
Width = 1530
End
Begin VB.TextBox txtTarget
Height = 390
Left = 2250
TabIndex = 0
Top = 300
Width = 1620
End
Begin VB.Label lblSource
Caption = "这是一个标签控件"
DragIcon = "Form1.frx":0442
DragMode = 1 'Automatic
Height = 300
Left = 0
TabIndex = 2
Top = 600
Width = 1560
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()
End Sub
Private Sub lblSource_Click()
lblSource.Drag
End Sub
Private Sub txtSource_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 2 Then
txtSource.Drag 1
End If
End Sub
Private Sub txtTarget_DragDrop(Source As Control, X As Single, Y As Single)
If TypeOf Source Is TextBox Then
txtTarget.Text = Source.Text
Source.Text = ""
Else
txtTarget.Text = Source.Caption
Source.Caption = ""
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?