Oliver,
If ShowCloseOnEachTab is true you can close a tab even if it's not selected.
There is a workaround to solve this problem.
In ClosingTab event handler you can obtain the NTabStrip control which is the first item in NTabControl.Controls collection:
NTabStrip strip = nTabControl1.Controls[0] as NTabStrip;
Then if strip is not null you can iterate to its Tabs and check whether the CloseButton.State is pressed.
The index of the pressed NTab.CloseButton is the index of the tab page which is about to be closed:
Here is the whole source:
NTabStrip strip = nTabControl1.Controls[0] as NTabStrip;
if (strip == null)
{
return;
}
for (int i = 0; i < strip.Tabs.Count; i++)
{
if (strip.Tabs[i].CloseButton.State == InteractiveState.Pressed)
{
NTabPage page = nTabControl1.TabPages[i];
break;
}
}
Best Regards,
Nevron Support Team