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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TabbedMdi "Create New Horizontal Group" for each open tab

Thread ID:

Created:

Updated:

Platform:

Replies:

63672 Jul 6,2007 06:10 PM UTC Jul 16,2007 02:46 PM UTC WinForms 1
loading
Tags: Tools
Alan Read
Asked On July 6, 2007 06:10 PM UTC

What is the best way to programmatically go through all open tabs and create a new horizontal group?

I tried the code below:
foreach(Form form in this.tabbedMDIManager.MdiChildren)
{
form.Activate(); if(this.tabbedMDIManager.CanCreateNewHorizontalGroup())
{ this.tabbedMDIManager.CreateNewHorizontalGroup();
}
}

It works but it has a horrible repainting issue where as if I go to each tab and use the right click menu "Create New Horizontal Tab Group" everything is fine. So is their anyway to access the right click context menu of a tab programtically?

Thanks

I am using v5.1 trial of essential tools

Rashidha F [Syncfusion]
Replied On July 16, 2007 02:46 PM UTC

Hi Alan,

My apologies for the delay in responding to you.

If your intention is to create a HorizontalGroup without using ContextMenu means, please use the following code snippet in button_click Event.

Form childform = new Form();
childform.WindowState = FormWindowState.Normal;
childform.Text = "MDI Child Form " + count.ToString();
childform.MdiParent = this;
childform.Show();
this.tabbedMdiManager.CreateNewHorizontalGroup();

Using Beforpopup Event and clear method you can disable and clear the contextmenu respectively.

void ContextMenuItem_BeforePopup(object sender, CancelEventArgs e)
{
e.Cancel = true;
}
this.tabbedMdiManager.ContextMenuItem.Items.Clear();

You can add the new item in context menu using Add() Method in tabbedMDIManager. The following code snippet which illustrate how to add a neww context menu item in tab.

BarItem x = new BarItem();
x.Text = "New";
this.tabbedMdiManager.ContextMenuItem.Items.Add(x);
x.PerformClick();
x.Click += new EventHandler(x_Click);

Pleasse refer the attached sample.

http://websamples.syncfusion.com/samples/Tools.Windows/F63672/main.htm

The above sample which illustrates how to create horizontalgroupbar and how to customize the tab using contextmenu programatically.

Thanks and Regards,
Rashidha.

CONFIRMATION

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.

Warning Icon 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.Close Icon

;