public partial class Form1 : Form
{
Ui3Dflipswitch us = new Ui3Dflipswitch();
Ui3Dflipswitch us1 = new Ui3Dflipswitch();
Ui3Dflipswitch us2 = new Ui3Dflipswitch();
public Form1()
{
InitializeComponent();
/*
* InitializeSwitchEffect(在哪个控件之内, 位置, 初始开关状态, 动画类型(目前只设定0), 动画速度, 执行的事件);
*/
us.InitializeSwitchEffect(this, new Point(100, 50), 1, 0, 2, switch1_Click);
us1.InitializeSwitchEffect(this, new Point(100, 150), 0, 1, 2, switch2_Click);
us2.InitializeSwitchEffect(this, new Point(100, 250), 0, 2, 2, switch3_Click);
if (us.switch_flag == 0) label1.Text = "打开...";
else label1.Text = "关闭...";
if (us1.switch_flag == 0) label2.Text = "打开...";
else label2.Text = "关闭...";
if (us2.switch_flag == 0) label3.Text = "打开...";
else label3.Text = "关闭...";
}
private void switch1_Click(object sender, EventArgs e)
{
if (us.switch_flag == 0) label1.Text = "打开...";
else label1.Text = "关闭...";
}
private void switch2_Click(object sender, EventArgs e)
{
if (us1.switch_flag == 0) label2.Text = "打开...";
else label2.Text = "关闭...";
}
private void switch3_Click(object sender, EventArgs e)
{
if (us2.switch_flag == 0) label3.Text = "打开...";
else label3.Text = "关闭...";
}
}
全部代码、说明、Demo全在这里了 https://pan.baidu.com/s/1htebnRu 自行下载,编辑修改 |
欢迎光临 CSkin博客 (http://bbs.cskin.net/) | Powered by Discuz! X3.2 |