Making a hover button work on a Windows Form application (I assume that is
what you are looking for) you can simply add the following functions:
private void HoverButton_MouseEnter(object sender, System.EventArgs e)
{
if( sender is Button)
{
((Button)sender).BackColor = Color.Red;
}
}
private void HoverButton_MouseLeave(object sender, System.EventArgs e)
{
if( sender is Button)
{
((Button)sender).BackColor = SystemColors.Control;
}
}
Next, you’ll want to wire up the MouseEnter event from your buttons (that
you want affected) to call HoverButton_MouseEnter and their MouseLeave event
to call HoverButton_MouseLeave.
Finally, change the colors specified within those functions to whatever you
want.
Brendan
"Zach" wrote:
Is it possible to hover a button and by doing so e.g.,
make it chage its color? Apart form a possible "yes",
please give a code example.
Zach.