This is a migrated thread and some comments may be shown as answers.

Remove close, maximize, minimize from mdi child

20 Answers 1204 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Ryan farquhar
Top achievements
Rank 1
Ryan farquhar asked on 21 Jun 2007, 04:07 AM
Okay quick question. I know I can remove the Maximize, Minimize, and Close button from the top of the Ribbonbar, but how do I remove the one that appears when opening an MDI Child object?

So what happens is that I am using the Ribbonbar on the MDI Parent. When I open a MDI Child I don't want to display the Maximize, Minimize, Close button for it.

I have also tried to do this via the child object using me.minimizebox = false but it still shows up. What is weird is once I use the maximize button on the child form the buttons get removed.

Any help would be appreciated. Oh by the way I am using the shaped form so I don't see any standard window borders.

20 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 Jun 2007, 12:10 PM
Hello Alicia,

Thank you for the question.

Please clarify which button you want to hide exactly.

If you want to hide MDI maximize, MDI minimize and MDI close from RadRibbonBar, you can do so with the following workaround:

'hide close button  
radRibbonBar1.RootElement.Children( 0 ).Children( 1 ).Children( 0 ).Children( 7 ).Children( 0 ).Children( 0 ).Visibility = Telerik.WinControls.ElementVisibility.Collapsed  
'hide minimize button  
radRibbonBar1.RootElement.Children( 0 ).Children( 1 ).Children( 0 ).Children( 7 ).Children( 0 ).Children( 1 ).Visibility = Telerik.WinControls.ElementVisibility.Collapsed 
'hide maximize button  
radRibbonBar1.RootElement.Children( 0 ).Children( 1 ).Children( 0 ).Children( 7 ).Children( 0 ).Children( 2 ).Visibility = Telerik.WinControls.ElementVisibility.Collapsed  
 
 
 
We are not suggesting to use RibbonBar and MDI form, because the Ribbon UI does not support MDI menu merge.
The restriction comes from Microsoft's concepts for Ribbon UI usage - they render MDI style applications as "not preferable" starting from MS Office 2003 (which is SDI). Also the Ribbon UI is not designed to support Menu Merge operations. 
 

About ShapedForm border:
You should be able to specify Form Padding, Form Shape, BorderWidth, BackColor and BorderColor:
 

dim padding as new Padding(3)
dim shape as new RoundRectShape( 1 ) 'Telerik.WinControls namespace 
 
me.Padding = padding  
me.Shape = shape            
me.BorderWidth = 2 
me.BackColor = SystemColors.AppWorkspace 
me.BorderColor = SystemColors.AppWorkspace 
 



All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bill Chapin
Top achievements
Rank 1
answered on 21 Dec 2007, 10:54 PM
I am trying to set the shape of a form using your suggestions but am unable to access:

me.Shape
me.BorderWidth
me.BorderColor

Is there something I am missing?

Using RADControls for Winforms Q4 2006
0
Angel
Telerik team
answered on 28 Dec 2007, 09:58 AM

Hello Bill Chapin,

Thank you for writing.

The Shape, BorderWidth and BorderColor properties are members of the ShapedForm class.

Most probably, your code would look like the codeblock below (where shapedForm is the instance of the ShapedForm class):

Dim padding as new Padding(3)  
Dim shape as new RoundRectShape( 1 ) 'Telerik.WinControls namespace    
    
shapedForm.Padding = padding     
shapedForm.Shape = shape
shapedForm.BorderWidth = 2    
shapedForm.BackColor = SystemColors.AppWorkspace    
shapedForm.BorderColor = SystemColors.AppWorkspace 

I checked our Q4 2006 release, and verified that the Shape, BorderWidth and BorderColor properties exist as members of the ShapedForm class.

If you have any additional questions, please contact us.

Sincerely yours,

Angel
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Bill
Top achievements
Rank 1
answered on 21 Oct 2008, 01:39 PM
I tried the code for hiding the buttons and get an index out of bounds error.
0
Vassil Petev
Telerik team
answered on 21 Oct 2008, 03:28 PM
Hello Bill,

This thread is 10 months old and relates to an older version of the ribbonbar. Please, share which version you are using, so that we can help you.


Regards,
Vassil
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bill
Top achievements
Rank 1
answered on 21 Oct 2008, 03:33 PM
Version Q4 2006 Downloaded from the 2008 Express Registration Benifits page.
0
Nick
Telerik team
answered on 27 Oct 2008, 01:31 PM
Hi Bill,

Please update to our latest release. We will help you in the process if you have any questions.

Greetings,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Daniel
Top achievements
Rank 1
answered on 12 Nov 2009, 11:07 AM
Hi,

i want to remove the close, maximize, minimize from mdi child in the ribbonbar.

My Telerik Version is the "RadControls_WinForms_2009_2_729_dev" and your Code want worke for me.

How can i hide the Buttons?
0
Deyan
Telerik team
answered on 12 Nov 2009, 05:13 PM
Hello Daniel.

We will be happy to address this question for you. Before doing this, however, please emails us (at clientservice *at* telerik *dot* com) a proof of your purchase (i.e. name and email address of the person who has purchased our tools), because we did not see one under your account, nor under your company's name. As soon as we get this information, we will add you as a licnese developer to the purchase, which will give you faster response times and full access to our support ticketing system.

Thanks in advance.

Now back on your question. You can easily hide the system buttons of a RadForm (MDI forms included) by setting the ControlBox property to false:

public Form1()
{
InitializeComponent();
this.IsMdiContainer = true;
}
  
private void OnAddChildBtn_Click(object sender, EventArgs e)
{
RadForm form = new RadForm();
form.MdiParent = this;
form.ControlBox = false;
form.Show();
}

The code snippet above demonstrates how the system buttons of a MDI child form can be removed when it is put in a Mdi Container.

I hope this is helpful.

We also look forward to receiving the details requested.

Regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Daniel
Top achievements
Rank 1
answered on 13 Nov 2009, 08:38 AM
Hello,

this Code won't work for me.

I use only ShapedForms for MDI Container and Child.

child.MdiParent = MDIparent; 
child.WindowState = FormWindowState.Maximized; 
child.ControlBox = false;                     
child.Show(); 

I have still no license of Telerik Winform. Momentarily I use the demo of Telerik Winform.

Screenshot:
0
Deyan
Telerik team
answered on 18 Nov 2009, 08:12 AM
Hi Daniel,

I guess that since you use ShapedForm, you also have a RadTitleBar control in it. In order to hide the system buttons of the RadTitleBar control, you should use the following code:

this.radTitleBar1.TitleBarElement.MinimizeButton.Visibility = ElementVisibility.Collapsed;
this.radTitleBar1.TitleBarElement.MaximizeButton.Visibility = ElementVisibility.Collapsed;
this.radTitleBar1.TitleBarElement.CloseButton.Visibility = ElementVisibility.Collapsed;

I hope this is helpful.

Greetings,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
simon nomis
Top achievements
Rank 1
answered on 28 Nov 2009, 09:01 PM
0
Deyan
Telerik team
answered on 30 Nov 2009, 03:46 PM
Hi Simon,

I presume you have downloaded our RadRibbonBar component via the Visual Studio Express Edition Benefit program. In fact, this version of the control is very old. Many improvements have been introduced over the time and therefore my suggestion is to download a trial version of our latest release: Q3 2009 and see what we have to offer now.

There is also another possibility for you to get a free version of our Q2 2009 release if you are a MSDN subscriber. You can log on in your MSDN account and check out the Special Offers section.

As to the question at hand, a possible solution would be to simply set the Visibility property of each button to Collapsed:

this.radRibbonBar1.RibbonBarElement.MDIbutton.CloseButton.Visibility = ElementVisibility.Collapsed;
this.radRibbonBar1.RibbonBarElement.MDIbutton.MinimizeButton.Visibility = ElementVisibility.Collapsed; this.radRibbonBar1.RibbonBarElement.MDIbutton.MaximizeButton.Visibility = ElementVisibility.Collapsed;

Please note that this solution is relevant to the latest Q3 2009 release of RadControls for WinForms.

I hope this is helpful.

Kind regards,

Deyan
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
simon nomis
Top achievements
Rank 1
answered on 30 Nov 2009, 10:39 PM
Could you please post the link on msdn that allows me to download the new radribbon as I have searched and searched and can not find it. Or post a solution for the version I have because the solution you have given me does not seem to work for my version.
Thanks.
Simon
0
Lidiya
Telerik team
answered on 01 Dec 2009, 09:42 AM
Hi Simon Nomis,

In order to take advantage of the special offering, you need to be an active MSDN Subscription holder. Active MSDN Subscription holders are people who have purchased or renewed within the last 12 months their MSDN Subscription. More details on the available MSDN Subscriptions is provided at:
https://msdn.microsoft.com/en-us/subscriptions/securedownloads/bb841434.aspx

MSDN Subscribers can take advantage of special offers made by Microsoft or other companies by accessing the Special Offers section of their account after LogIn.

If you are not an MSDN Subscriber, you can learn more about subscriber benefits, compare subscription options, or take the tour.

Let us know if we can assist you further.

Kind regards,
Lidiya
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
subbarayan
Top achievements
Rank 1
answered on 27 Aug 2011, 01:14 PM
Hi

   I have a problem when i am using the rad menu on MDI form.  The close, maximize, minimize  from mdi child's controls are visible at top right side of the radmenu.  I done the controlBox property set to false on mdichild form. But no use.
help me. 
0
Peter
Telerik team
answered on 31 Aug 2011, 06:32 PM
Hello Subbarayan,

Thank you for writing.

You should set Parent Menu's MinimizeButton, MaximizeButton and CloseButton visibility to collapsed, for example:

this.radMenu1.MenuElement.MinimizeButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
this.radMenu1.MenuElement.MaximizeButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
this.radMenu1.MenuElement.CloseButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;

Please note that we are still expecting an answer from you on the licensing questions asked in your thread "Master details in report". This answer will allow us to continue supporting your enquries.
 
I hope this helps.

Kind regards,
Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
ManjunathX
Top achievements
Rank 1
answered on 13 Oct 2016, 11:56 AM

Hi Peter,

I am using MDI form and a RadRibbonBar. I am able to hide the Maximize, Minimize, and Close button from the top of the Ribbonbar but i need to merge the layer on which those buttons were present.

PFA screenshot for your reference(highlighted one)

 

Regards,

Manjunath

0
ManjunathX
Top achievements
Rank 1
answered on 14 Oct 2016, 04:47 AM
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Oct 2016, 10:22 AM
Hello Manjunath,

Thank you for writing.  

According to the provided information, I am not sure whether the MDI child form is a RadRibbonForm or a RadForm with RadRibbonFormBehavior. In order to hide the system buttons on the ribbon's caption when the form is maximized, you can set the RadRibbonForm.AllowAero to false. However, the title bar's system buttons . After some research, it seems to be a tricky question. Please refer to the following thread: https://social.msdn.microsoft.com/Forums/windows/en-US/9b7787cf-5e29-4e38-bc19-91c3220e9422/mdi-maximized-children-forms-without-controlbox?forum=winforms

That is why I have prepared the following code snippet which result is illustrated in the attached gif file:
 
public partial class RadRibbonForm1 : Telerik.WinControls.UI.RadRibbonForm
{
    public RadRibbonForm1()
    {
        InitializeComponent();
        new RadControlSpyForm().Show();
 
        this.AllowAero = false;
        this.SizeChanged += RadRibbonForm1_SizeChanged;
    }
 
    private void RadRibbonForm1_SizeChanged(object sender, EventArgs e)
    {
        if (this.WindowState == FormWindowState.Maximized)
        {
            this.WindowState = FormWindowState.Normal;
            this.Dock = DockStyle.Fill;
            this.RibbonBar.RibbonBarElement.RibbonCaption.Visibility = ElementVisibility.Collapsed;
        }
    }
}

public partial class Form1 : RadForm
{
    public Form1()
    {
        InitializeComponent();
        this.IsMdiContainer = true;
        ThemeResolutionService.ApplicationThemeName = "Office2013Light";
    }
 
    private void radButton1_Click(object sender, EventArgs e)
    {
        RadRibbonForm1 form = new RadRibbonForm1();
        form.Text = "MDI Child 1";
        form.MdiParent = this;
        form.Show();
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
RibbonBar
Asked by
Ryan farquhar
Top achievements
Rank 1
Answers by
Peter
Telerik team
Bill Chapin
Top achievements
Rank 1
Angel
Telerik team
Bill
Top achievements
Rank 1
Vassil Petev
Telerik team
Nick
Telerik team
Daniel
Top achievements
Rank 1
Deyan
Telerik team
simon nomis
Top achievements
Rank 1
Lidiya
Telerik team
subbarayan
Top achievements
Rank 1
ManjunathX
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or