I have a textbox, and I want it so if the user clicks anywhere on the form that is not the textbox itself, such textbox will lose focus. Any ideas?
Set the ActiveControl property of the form to null
to achieve what you want.
Note that this is contrary to what all other programs does, so it'll be a disconnect between the user expectations and the actual user experience. I would advice against it.
Something needs to get the focus. That something is what you should click. That better be another control on the form, the form itself doesn't want the focus. It has no use for it. Or click, say, the Start button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With