Interactive Buttons


Description:

By using control properties, you can give your program an interactive look as you see on web sites. One of them is mouse over. When you mouse over on a hyperlink, it changes the color.

In this sample program, if you mouse over on a button it changes it's text color. In this sample project, default color of text is yellow but if you mouse over or click the button, it changes the text color to white. A neat look. huh? I don't know if you care or not but it looks cool ;).



Source Code:

You don't have to do anything to do so. Just set some properties of your button control either at run-time or at design-time by using Properties Window. These properties are FlatStyle, BackColor, ForeColor, and Fornt and you are all set.

button1.ForeColor = System.Drawing.Color.Yellow;
button1.BackColor = System.Drawing.Color.Maroon;
button1.FlatStyle = System.WinForms.FlatStyle.Flat;
button1.Font =
new System.Drawing.Font ("Verdana", 10,System.Drawing.FontStyle.Bold);

Up Next
    Ebook Download
    View all
    Learn
    View all