C # how to disable the intermediate mouse key

Source: Internet
Author: User

Copy codeThe Code is as follows:

Declare an event:

Num_DiscountAmount.MouseWheel + = new MouseEventHandler (Num_DiscountAmount_MouseWheel );

Write an event

Private void Num_DiscountAmount_MouseWheel (object sender, MouseEventArgs e)
{
HandledMouseEventArgs h = e as HandledMouseEventArgs;
If (h! = Null)
{
H. Handled = true;
}
}

There is also a third-party control DevExpress. XtraEditors. SpinEdit. How do I disable the intermediate mouse key?

The method is as follows:

Declare events: (SpinEdit1.Controls [0] as DevExpress. XtraEditors. TextBoxMaskBox). MouseWheel + = new MouseEventHandler (Frm_MouseWheel );

Write events:

Void Frm_MouseWheel (object sender, MouseEventArgs e)
{
If (e. Delta! = 0)
DevExpress. Utils. DXMouseEventArgs. GetMouseArgs (e). Handled = true;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.