我想再按一下就变回来,怎么办,是要在BUTTON属性里面改什么,还是要写代码?
还一个一样的,就是按下BUTTON,FORM的BACKCOLOR就变一个颜色
我想再按一下就变另一种颜色,再按一下又变另一种颜色,N次后循环,
先谢谢拉啊
[此贴子已经被作者于2005-7-22 18:43:40编辑过]
using System; using System.Drawing; using System.Windows.Forms;
public class BT_ok_nForm { bool ok_no; Button button1; public BT_ok_no() { button1 = new Button(); button1.Size = new Size(120,25); button1.Location = new Point(100,100); button1.Text = "你的要求又我来答"; Controls.Add(button1); button1.Click += new EventHandler(button1_Click); } public void button1_Click(object sender,EventArgs e) { ok_no = !ok_no; if(ok_no) button1.Text = "小丫头问题真是多"; else button1.Text = "小丫头问题真是怪"; } public static void Main(string [] args) { Application.Run(new BT_ok_no()); } } 你就当我是灌水,我积分200没法换头像
using System; using System.Drawing; using System.Windows.Forms;
public class BT_ok_nForm { bool ok_no; Button button1; public BT_ok_no() { button1 = new Button(); button1.Size = new Size(120,25); button1.Location = new Point(100,100); button1.Text = "你的要求又我来答"; Controls.Add(button1); button1.Click += new EventHandler(button1_Click); } public void button1_Click(object sender,EventArgs e) { ok_no = !ok_no; if(ok_no) button1.Text = "小丫头问题真是多"; else button1.Text = "小丫头问题真是怪"; } public static void Main(string [] args) { Application.Run(new BT_ok_no()); } } 你就当我是灌水,我积分200没法换头像
运行一 下,错误还真的不少,看来真的是灌水了!