using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Microsoft.Ink;
namespace DumbPictureBox
{
public class Form1 : System.Windows.Forms.Form
{
private Microsoft.Ink.InkPicture myInkPicture;
private System.Windows.Forms.Button button_toInk;
private System.Windows.Forms.Button button_toSelect;
private System.ComponentModel.Container components = null;
Graphics g;
public Form1()
{
InitializeComponent();
g=myInkPicture.CreateGraphics();
myInkPicture.DefaultDrawingAttributes.Color=Color. Black;
myInkPicture.DefaultDrawingAttributes.Width=10;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Código generado por el Diseñador de Windows Forms
private void InitializeComponent()
{
this.myInkPicture = new Microsoft.Ink.InkPicture();
this.button_toInk = new System.Windows.Forms.Button();
this.button_toSelect = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// myInkPicture
//
this.myInkPicture.BackColor =
System.Drawing.SystemColors.ControlLightLight;
this.myInkPicture.Location = new System.Drawing.Point(16, 80);
this.myInkPicture.MarginX = -2147483648;
this.myInkPicture.MarginY = -2147483648;
this.myInkPicture.Name = "myInkPicture";
this.myInkPicture.Size = new System.Drawing.Size(256, 160);
this.myInkPicture.TabIndex = 0;
this.myInkPicture.Paint += new
System.Windows.Forms.PaintEventHandler(this.myInkP icture_Paint);
//
// button_toInk
//
this.button_toInk.Location = new System.Drawing.Point(32, 32);
this.button_toInk.Name = "button_toInk";
this.button_toInk.TabIndex = 1;
this.button_toInk.Text = "To Ink";
this.button_toInk.Click += new System.EventHandler(this.button1_Click);
//
// button_toSelect
//
this.button_toSelect.Location = new System.Drawing.Point(128, 32);
this.button_toSelect.Name = "button_toSelect";
this.button_toSelect.TabIndex = 2;
this.button_toSelect.Text = "To Select";
this.button_toSelect.Click += new System.EventHandler(this.button2_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button_toSelect);
this.Controls.Add(this.button_toInk);
this.Controls.Add(this.myInkPicture);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
myInkPicture.EditingMode=InkOverlayEditingMode.Ink ;
}
private void button2_Click(object sender, System.EventArgs e)
{
myInkPicture.EditingMode=InkOverlayEditingMode.Sel ect;
}
private void myInkPicture_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
}
}
}
Thx