TabControl中的帮助 [英] help in TabControl

查看:70
本文介绍了TabControl中的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的WinForm TabControl中,在TabControl中三个Tab&botton的名称为Botton的下一步".单击Botton时,转到"Next Tab"
怎么样?
是表单Indax TabPage ???



注意:Winform&Out TabCotrol中的Botton.

In my WinForm TabControl in TabControl three Tab & botton the name of Botton ''Next'' When click the Botton go to Next Tab
How ?
Are form Indax TabPage ???



Note: The Botton in Winform & out TabCotrol.

推荐答案

请参阅
See TabControl.SelectedIndex at MSDN[^] All your button needs to do is read this, check it against the number of tab pages, increment if necessary, and write it back.


您可以通过使用给定的代码按需单击按钮来更改选项卡
you can change your tab by click on button as you wish by using given code
int i = 0;
        private void btnext_Click(object sender, EventArgs e)
        {
            if (i <= 3)  //using 3 A/c to your question you can change it
            {
                tabControl1.SelectedIndex = i;
                tabControl1.TabPages[i].Parent.Focus();
                i++;    // Increase counter
            }
            else
            {
             //you Message
            }
        }


您可以使用此代码

you can use this code

private void btnNext_Click(object sender, EventArgs e)
        {
            int NumIndex = tabControl1.SelectedIndex;
            if (NumIndex < tabControl1.TabPages.Count-1)
            {
                tabControl1.SelectTab(NumIndex + 1);
            }
        }


这篇关于TabControl中的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆