How to detect when the mouse is pointing to a button

Asked

Viewed 59 times

1

I have a form where certain actions will be executed only when a button btn have the mouse cursor on it, which button event I use ?

1 answer

5


You can use the Event MouseHover button.

To use it, simply select the button you want to add the action and in the Properties window in the top bar click on Events (the icon is lightning): inserir a descrição da imagem aqui

After 2 click, the IDE automatically creates the event and you fill in your action.

A simple example: inserir a descrição da imagem aqui

You can tbm create your own event and use it right after initializing the components (InitializeComponent();).

see how: inserir a descrição da imagem aqui

  • It’s okay to put prints demonstrating the result, but the code is the main one, and should be posted as text. =]

  • Which code do you want to see @Rovannlinhalis? Man the guy wants to know which event to use anything else. If he posted the code to be incremented in the action, then that’s okay! I would expose the event with requested action.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.