Windows Mobile - rysowanie lini

0

Witam,
Mam problem z programem. Ma on za zadanie rysować linię ( klikam myszką, przeciągam i powstaje linia:P).
Program ten działa w aplikacji na Windowsa bez zarzutów, natomiast na Windows Mobile występuje błąd:
'System.Windows.Forms.MouseEventArgs' does not contain a definition for 'Location' and no extension method 'Location' accepting a first argument of type 'System.Windows.Forms.MouseEventArgs' could be found (are you missing a using directive or an assembly reference?)

Oto kod programu:

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Paint
{
    public partial class Form1 : Form
    {
        private Graphics g;
        private Point p = Point.Empty;
        private Pen pioro;

        public Form1()
        {
            InitializeComponent();

            pole.Image = new Bitmap(400, 400);
            g = Graphics.FromImage(pole.Image);
            pioro = new Pen(Color.Blue);
        }

        private void pole_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
               p = e.Location;   <-----------------------------------// W tym miejscu jest błąd
        }

        private void pole_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                g.DrawLine(pioro, p, e.Location);
                p = e.Location;

                pole.Refresh();
            }
        }


    }
}

Moje pytanie jest takie, w jaki sposób mogę kontolować zdażenie kliknięcia w wyświetlacz tak aby ten program działał.
Z góry dzięki za pomoc

0

Zrobiłem to w inny sposób. Może się komuś przyda

        private void pole_MouseMove(object sender, MouseEventArgs e)
        {
            if (x1 == 0)
            {
                x1 = e.X;
                y1 = e.Y;
            }
            else
            {
                x1 = x2;
                y1 = y2;
            }
            x2 = e.X;
            y2 = e.Y;
            pioro.Width = 5;
            g.DrawLine(pioro, x1, y1, x2, y2);
            pole.Refresh();            
        }

        private void pole_MouseUp(object sender, MouseEventArgs e)
        {
            x1 = 0;
        }

1 użytkowników online, w tym zalogowanych: 0, gości: 1