private void frmChild_MouseDown(object sender, MouseEventArgs e)//鼠标点击 { int i = 0; PointF MouseP = new PointF((e.X - frmMain.iLeftD) / frmMain.iWinFoucs, (e.Y - frmMain.iTopD) / frmMain.iWinFoucs); if (e.Button == System.Windows.Forms.MouseButtons.Left) { for (i = ListTuYuan.Count - 1; i > -1; i--) { CBase obj = (CBase)ListTuYuan[i]; if (obj.ElementType == LCElementType.Ring) { if (obj.Selected(MouseP)) { CStation Sta = frmMain.staComm.GetStaByStaName("NJ301"); CProtcolFINS SPLC = (CProtcolFINS)Sta; if (SPLC.System[0] == 7) { return; } CRing nRing = (CRing)obj; string sVar = "AV" + nRing.ShowText.PadLeft(3, '0'); SPLC.SendAODO(sVar, 0, "DO"); break; } } } } }
private void frmChild_MouseMove(object sender, MouseEventArgs e)//鼠标移动 { PointF MouseP = new PointF((e.X - frmMain.iLeftD) / frmMain.iWinFoucs, (e.Y - frmMain.iTopD) / frmMain.iWinFoucs); for (int i = ListTuYuan.Count - 1; i > -1; i--) { CBase obj = (CBase)ListTuYuan[i]; if (obj.ElementType == LCElementType.Ring) { if (obj.Selected(MouseP)) { this.Cursor = Cursors.Hand; return; } } } this.Cursor = Cursors.Default; }