Check if a specific tab page is selected (active)

后端 未结 6 1665
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 05:43

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 curren

6条回答
  •  甜味超标
    2020-12-14 06:15

    For whatever reason the above would not work for me. This is what did:

    if (tabControl.SelectedTab.Name == "tabName" )
    {
         .. do stuff
    }
    

    where tabControl.SelectedTab.Name is the name attribute assigned to the page in the tabcontrol itself.

提交回复
热议问题