How to close the current SmartPart in a CAB application

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;



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".


About Gaston

This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s