We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WinForms
|
Category : TextBox

How do I prevent a control from receiving focus when it receives a mouseclick

You can set the control’s Enabled property to false. This will prevent clicking but also gives the disabled look.

There is a ControlStyles.Selectable flag that determines whether the control can get focus or not. But it does not appear to affect some controls such as TextBox. But you can prevent the TextBox from getting focus by overriding its WndProc method and ignoring the mouse down.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon