When does a click event occur?

Looking at the MSDN documentation, it’s not entirely clear to me when the click event occurs. What order? this:

mousedown, mouseup, click?

thank

+3
source share
5 answers
  • MouseDown event.
  • Click an event.
  • MouseClick event.
  • MouseUp event.

This is for winforms, more details here: Mouse Events in Windows Forms

+6
source

The definition of 'click' itself includes mouse and mouse movement. You can demonstrate this by simply clicking the button on the form and displaying the Messagebox when clicked. The message appears only after releasing the mouse button.

+1
source

ASP.NET, .

<asp:Button ID="But" runat="server" />

.

protected void Page_Load(object sender, EventArgs e)
{
    But.Click += (s, ev) =>
    {
        // after the postback
        // the method Page_Load will be called again
        // re-bind the event
        // and just after it this event will be called
    };
}
0

Click .

, ToolStripMenuItem.ShortcutKeys, Click , ().

Another example is clicking a button by pressing a button.

0
source

Source: https://habr.com/ru/post/1768154/


All Articles