I am working on a Windows Forms app, at the moment of selecting the tab
by means of a If
I want it to fulfill a condition, but I have not achieved it I have tried with this code:
private void tabControlCategoriaSubCategoria_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
{
if (tabCPCategoria.TabIndex == 1)
{
EventHandler handler = DGVCategoria;
if (handler != null) handler(this, e);
}
if (tabCPCategoria.TabIndex == 2)
{
EventHandler handler = DGVSubCategoria;
if (handler != null) handler(this, e);
}
}
I've also tried this one:
private void tabControlCategoriaSubCategoria_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
{
if (tabCPCategoria.TabItem == tabItem1)
{
EventHandler handler = DGVCategoria;
if (handler != null) handler(this, e);
}
if (tabCPCategoria.TabItem == tabItem2)
{
EventHandler handler = DGVSubCategoria;
if (handler != null) handler(this, e);
}
}
It has not worked for me, in other versions I've done it with SelectecTab
but now it does not have that property.