我想使用tab索引来检查选项卡索引在组合框中的位置...我也想为此做个条件
if(combobox1 == tabindex) // check data is already in database or not
{
get data on dridview according to combobox1.Text
}
else if(combobox 2 == tabindex) // check data is already in database or not
{
get data on dridview according to combobox2.Text
}
else if(combobox 3 == tabindex) // check data is already in database or not
{
get data on dridview according to combobox3.Text
}
这可能吗?
答案 0 :(得分:0)
试试这个
var a = Form1.getActiveTab();
var idx = Form1.items.indexOf(a);