Maximize Button not honoring ElementVisibility.Collapse

4 posts, 0 answers
  1. Alec
    Alec avatar
    2 posts
    Member since:
    Oct 2015

    Posted 25 Nov 2015 Link to this post

    I have an application that on the main form (MainForm.cs) it is not honoring the following:

    FormElement.TitleBar.MaximizeButton.Enabled = false;
    FormElement.TitleBar.MaximizeButton.Visibility = ElementVisibility.Collapsed;

    It does honor it not being enabled, but hiding altogether is not working.

    If I edit the form properties in the Proerties Window, I can see it collapse. Running the application for the first time seems to undo this, but there is no code that explicitly sets its visibility back to ElementVisibility.Visible.

    I have other forms with in the app that have it disabled without issue.

    Help

  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 26 Nov 2015 Link to this post

    Hello Alec,

    Thank you for writing back.

    We have a code wich resets the buttons visibility depending on the MinimizeBox and MaximizeBox properties of the form. This is why you can hide the button after the form is shown:
    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);
        FormElement.TitleBar.MaximizeButton.Visibility = ElementVisibility.Collapsed;
    }

    You can use the MaximizeBox property to disable the button:
    this.MaximizeBox = false;
    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Alec
    Alec avatar
    2 posts
    Member since:
    Oct 2015

    Posted 30 Nov 2015 in reply to Dimitar Link to this post

    Dimitar,

          Thank you so much. Worked like a charm. Perhaps this should make it into the documentation for RadForm. It would save some trouble.

     Thank you for the help

  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 01 Dec 2015 Link to this post

    Hi Alec,

    Thank you for your feedback. We will consider adding this to the documentation. 

    Do not hesitate to contact us if you have other questions.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top