Hello there,
I hope you all are doing well. I have an inquiry regarding windows forms in C# and I hope I could get an answer.
I have an application that consists of 4 window forms, I want to give it an order that when I maximize one form, all others automatically would get maximized upon opening (unlike the issue I am facing right now as when I get to a window form I have to click that maximize button for each one separately).
I know I can set the "Window State" property to maximized for all forms but that's not what I want. I want all forms to follow the current state of the current form, whether maximized or not.
I hope I explained the issue as simple as I could.
Thanks in advance.
Loading

Ahmed YasserPosted Mar 24, 2023, 2:50 PM
First of all,
Thanks so much for your time. I truly appreciate it.
Here is what I did, I followed your instructions and I applied the code for each form but unfortunately, the problem wasn't solved yet. So, are there any properties i need to change or set up in order for this code to work properly?
With Regards.
Naimish MakwanaPosted Mar 24, 2023, 3:44 AM
You can use the Form.ResizeEnd event to handle this scenario.
n each of the forms, add an event handler for the ResizeEnd event. You can do this by selecting the form in the designer, going to the Properties window, and clicking the lightning bolt icon to show the events. Then, double-click the ResizeEnd event to generate the event handler method.
In the event handler method, check if the form is maximized using the FormWindowState enumeration. If it is maximized, iterate through all the other forms in your application and set their WindowState property to FormWindowState.Maximized as well.
Sample code:
Thanks
Naimish Makwana