本文介绍了处理子窗体的控制事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目中有两个WindowsForm:
1. CRUD
2. CountryUI:CRUD
第一个WindowsForm具有BindingNavigator.
如何在第二个WindowsForm中处理BindingNavigator的事件?
There are two WindowsForm in my project:
1. CRUD
2. CountryUI : CRUD
First WindowsForm has a BindingNavigator.
How can I handle BindingNavigator''s event in second WindowsForm?
推荐答案
public System.Drawing.Forms.Form CRUD
{
public virtual void Do()
{
//
}
public void Control_Click(object sender, EventArg e)
{
Do();
}
}
第二步:
现在,通过覆盖方法"Do",我可以做我想做的事情.
Second step:
Now by overriding method "Do", I can do what I want.
public System.Drawing.Forms.Form CountryUI: CRUD
{
public override void Do()
{
//some code..
}
}
我忽略了一个事件.是吗?
I overrided an event. did I?
这篇关于处理子窗体的控制事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!