标题:vb6.0 rivhtextbox怎么才能有复制功能
只看楼主
pan888
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2021-5-16
结帖率:100%
已结贴  问题点数:20 回复次数:1 
vb6.0 rivhtextbox怎么才能有复制功能
同题目!
搜索更多相关主题的帖子: vb6.0 复制 
2021-06-17 22:24
apull
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:三体星系
等 级:版主
威 望:185
帖 子:1404
专家分:8479
注 册:2010-3-16
得分:20 
richtextbox右键菜单,用ctrl+c,ctrl+v,ctrl+x实现复制,粘贴,剪切。
建立个菜单,recheditbox鼠标右键添加MouseDown事件。
程序代码:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long

Private Sub mnuCut_Click()
'剪切
    RichEdit.SetFocus
    SendKeys "^X", True
End Sub

Private Sub mnuCopy_Click()
'复制
    RichEdit.SetFocus
    SendKeys "^C", True
End Sub

Private Sub mnuPaute_Click()
'粘贴
    RichEdit.SetFocus
    SendKeys "^V", True
End Sub

Private Sub RichEdit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'显示编辑区快捷菜单
    If Button = 2 Then
        PopupMenu mnuEdit
    End If
End Sub



2021-06-18 22:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-506033-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.138899 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved