📄 多次剪贴板.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1
Caption = "多次剪贴板"
ClientHeight = 2745
ClientLeft = 60
ClientTop = 345
ClientWidth = 3765
LinkTopic = "Form1"
ScaleHeight = 2745
ScaleWidth = 3765
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.Toolbar Toolbar1
Height = 630
Left = 0
TabIndex = 4
Top = 2040
Width = 3765
_ExtentX = 6641
_ExtentY = 1111
ButtonWidth = 609
ButtonHeight = 953
Appearance = 1
_Version = 393216
End
Begin VB.Timer Timer1
Interval = 1000
Left = 4140
Top = 60
End
Begin VB.ListBox List1
Height = 1320
ItemData = "多次剪贴板.frx":0000
Left = 53
List = "多次剪贴板.frx":0002
TabIndex = 3
Top = 600
Width = 3615
End
Begin VB.TextBox Text1
Height = 315
Left = 2520
TabIndex = 2
Top = 120
Width = 795
End
Begin VB.CommandButton Command2
Caption = "清空第N个"
Height = 315
Left = 1260
TabIndex = 1
Top = 120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "全部清空"
Height = 315
Left = 120
TabIndex = 0
Top = 120
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const Swp_NoMove = &H2
Const Swp_NoSize = &H1
Const Hwnd_TopMost = -1
Dim cbtext As String
Dim i, j As Integer
Dim wd As Long
Private Sub Command1_Click()
For j = List1.ListCount To 1 Step -1
List1.RemoveItem j - 1
Toolbar1.Buttons.Remove j
Next j
i = 0
cdtext = ""
End Sub
Private Sub Command2_Click()
List1.RemoveItem Val(Text1.Text) - 1
Toolbar1.Buttons.Remove Val(Text1.Text)
Text1.Text = ""
End Sub
Private Sub Form_Load()
wd = SetWindowPos(Form1.hwnd, Hwnd_TopMost, 0, 0, 0, 0, Swp_NoMove Or Swp_NoSize)
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
If Clipboard.GetText = cbtext Or Clipboard.GetText = "" Then
Exit Sub
End If
For j = 0 To List1.ListCount - 1
If Clipboard.GetText = List1.List(j) Then Exit Sub
Next j
cbtext = Clipboard.GetText
i = i + 1
Toolbar1.Buttons.Add i, , Left(cbtext, 5) + "..."
List1.AddItem cbtext, i - 1
Form1.Height = 1000 * ((i + 1) / 4) + 3000
Clipboard.Clear
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Clipboard.Clear
Clipboard.SetText List1.List(Button.Index - 1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -