How to thoroughly close the right-click menu of TextBox

xiaoxiao2021-03-06  40

How to "thoroughly" closes the TEXTBOX's right-click menu?

Getting TextBox's ContextMenu an empty menu, right click on TextBox, but the default menu is not coming, but if you click Right-click, press and hold, move the mouse to TextBox, release, the default menu Bounce. This is a question of a netizen, I use C # and VB.NET to do a way to achieve, as follows:

WM_CONTEXTMENU = 0x007b; // Send this when a user is clicked in a window.

C #: using system.drawing; using system.windows.form;

Namespace ManuApp {///

/// textboxNoman sauction. /// public class textboxNomanu: system.windows.forms.textbox {public textboxNomanu () {// // Todo: Add constructor logic //} protected override void WndProc (ref Message M) { IF (m.msg! = 0x007B) {base.wndProc (Ref m);}}}} VB.NET :PUBLIC CLASSITBOXEX Inherits System.windows.Forms.TextBox Public Sub New () MyBase.New () end sub

Protected Overrides Sub WndProc (Byref M As System.windows.Forms.Message) IF M.MSG <> & H7b Then

MyBase.WndProc (M) end if End Subend Class

转载请注明原文地址:https://www.9cbs.com/read-77472.html

New Post(0)