Remove close, maximize, minimize from mdi child

21 posts, 0 answers
  1. Ryan farquhar
    Ryan farquhar avatar
    4 posts
    Member since:
    Jul 2007

    Posted 20 Jun 2007 Link to this post

    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.

  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 21 Jun 2007 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bill Chapin
    Bill Chapin avatar
    14 posts
    Member since:
    May 2004

    Posted 21 Dec 2007 Link to this post

    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
  5. Angel
    Admin
    Angel avatar
    121 posts

    Posted 28 Dec 2007 Link to this post

    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
  6. Bill
    Bill avatar
    4 posts
    Member since:
    Oct 2008

    Posted 21 Oct 2008 Link to this post

    I tried the code for hiding the buttons and get an index out of bounds error.
  7. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 21 Oct 2008 Link to this post

    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.
  8. Bill
    Bill avatar
    4 posts
    Member since:
    Oct 2008

    Posted 21 Oct 2008 Link to this post

    Version Q4 2006 Downloaded from the 2008 Express Registration Benifits page.
  9. Nick
    Admin
    Nick avatar
    767 posts

    Posted 27 Oct 2008 Link to this post

    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.
  10. Daniel
    Daniel avatar
    15 posts
    Member since:
    Jun 2009

    Posted 12 Nov 2009 Link to this post

    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?
  11. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 12 Nov 2009 Link to this post

    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.
  12. Daniel
    Daniel avatar
    15 posts
    Member since:
    Jun 2009

    Posted 13 Nov 2009 Link to this post

    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:
  13. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 18 Nov 2009 Link to this post

    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.
  14. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 30 Nov 2009 Link to this post

    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.
  15. simon nomis
    simon nomis avatar
    2 posts
    Member since:
    Nov 2009

    Posted 30 Nov 2009 Link to this post

    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
  16. Lidiya
    Admin
    Lidiya avatar
    37 posts

    Posted 01 Dec 2009 Link to this post

    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.
  17. subbarayan
    subbarayan avatar
    20 posts
    Member since:
    Oct 2008

    Posted 27 Aug 2011 Link to this post

    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. 
  18. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 31 Aug 2011 Link to this post

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

  19. ManjunathX
    ManjunathX avatar
    2 posts
    Member since:
    Sep 2016

    Posted 13 Oct in reply to Peter Link to this post

    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

  20. ManjunathX
    ManjunathX avatar
    2 posts
    Member since:
    Sep 2016

    Posted 13 Oct in reply to Peter Link to this post

    PFA
  21. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 14 Oct Link to this post

    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 appears. 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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready