鼠标右键单击TextBox会弹出奇怪的菜单 [英] Right Mouse Click in TextBox brings up strange menu

查看:96
本文介绍了鼠标右键单击TextBox会弹出奇怪的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用鼠标右键单击以启动弹出菜单,但当我在鼠标右键单击TextBox时,会出现一个菜单:



撤消(灰色) )

剪切(灰色)

复制(灰色)

粘贴

删除(灰色)

全选

从右到左阅读订单

显示Unicode控制字符(灰色)

插入Unicode控制字符> (灰色)

打开IME

Reconversion(灰色)



点击Esc键后,弹出窗口菜单出现。

我不知道它来自何处或如何阻止它。



任何想法?

解决方案

这是VB6中TextBox的默认弹出菜单。



没有直接的方法来压制它但是这个文章 [ ^ ]显示了解决方法


谢谢CHill60,



我能够做到这一点:



模块:

公共声明函数SendMessage Lib user32别名SendMessageA(_

ByVal hwnd As Long,_

ByVal wMsg As Long,_

ByVal wParam As Long, _

ByRef l Param As Any)As



Public Const WM_RBUTTONDOWN As Long =&H204

Public bolRightClicked As Boolean

< br $>


在我的表格中:

私有子Text1_MouseDown(索引为整数,按钮为整数,Shift为整数,x为单,y为单)



Select Case Button

Case 1'Left

Case 2'Right

bolRightClicked = False

SendMessage Me.hwnd,WM_RBUTTONDOWN,0,0&

PopupMenu mnuPopUp2

案例4'中间

结束选择



结束次级



感谢您向正确的方向推!

I'm using the Right Mouse click to launch a popup menu, but when I Right Mouse click in the TextBox, a menu appears:

Undo (Grayed)
Cut (Grayed)
Copy (Grayed)
Paste
Delete (Grayed)
Select All
Right to left Reading order
Show Unicode control characters (Grayed)
Insert Unicode control character> (Grayed)
Open IME
Reconversion (Grayed)

After hitting the Esc key, then my popup menu appears.
I have no idea where this is coming from or how to stop it.

Any ideas?

解决方案

It is the default pop-up menu for a TextBox in VB6.

There is no direct way to suppress it but this article[^] shows a way around it


Thanks CHill60,

I was able to do this:

In a Module:
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

Public Const WM_RBUTTONDOWN As Long = &H204
Public bolRightClicked As Boolean


In my Form:
Private Sub Text1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)

Select Case Button
Case 1 'Left
Case 2 'Right
bolRightClicked = False
SendMessage Me.hwnd, WM_RBUTTONDOWN, 0, 0&
PopupMenu mnuPopUp2
Case 4 'Middle
End Select

End Sub

Thanks for your "Push" in the right direction!


这篇关于鼠标右键单击TextBox会弹出奇怪的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆