Suppose I have a textBox element, if I move the mouse outside this element and click on the form or on the form element, then I would have a handler. Is there such a standard event in C #?

  • 2
    A handler is a means. And what effect do you want to achieve with this handler? Maybe there are other ways for this? - nzeemin

1 answer 1

Or handle a couple of events: the textbox MouseLeave (the mouse leaves it) and then click on the form - Click , MouseClick , MouseDown .

Or, probably, you need focus events: the Leave textbox (focus loss) and the Enter event (focus acquisition) from another control. Here it is necessary to take into account that the form itself cannot receive a focus; only controls intended for input can do this.
Although the form has an Activated event, fired when control passes from other windows to it.