也就是说你还是先要在A窗体上面做 *** 作然后调用父窗体的方法show出B咯,是吧
1激活方法可以用遍历Mdi子窗体就行了,下面是激活方法
private void toolStripButton1_Click(object sender, EventArgs e){
foreach (Form item in thisMdiChildren)
{
if (itemText == "窗口 1")
{
itemActivate();
}
}
}
2A向B传参数的话用公共静态类 或 B 提供公共静态方法咯
TabIndex属性
ShowDialog显示出窗体后触发什么事件嘛
窗体的PageLoad事件
控件的 OnPaint事件
补充:
如果是TextBox就好办了啊,C控件设计里,对TabIndex属性做好排序0、1、2
然后你的B窗体里使用C控件时,将C控件的TabIndex设置为0, B窗体里的其他控件也要做好排序设置1、2、3、4、5
再d出B的时候,焦点就在C控件的TextBox上。
C#失去焦点触发事件:
textBox5LostFocus+=newEventHandler(txt_LostFocus);//失去焦点后发生事件
textBox5GotFocus+=newEventHandler(txt_GotFocus);//获取焦点前发生事件
textBox5MouseClick+=newMouseEventHandler(textBox5_MouseClick);//鼠标点击事件
newEventHandler(txt_LostFocus);
voidtxt_LostFocus(objectsender,EventArgse)
{
txtInput(textBox5);
}
扩展资料
C#WinForm窗体获得焦点时即触发事情
usingSystem;
usingSystemCollectionsGeneric;
usingSystemComponentModel;
usingSystemData;
usingSystemDrawing;
usingSystemText;
usingSystemWindowsForms;
namespaceWindowsApplication3
{
publicpartialclassForm1:Form
{
publicForm1()
{
InitializeComponent();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
Form2obj=newForm2(thislabel1);
objShow();
}
}
}
以上就是关于c#mdi窗体激活但不获取焦点怎么实现全部的内容,包括:c#mdi窗体激活但不获取焦点怎么实现、c#中ShowDialog的问题、C# 得到焦点触发的事件 怎么实现 或者失去焦点触发事件等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)