下面给出在panel1上进行鼠标单击的处理程序:
- private void panel1_MouseClick(object sender, MouseEventArgs e) {
- int X = e.X; int Y = e.Y;
- if (this.__gObjType== "") {
- return; }
- if (this.__gObjType != "Line") {
- AddObjectFromMouseLocation(X, Y, 0, 0, this.__gObjType); }
- else {
- //line if (__lineMouseClickedCount == 1)
- { __lineX2 = e.X;
- __lineY2 = e.Y; AddObjectFromMouseLocation(__lineX1, __lineY1, __lineX2, __lineY2, this.__gObjType);
- //连接线方向判断
- __lineMouseClickedCount = 0; __lineX1 = 0;
- __lineY1 = 0; __lineX2 = 0;
- __lineY2 = 0; }
- else if (__lineMouseClickedCount == 0) {










