导航器瓶装TabControl [英] Navigator Bottons & TabControl
本文介绍了导航器瓶装TabControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在WinForm Tabcontrol中有一个带有6个TabPage和两个Button的Tabcontrol.
第一个按钮"Next"和另一个按钮"Back".
当我单击下一步"时,我想转到下一个TabPage,当我单击上一步"时,我要转到上一个TabPage.
如何通过TabIndex为TabPage ....
I have in WinForm Tabcontrol I have a Tabcontrol with 6 TabPages and two Buttons.
The First Button ''Next'' and another Button ''Back''.
When I click ''Next'' I want to go to next TabPage, when I click Back I want to go to the previous TabPage.
How do that By TabIndex for TabPage....
推荐答案
真的,
来自Microsoft的有关TabIndex属性的文档:
Really,
from microsoft docs about TabIndex property:
TabPage controls are contained within TabControl controls, however, and do not receive focus individually as part of the form''s TAB order. This property is therefore meaningless for this class.
因此,请使用SelectedIndex:
下一步按钮:
So use SelectedIndex :
Next button :
yourTabControl.SelectedIndex += (yourTabControl.SelectedIndex == 5 ? 0 : 1);
后退按钮:
Back button :
yourTabControl.SelectedIndex -= (yourTabControl.SelectedIndex == 0 ? 0 : 1);
这篇关于导航器瓶装TabControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文