We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

No subject

Thread ID:





4766 May 29,2003 07:05 PM May 30,2003 01:58 AM Windows Forms 1
Tags: GridControl
Jorge Codina
Asked On May 29, 2003 07:05 PM

Is there a built-in mechanism for the user to close a page/tab in the TabBarSplitterControl? If not, what would be the recommended approach? I'm thinking probably a custom context menu with a close option...

Administrator [Syncfusion]
Replied On May 30, 2003 01:58 AM

There is no built in UI to remove a tabpage in the TabSolitterBarControl. You could use context menus to do it as you suggested. To avoid interferring with the controls drag & drop tab positions code, I would suggest trying to display the context menu as follows to enable the context menu to appear when your user right clicks the tab itself. Do not try setting the ContextMenu property for the TabSplitterControl. Use the steps below instead. 1) Use teh designer to add the context menu in the component tray with your menu items and click handlers. But do not set it as the ContextMenu property for any control. 2) Hook the TabSplitterControlBar.MouseUp event to explicitly display the menu tabBarSplitterControl1.Bar.MouseUp += new MouseEventHandler(tabbar_MouseUp); 3) event code to display the menu
private void tabbar_MouseUp(object sender, MouseEventArgs e)
	if(e.Button == MouseButtons.Right)
		this.contextMenu1.Show(this.tabBarSplitterControl1.Bar, new Point(e.X, e.Y));
4)Have your delete menu selection handler use code like this. You should explicitly dispose of any grid controls (If you don't, the close button on your form won't work ????).
private void menuItem1_Click(object sender, System.EventArgs e)
	foreach(Control c in this.tabBarSplitterControl1.ActivePage.Controls)
		if(c is GridControlBase)


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.