Question How to Capture Right-Click event

JonJacobs

Active member
Joined
Jul 28, 2022
Messages
35
Programming Experience
10+
I want to capture the right-mouse up event for a textbox I have this:
C#:
        private void txtSelect_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
                txtSelect.Clear();
        }
It works, but only after I escape out of the drop-down menu that appears for the right-click event. I want to avoid that menu. What should I do?
Jon
 
Last edited by a moderator:
Solution
Moving to WinForms...
 
In the constructor after the InitializeComponent() would have been better.
 

Latest posts

Back
Top Bottom