MDIApplication.ChildForm.OnNotifyMessage C# (CSharp) Method

OnNotifyMessage() protected method

protected OnNotifyMessage ( System m ) : void
m System
return void
		protected override void OnNotifyMessage(System.Windows.Forms.Message m)
		{
			/*This method of suppressing resize drawing works by examining the windows messages 
			sent to the form. When a form starts resizing, windows sends the WM_ENTERSIZEMOVE 
			Windows(message). At this point we suppress drawing to the MapControl and 
			PageLayoutControl and draw using a "stretchy bitmap". When windows sends the 
			WM_EXITSIZEMOVE the form is released from resizing and we resume with a full 
			redraw at the new extent.

			Note in DotNet forms we can not simply use the second parameter in a Form_Load 
			event to automatically detect when a form is resized as follows:
			AxPageLayoutControl1.SuppressResizeDrawing(False, Me.Handle.ToInt32)
			This results in a System.NullException when the form closes (after layers have been 
			loaded). This is a limitation caused by .Net's particular implementation of its 
			windows message pump which conflicts with "windows subclassing" used to watch the
			forms window.*/

			base.OnNotifyMessage (m);
      
			if (m.Msg == WM_ENTERSIZEMOVE)
			{
				axMapControl1.SuppressResizeDrawing(true, 0);
			}
			else if (m.Msg == WM_EXITSIZEMOVE)
			{
				axMapControl1.SuppressResizeDrawing(false, 0);
			}
		}