BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Point saveLocation = Point.Empty; protected override void WndProc(ref Message m) { if (saveLocation.IsEmpty || saveLocation != this.panel1.DisplayRectangle.Location) { if (!saveLocation.IsEmpty) { this.panel2.Refresh(); } saveLocation = this.panel1.DisplayRectangle.Location; } Console.WriteLine(this.panel1.DisplayRectangle); base.WndProc (ref m); }Here is this sample modified to avoid this problem. GDBG_Panel_2460.zip
Point saveLocation = Point.Empty; int setCursorCt = 0; protected override void WndProc(ref Message m) { if (saveLocation.IsEmpty || saveLocation != this.panel1.DisplayRectangle.Location) { if(m.Msg == 0x21) //mouseactivate setCursorCt = 0; if(m.Msg == 0x20) //setcursor { if(setCursorCt == int.MaxValue) setCursorCt = int.MinValue; setCursorCt++; } if (!saveLocation.IsEmpty || setCursorCt == 2) { this.panel2.Refresh(); //Console.WriteLine(this.panel1.DisplayRectangle); } saveLocation = this.panel1.DisplayRectangle.Location; } base.WndProc (ref m); }