There are many subforms under the MDI parent form. The subform opens with the Formwindowstate.maximized property open, but the result is partly wishful and partly odd.
Paste the code for the single instance first:
Statictestform _singleton; Public Static voidShowsingleton (formwindowstate windowState = formwindowstate.maximized, Form parent =NULL) { if(_singleton = =NULL||_singleton.isdisposed) _singleton=Newproductsetting (count); if(Parent! =NULL)//set the parent window, and assign a value to the agent{_singleton.mdiparent=parent; } if(_singleton.windowstate! = WindowState) _singleton.windowstate =windowState; if(Setting.setfrontwindow! =NULL&&_singleton.ishandlecreated) Setting.setfrontwindow (_singleton.handle); _singleton.show (); }
So, the call to Testform.showsingleton can show a single instance of the window.
But the same single-instance implementation logic, several Windows maximize the effect is not the same, part is really maximized, the other part of the child window is the size of the initialization, although the minimized and close button is normal.
Compare the rest of the code in several windows, find the Problem window in the window design interface, set the formwindowstate.maximized
The normally displayed window here is the default normal value.
After you restore the window's maximized to normal, the problem is resolved.
It can only be guessed that the property value of WindowState will trigger the recalculation of the window size when it is modified, and the correct result can be obtained by modifying this value when needed.
The crux of the problem is the pit dad. Pay more attention to it later.
Formwindowstate.maximized's Trap