I have this SCSF (CAB) application in which I want to close the current tab (TabbedWorkspace) programmatically when the user closes it. So I took these steps:
1. In the Shellform add a context menu with one element: "Close"
2. Then add a menu handler :
private void closeToolStripMenuItem1_Click(object sender, EventArgs e)
{
object obj = _leftWorkspace.ActiveSmartPart;
_leftWorkspace.Close(obj);
}
Now users can close any smartpart by right clicking the tab page and selecting Close. It is easy to add other functionality to the context menu now, like "Close All but This".