Hide MDIButton of RadRibbonBar in RadRibbonForm

7 posts, 1 answers
  1. Ian
    Ian avatar
    22 posts
    Member since:
    Nov 2010

    Posted 06 Feb 2012 Link to this post

    Hi,

    I need to hide the MDIButtons (Minimize, Restore/Maximize, Close buttons) of RadRibbonBar in RadRibbonForm. I tried using this code (radRibbonBar1.RibbonBarElement.MDIbutton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;) but it always shows whenever I resize or maximize the form or show another child form. I attached a screen shot.

    Many thanks,

    Ian

    Edit: I'm using version 2011.1.11.315
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 06 Feb 2012 Link to this post

    Helo Ian,

    In this way, the RadRibbonBar is just like a form. You can hide these buttons in the following way
    Hope that helps
    Richard
    this.radRibbonBar1.MinimizeButton = false;
    this.radRibbonBar1.MaximizeButton = false;
    this.radRibbonBar1.CloseButton = false;
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ian
    Ian avatar
    22 posts
    Member since:
    Nov 2010

    Posted 06 Feb 2012 Link to this post

    Hi Richard,

    Thank you for your reply. The code you suggest hides the upper buttons. I want the upper buttons to be shown and the lower, hidden. I attached another screen shot. I hope I'm a bit clearer this time.

    Many Thanks,

    Ian
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Feb 2012 Link to this post

    Hello Ian,

    By default, when youy create a RadRibbonForm and create a tab on this form, there are only one set of minimize, close and maxmize buttons showing.

    Please could you post some sample code (using the code formatting tools) to show how you are creating your form with these two sets of buttons.
    Apologies for the confusion
    Richard
  6. Ian
    Ian avatar
    22 posts
    Member since:
    Nov 2010

    Posted 07 Feb 2012 Link to this post

    Hi Richard,

    Here, is my code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
     
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Telerik.WinControls.UI.RadRibbonForm
        {
            public Form1()
            {
                InitializeComponent();
            }
     
            private void Form1_Load(object sender, EventArgs e)
            {
               
                var frm = new Form2();
                frm.MdiParent = this;
                frm.Dock = DockStyle.Fill;
                frm.WindowState = FormWindowState.Maximized;
                frm.Show();
            }
             
        }
    }

    Many thanks,

    Ian
  7. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Feb 2012 Link to this post

    Hello Ian,

    You can get rid of the buttons in the following way.
    Hope that helps. Please remember to mark as answer if this does answer your question
    Richard
    //min
    this.radRibbonBar1.RibbonBarElement.Children[4].Children[0].Children[0].Visibility = ElementVisibility.Collapsed;
    //max
    this.radRibbonBar1.RibbonBarElement.Children[4].Children[0].Children[1].Visibility = ElementVisibility.Collapsed;
    //close
    this.radRibbonBar1.RibbonBarElement.Children[4].Children[0].Children[2].Visibility = ElementVisibility.Collapsed;
  8. Ian
    Ian avatar
    22 posts
    Member since:
    Nov 2010

    Posted 08 Feb 2012 Link to this post

    Thanks Richard :-)
Back to Top
UI for WinForms is Visual Studio 2017 Ready