using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms;
namespace CCD { public partial class UserControl1 : UserControl { public int ST_X, ST_Y, ED_X, ED_Y; public Point loc; private bool Clicked = false;
public UserControl1() { InitializeComponent(); // this.Click += new System.EventHandler(this.myEven); }
private void myEven(object sender, System.EventArgs e) { /* if (!Clicked) { Clicked = true; ST_X = this.Location.X; ST_Y = this.Location.Y; } else { ED_X = this.Location.X; ED_Y = this.Location.Y; Clicked = false; }*/
loc.X = this.Location.X; loc.Y = this.Location.Y; }
private void DrawLine(int sx, int sy, int ex, int ey) { Graphics G = this.CreateGraphics(); Pen P = new Pen(Color.Red, 1); Point p1 = new Point(sx, sy); Point p2 = new Point(ex, ey); G.DrawLine(P, p1, p2); P.Dispose(); }
private void hotspot1_MouseHover(object sender, EventArgs e) { hotspot1.BorderStyle = BorderStyle.FixedSingle; }
private void hotspot1_MouseLeave(object sender, EventArgs e) { hotspot1.BorderStyle = BorderStyle.None; }
private void hotspot1_Click(object sender, EventArgs e) { }
private void UserControl1_Click(object sender, EventArgs e) { // this.myEven(sender, e); Form3 F = new Form3(); F.LINEPOINTS(sender,e); } } }
|