难题!一个关于富文本框(RichTextBox)的难题!回答试验成功后马上给分!

chredhat1987 2004-07-23 08:38:52
在富文本框(RichTextBox)按Ctrl+Z,Ctrl+C等组合键能自身执行撤销,复制等操作。怎么样才能将这些功能屏蔽掉?
...全文
183 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
victorycyz 2004-07-23
  • 打赏
  • 举报
回复
Dim i As Integer, c As Boolean, L As Boolean

Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)

If (Shift And vbCtrlMask) And (KeyCode = vbKeyZ) Then
L = RichTextBox1.Locked
RichTextBox1.Locked = True
End If

If (Shift And vbCtrlMask) And (KeyCode = vbKeyC) Then
i = RichTextBox1.SelLength
RichTextBox1.SelLength = 0
c = True
End If

End Sub

Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)

RichTextBox1.Locked = L

If c = True Then
RichTextBox1.SelLength = i
c = False
End If

End Sub

northwolves 2004-07-23
  • 打赏
  • 举报
回复
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
If Shift = 2 And (Chr(KeyAscii) = "Z" Or Chr(KeyAscii) = "C") Then RichTextBox1.Text = RichTextBox1.Text
End Sub
supergreenbean 2004-07-23
  • 打赏
  • 举报
回复
搜索个子类处理的程序,然后把按键信息屏蔽掉

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧