How to Create Interactive Buttons in Vb.net

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.
  • 2870
 
 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 ;).
 
interactive_btn1.jpg
 
 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)

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.