ARTICLE

Creating Interactive Buttons

Posted by Mahesh Chand Articles | Visual Basic 2010 June 24, 2003
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.
Download Files:
 
Reader Level:

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 ;).



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)

share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Team Foundation Server Hosting
Become a Sponsor