实例介绍
【实例简介】
【实例截图】
【核心代码】
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace VistaButtonTest
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private VistaButton vistaButton1;
private VistaButton vistaButton2;
private VistaButtonTest.VistaButton vistaButton3;
private VistaButtonTest.VistaButton vistaButton4;
private VistaButtonTest.VistaButton vistaButton5;
private VistaButtonTest.VistaButton vistaButton6;
private VistaButtonTest.VistaButton vistaButton7;
private VistaButtonTest.VistaButton vistaButton8;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.vistaButton1 = new VistaButtonTest.VistaButton();
this.vistaButton2 = new VistaButtonTest.VistaButton();
this.vistaButton3 = new VistaButtonTest.VistaButton();
this.vistaButton4 = new VistaButtonTest.VistaButton();
this.vistaButton5 = new VistaButtonTest.VistaButton();
this.vistaButton6 = new VistaButtonTest.VistaButton();
this.vistaButton7 = new VistaButtonTest.VistaButton();
this.vistaButton8 = new VistaButtonTest.VistaButton();
this.SuspendLayout();
//
// vistaButton1
//
this.vistaButton1.BackColor = System.Drawing.Color.Transparent;
this.vistaButton1.ButtonText = "Default";
this.vistaButton1.Location = new System.Drawing.Point(48, 9);
this.vistaButton1.Name = "vistaButton1";
this.vistaButton1.Size = new System.Drawing.Size(163, 43);
this.vistaButton1.TabIndex = 0;
//
// vistaButton2
//
this.vistaButton2.BackColor = System.Drawing.Color.Transparent;
this.vistaButton2.BackImage = ((System.Drawing.Image)(resources.GetObject("vistaButton2.BackImage")));
this.vistaButton2.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton2.ButtonText = "Image";
this.vistaButton2.Location = new System.Drawing.Point(250, 9);
this.vistaButton2.Name = "vistaButton2";
this.vistaButton2.Size = new System.Drawing.Size(153, 43);
this.vistaButton2.TabIndex = 0;
//
// vistaButton3
//
this.vistaButton3.BackColor = System.Drawing.Color.Transparent;
this.vistaButton3.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton3.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
this.vistaButton3.ButtonStyle = VistaButtonTest.VistaButton.Style.Flat;
this.vistaButton3.ButtonText = "Yes (hover)";
this.vistaButton3.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton3.Image")));
this.vistaButton3.Location = new System.Drawing.Point(48, 103);
this.vistaButton3.Name = "vistaButton3";
this.vistaButton3.Size = new System.Drawing.Size(163, 43);
this.vistaButton3.TabIndex = 0;
//
// vistaButton4
//
this.vistaButton4.BackColor = System.Drawing.Color.Transparent;
this.vistaButton4.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton4.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.vistaButton4.ButtonStyle = VistaButtonTest.VistaButton.Style.Flat;
this.vistaButton4.ButtonText = "No (hover)";
this.vistaButton4.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton4.Image")));
this.vistaButton4.Location = new System.Drawing.Point(250, 103);
this.vistaButton4.Name = "vistaButton4";
this.vistaButton4.Size = new System.Drawing.Size(163, 43);
this.vistaButton4.TabIndex = 0;
//
// vistaButton5
//
this.vistaButton5.BackColor = System.Drawing.Color.Transparent;
this.vistaButton5.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton5.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(202)))), ((int)(((byte)(0)))));
this.vistaButton5.ButtonText = "Transparent";
this.vistaButton5.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(189)))), ((int)(((byte)(141)))));
this.vistaButton5.Location = new System.Drawing.Point(250, 198);
this.vistaButton5.Name = "vistaButton5";
this.vistaButton5.Size = new System.Drawing.Size(163, 43);
this.vistaButton5.TabIndex = 0;
this.vistaButton5.Click = new System.EventHandler(this.vistaButton5_Click);
//
// vistaButton6
//
this.vistaButton6.BackColor = System.Drawing.Color.Transparent;
this.vistaButton6.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton6.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(163)))), ((int)(((byte)(211)))));
this.vistaButton6.ButtonText = "Transparent";
this.vistaButton6.Location = new System.Drawing.Point(48, 198);
this.vistaButton6.Name = "vistaButton6";
this.vistaButton6.Size = new System.Drawing.Size(163, 43);
this.vistaButton6.TabIndex = 0;
//
// vistaButton7
//
this.vistaButton7.BackColor = System.Drawing.Color.Transparent;
this.vistaButton7.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton7.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
this.vistaButton7.ButtonText = "Rounded Corners";
this.vistaButton7.CornerRadius = 20;
this.vistaButton7.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(141)))), ((int)(((byte)(255)))), ((int)(((byte)(189)))));
this.vistaButton7.Location = new System.Drawing.Point(48, 310);
this.vistaButton7.Name = "vistaButton7";
this.vistaButton7.Size = new System.Drawing.Size(163, 43);
this.vistaButton7.TabIndex = 0;
//
// vistaButton8
//
this.vistaButton8.BackColor = System.Drawing.Color.Transparent;
this.vistaButton8.BaseColor = System.Drawing.Color.Transparent;
this.vistaButton8.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.vistaButton8.ButtonText = "Sharp Corners";
this.vistaButton8.CornerRadius = 0;
this.vistaButton8.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(141)))), ((int)(((byte)(189)))));
this.vistaButton8.Location = new System.Drawing.Point(250, 310);
this.vistaButton8.Name = "vistaButton8";
this.vistaButton8.Size = new System.Drawing.Size(163, 43);
this.vistaButton8.TabIndex = 0;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(520, 425);
this.Controls.Add(this.vistaButton1);
this.Controls.Add(this.vistaButton2);
this.Controls.Add(this.vistaButton3);
this.Controls.Add(this.vistaButton4);
this.Controls.Add(this.vistaButton5);
this.Controls.Add(this.vistaButton6);
this.Controls.Add(this.vistaButton7);
this.Controls.Add(this.vistaButton8);
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "Vista Button Test";
this.Load = new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
private void vistaButton5_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Show();
}
}
}
好例子网口号:伸出你的我的手 — 分享!
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明


网友评论
我要评论