Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 3

Changing Icon based on the window state

Hi all, I have created a custom toolbar for my app and I want the maximize button icon to change to un-maximize when the app is maximized.
I tried toggling between the icons when the maximize button is pressed and that works except it only works if the app is maximized using the maximize button. If the app is maximized by dragging it to the top of the screen or by using hotkeys it doesn't work.
I also tried using a while loop to constantly check for the window state to change the icon accordingly but that just breaks the whole app.
So what is the proper way to check for the window state and how should I implement it?

2 Replies
Commander Lvl 2
Message 2 of 3

Re: Changing Icon based on the window state

Hi @JainJude,

 

Welcome to the Github Community Forum!


We are missing some infos to help you. For app what do you mean? Ios, android, web app or desktop app? What language are you use or what framework/library. You can also paste some part of the code to help us understand the problem. I can give you some hints for java, python or even typescript, but if I don't know what you are use so all the suggestion can be all useless.

 

-Gabriele-

 

Mark helpfull posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great contents!

Commander Lvl 2
Message 3 of 3

Re: Changing Icon based on the window state

In traditional Win32 programming, the WM_SIZE message includes maximize/minimize states etc. In WinForms, this is the OnSize handler.

 

 

Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!