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

Maximize Button not honoring ElementVisibility.Collapse

3 Answers 76 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Alec
Top achievements
Rank 1
Alec asked on 25 Nov 2015, 02:33 PM

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

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 26 Nov 2015, 10:27 AM
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
0
Alec
Top achievements
Rank 1
answered on 30 Nov 2015, 02:26 PM

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

0
Dimitar
Telerik team
answered on 01 Dec 2015, 12:47 PM
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
Tags
TitleBar
Asked by
Alec
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Alec
Top achievements
Rank 1
Share this question
or