在运行时关闭标签页 [英] close tabpage at runtime

查看:105
本文介绍了在运行时关闭标签页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


如果我在运行时以tabdpage格式显示子表格。那我怎么能从子表单 Closed_event 关闭mdiparent表单的tabpage。

hi
if i show child form in tabpage at runtime in mdiparent form.then how i can close tabpage of mdiparent form from child form Closed_event.

推荐答案

当您从父级打开子表单时,您添加一个事件处理程序来监听子表单已关闭的事件。



当它被触发时,你使用tabControl.TabPages.Remove(childFormTabPage)来删除标签页。



那是我能得到的尽可能接近在不了解您的代码的情况下。
When you open the child form from the parent, you add an event handler to listen to the childforms closed event.

When that is fired, you use tabControl.TabPages.Remove(childFormTabPage) to remove the tab page.

That's as close as I can get without knowing more about your code.


这篇关于在运行时关闭标签页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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