[英]what event is raised when a tabPage is removed from a TabControl in C#
从C#WinForms中的TabControl中删除tabPage时,我可以处理什么事件,以便在TabControl中没有tabPages的情况下隐藏窗口?
You can use the SelectedIndexChanged
event. 您可以使用
SelectedIndexChanged
事件。 Then use the ((TabControl)sender).TabCount
to determine if any tabs are left on the control. 然后使用
((TabControl)sender).TabCount
确定((TabControl)sender).TabCount
是否还有任何选项卡。 If the count is zero, hide the control. 如果计数为零,则隐藏控件。
No matter how you accomplish grabbing the event, you'll need to do a check against the tab count to hide your control. 无论您如何完成捕获事件,都需要对选项卡数进行检查以隐藏控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.