How to change the maximized button image in TitleBar when the application is in resize mode.

1 Answer 315 Views
TitleBar
Sanoop
Top achievements
Rank 1
Sanoop asked on 27 Oct 2021, 10:25 AM

I am using using TitleBar on windows form which is having minimize, maximize and close buttons but while I click on the maximize button the button image needs to be changed, attaching the the title bar maximize button image refer image TitleBarMaximize.PNG

I want to change the maximize button images

1. When the window is in maximized state show like in the image ExcelMaximized.PNG and

2. When the window is in resize state show like  in the image ExcelResize.PNG

Currently the application is showing having only one button image as like in TitleBarMaximize.PNG in both resize state and maximized state.

How do I change the button image in title bar according to the above. 

Any Immediate help will be much appreciated. 

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Oct 2021, 01:10 PM

Hello, Sanoop,

Please have in mind that usually RadTitleBar is used in combination with our ShapedForm. Indeed, no matter if the form is in Maximized or Normal state, the RadTitleBar control always shows the same image for the maximize button. It is necessary to synchronize the system buttons according to the current WindowState.

The following code snippet demonstrates a sample approach how to do it and adjust the images accordingly:

        public ShapedForm1()
        {
            InitializeComponent();
            this.SizeChanged += ShapedForm1_SizeChanged;

        }

        private void ShapedForm1_SizeChanged(object sender, EventArgs e)
        {
            this.radTitleBar1.TitleBarElement.CloseButton.SetValue(RadFormElement.FormWindowStateProperty, this.WindowState);
            this.radTitleBar1.TitleBarElement.MinimizeButton.SetValue(RadFormElement.FormWindowStateProperty, this.WindowState);
            this.radTitleBar1.TitleBarElement.MaximizeButton.SetValue(RadFormElement.FormWindowStateProperty, this.WindowState);
        }

Normal:

Maximized:

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Sanoop
Top achievements
Rank 1
commented on 02 Nov 2021, 11:06 AM

Thank You Very much Dess, This looks good.
Tags
TitleBar
Asked by
Sanoop
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or