地磅称量系统之(12)设计用户编辑数据按钮显示出来的操作风格

 

让知识更加联贯 让技术走进生活
我的博客        我的程序 我的网络
               ------郑紫至
               E-mail:zhengzizhi@yahoo.com.cn
地磅称量系统
 
12. MyTemplateForm窗体模板中编辑数据的操作风格代码如下:
       private void button1New_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = false;
            this.button1Modify.Enabled = false;
            this.button1Delete.Enabled = false;
            this.button1Query.Enabled = false;
            this.button1Print.Enabled = false;
            this.button1Save.Visible = true;
            this.button1Cancel.Visible = true;
        }
 
        private void button1Modify_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = false;
            this.button1Modify.Enabled = false;
            this.button1Delete.Enabled = false;
            this.button1Query.Enabled = false;
            this.button1Print.Enabled = false;
            this.button1Save.Visible = true;
            this.button1Cancel.Visible = true;
        }
 
        private void button1Delete_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = true;
            this.button1Delete.Enabled = true;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = true;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
 
        private void button1Query_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = true;
            this.button1Delete.Enabled = true;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = true;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
 
        private void button1Print_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = true;
            this.button1Delete.Enabled = true;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = true;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
 
        private void button1Save_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = true;
            this.button1Delete.Enabled = true;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = true;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
 
        private void button1Cancel_Click(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = true;
            this.button1Delete.Enabled = true;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = true;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
 
        private void MyTemplateForm_Load(object sender, EventArgs e)
        {
            this.button1New.Enabled = true;
            this.button1Modify.Enabled = false;
            this.button1Delete.Enabled = false;
            this.button1Query.Enabled = true;
            this.button1Print.Enabled = false;
            this.button1Save.Visible = false;
            this.button1Cancel.Visible = false;
        }
在设计模式下鼠标双击窗体Load事件栏位和双击7个button按钮的Click事件栏位自动生成代码
然后编写内部具体实现 。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值