System.Windows.Forms.MdiClient.SetWindowState C# (CSharp) Method

SetWindowState() private method

private SetWindowState ( Form form, FormWindowState old_window_state, FormWindowState new_window_state, bool is_activating_child ) : void
form Form
old_window_state FormWindowState
new_window_state FormWindowState
is_activating_child bool
return void
		internal void SetWindowState (Form form, FormWindowState old_window_state, FormWindowState new_window_state, bool is_activating_child)
		{
			bool mdiclient_layout;

			MdiWindowManager wm = (MdiWindowManager) form.window_manager;

			if (!is_activating_child && new_window_state == FormWindowState.Maximized && !wm.IsActive) {
				ActivateChild (form);
				return;
			}
				
			if (old_window_state == FormWindowState.Normal)
				wm.NormalBounds = form.Bounds;

			if (SetWindowStates (wm))
				return;

			if (old_window_state == new_window_state)
				return;

			mdiclient_layout = old_window_state == FormWindowState.Maximized || new_window_state == FormWindowState.Maximized;

			switch (new_window_state) {
			case FormWindowState.Minimized:
				ArrangeIconicWindows (false);
				break;
			case FormWindowState.Maximized:
				form.Bounds = wm.MaximizedBounds;
				break;
			case FormWindowState.Normal:
				form.Bounds = wm.NormalBounds;
				break;
			}

			wm.UpdateWindowDecorations (new_window_state);

			form.ResetCursor ();

			if (mdiclient_layout)
				Parent.PerformLayout ();

			XplatUI.RequestNCRecalc (Parent.Handle);
			XplatUI.RequestNCRecalc (form.Handle);
			if (!setting_windowstates)
				SizeScrollBars ();
		}
		internal int ChildrenCreated {

Usage Example

Example #1
0
 public override void SetWindowState(FormWindowState old_state, FormWindowState window_state)
 {
     mdi_container.SetWindowState(form, old_state, window_state, false);
 }