如何在tabcontrol上添加每个tabpages的事件? [英] How to add an event on tabcontrol each tabpages?
本文介绍了如何在tabcontrol上添加每个tabpages的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是tabcontrol上的一个事件,当选择indexchanged上的每个tabpages时.. lang =sql>我想在每个页面上处理它。
如何在这一点上做:选中controlpage1 show image .. selected controlpage2 show image2 ..
What this an event on tabcontrol when select each tabpages on indexchanged.. lang="sql">I want to handle it on each pages.
How to do it at this point: selected controlpage1 show image.. selected controlpage2 show image2..
推荐答案
试试这个:选择Event SelectedIndexChanged
Try this: choose Event SelectedIndexChanged
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
{
switch (tabControl.SelectedIndex)
{
case 1:
{
//Your Changes
break;
}
case 2:
{
//Your Changes
break;
}
}
}
我希望我能提供帮助。
I hope I could help.
private void TabControl1_SelectedIndexChanged(Object sender, EventArgs e)
{
MessageBox.Show("You are in the TabControl.SelectedIndexChanged event.");
}
那么如何确定所选的tabpages1?
So how to determine tabpages1 selected?
使用选定的索引更改事件如下: -
use selected index changed event as follows:-
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
MessageBox.Show("This is " + tabControl1.SelectedTab.Name);
}
这篇关于如何在tabcontrol上添加每个tabpages的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文