Wiki Link: [discussion:3648]
SignatureBox on tab control 

Jul 12 2010 at 6:06 PM
Edited Jul 12 2010 at 6:55 PM
My project needs to have a custom SignatureBox control on the tab control. Originally I am using the MouseMove event to drawing the signature on the SignatureBox, it was working fine. The problem is when user signed the box quickly, the application will automatically navigate to another tab page in WM 6.5 platform. Here is my MouseMove event handler.

protected void SignatureBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
stylusDrawing = true;
lastPoint.X = e.X;
lastPoint.Y = e.Y;
}
}

protected void SignatureBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
try
{
if (stylusDrawing == true)
{
gs.DrawLine(mypen, lastPoint.X, lastPoint.Y, e.X, e.Y);

lastPoint.X = e.X;
lastPoint.Y = e.Y;

if (e.X < minX)
minX = e.X;

if (e.X > maxX)
maxX = e.X;

if (e.Y < minY)
minY = e.Y;

if (e.Y > maxY)
maxY = e.Y;

Invalidate();
this._ImageChanged = true;
}
}
catch (Exception)
{
}
}
}


So I am trying to use your sample code to add Gesture handler in the SignatureBox, after I added the GestureHandler on the SignatureBox, signatureBox worked perfectly. And TabControl stop navigating to another tab page. Many thanks for your sample code.

Regards,



Updating...
Page view tracker