如何使视图中的按钮在另一个视图中可见 [英] How to make a button located in a View visible in another View

查看:92
本文介绍了如何使视图中的按钮在另一个视图中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我有一个用c#创建的网络表单。我在表格上有3个意见,即



vStart

vRecord

vGrid



我在vStart中有一个名为Edit的按钮。

现在我希望这个按钮在vRecord中也可以看到并运行。



请帮我编写代码来完成它。



最好的问候,

Dear All,

I have a web form created in c#. I have 3 Views on the form i.e.,

vStart
vRecord
vGrid

I have a button named "Edit" in vStart.
Now I want this button to also be visible and functioning in vRecord.

Kindly help me write code for accomplishing it.

Best Regards,

推荐答案

一个简单的解决方案就是在你的按钮中创建一个这个按钮的副本查看vRecord并让两个按钮共享事件的相同处理程序。

因此,

btnEdit.Click + = new EventHandler(btnEdit_Click);

btnEdit_on_vRecord_View.Click + = new EventHandler(btnEdit_Click);
An easy solution would be to create a copy of this button in your view vRecord and let both the buttons share the same handler for the events.
Therefore,
btnEdit.Click += new EventHandler(btnEdit_Click);
btnEdit_on_vRecord_View.Click += new EventHandler(btnEdit_Click);


这篇关于如何使视图中的按钮在另一个视图中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆