Windows Phone Developers

Sunday, January 25, 2009

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.





Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

3 comments:

  1. i have a question about something similar to this. I have a form with a bunch of buttons and input boxes and would like to set it up so that when there is a mouseover on a box, a small window will appear with some text. is this possible? i would prefer to not have another form window popup, but something like when you mouseover in ms word and there is a small explanation of that icon.

    ReplyDelete
  2. @HBaum Do you mean ToolTip?

    ReplyDelete
  3. poor post..................very worst!!!!!!!!!!!!!!

    ReplyDelete

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005