本文介绍了Tabcontrol事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
只是一个问题让我完全难过.
简而言之,如何在更改标签页时隐藏/显示某些控件?
IE.当用户将选项卡1切换到选项卡2时,我想隐藏菜单栏和工具栏.
干杯
Siek
Hi Guys,
Just having an issue that has completely stumped me.
In a nutshell, how to hide/show certain controls when a tabpage is changed?
ie. when the tabpage 1 is switched to tabpage 2 by the users, I want to hide the menustrip and toolbar.
Cheers
Siek
推荐答案
Private Sub tcMyTabControl_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tcMyTabControl.SelectedIndexChanged
'If newly selected tab is tabpage2
If tcMyTabControl.SelectedTab Is tpTabPage2 Then
'Hide menu/toolbar
Else
'Show menu/toolbar
End If
End Sub
希望这会有所帮助.
Hope this helps.
这篇关于Tabcontrol事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!