检查是否选择一个特定的标签页(活动) [英] Check if a specific tab page is selected (active)
本文介绍了检查是否选择一个特定的标签页(活动)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提出一个事件来检查,如果一个标签控制特定的标签页是活动的。
I am making an event to check if specific tab page in a tab control is active.
的一点是,它会触发一个事件,如果在标签页一个选项卡控件是当前选定的选项卡。任何代码,这将使我我需要什么?
The point is, it will trigger an event if that tab page in a tab control is the currently selected tab. Any code that will give me what I need?
推荐答案
假设你在WinForm的看着外面,有一个的SelectedIndexChanged
事件标签
Assuming you are looking out in Winform, there is a SelectedIndexChanged
event for the tab
现在在里面,你可以检查您的特定标签和逻辑
Now in it you could check for your specific tab and proceed with the logic
private void tab1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tab1.SelectedTab == tab1.TabPages["tabname"])//your specific tabname
{
// your stuff
}
}
这篇关于检查是否选择一个特定的标签页(活动)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文