Thursday 1 December 2011

How to use C# MouseOver Events in Windows Forms

Yet again we take the good old select file form as our example. Let us use the MouseHover event of the ellipsis button to inform the user of its function.


To add an function to handle the event, click the event tab of the button and scroll to MouseHover event and double click it.
Add the following code to the event procedure.
private void buttonSelectXL_MouseHover(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "Click the Button to select the file";
}
The toolstrip label will be updated whenever the mouse pointer is hovered over the ellipsis button.



0 comments:

Post a Comment