text: Add a canvas and rectangle object to the page to show the area where the user can sign on it. Populate Page.xaml as follows:
  <Canvas x:Name="parentCanvas"
  xmlns=""
  xmlns:x=""
  Loaded="Page_Loaded"
  x:
  <Canvas x:Name="SigPad" Width="404" Height="152"
  Canvas.
  <Rectangle Width="404" Height="152" Fill="#FFF1F8DB"
  Stroke="#FF000000" StrokeThickness="3"/>
  </Canvas>
  </Canvas>
  With the user interface created, you can now write the code to capture the signature. In Page.xaml.vb, import the following namespaces:
  Imports System.Windows.Media.Color
  Imports System.Collections.Generic
  Partial Public Class Page
  Inherits Canvas
  Private MouseDown As Boolean = False
  Private _previouspoint As Point
  Private _points As List(Of Point)
  Private _lines As New List(Of Object)
  Capturing the user's signature mainly involves servicing three event handlers:
  The MouseLeftButtonDown event is fired when the user clicks the left mouse button. Here, you will interpret it as the beginning of a handwriting stroke and start to record the first point that the user has made on the canvas control.
  Listing 2 shows the code for the MouseMove event handler.
  The MouseMove event is fired continuously as the user moves the mouse. Here, you will draw a line connecting the previous point with the current point and record all the coordinates into the _points variable.
  Code the MouseLeftButtonUp event handler as follows:
  '---fired when the user let go of the left mouse button---
  Private Sub SigPad_MouseLeftButtonUp( _
  ByVal sender As Object, _
  ByVal e As System.Windows.Input.MouseEventArgs) _
  Handles SigPad.MouseLeftButtonUp
  '---user has let go of the left mouse button---
  MouseDown = False
  '---add the list of points to the current line---
  _lines.Add(_points)
  End Sub
  Press F5 to test the application. You will now be able to use your mouse to draw on the canvas (see Figure 2).
  Please enable Javascript in your browser, before you post the comment! Now Javascript is disabled.
  Your name/nickname
  Your email
  WebSite
  Subject
  (Maximum characters: 1200). You have 1200 characters left.