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