private void filmLabel_MouseUp(object sender, MouseEventArgs e) { if (isMouseDown == true && e.Button == System.Windows.Forms.MouseButtons.Left) { ColorBorderLabel label = sender as ColorBorderLabel; // 计算放映计划时间表的屏幕坐标 int x = spPanShowPlan.Location.X + scSplit.Location.X + scSplit.SplitterDistance + scSplit.SplitterWidth; int y = spPanShowPlan.Location.Y + panShowPlanContainer.Location.Y + scSplit.Location.Y; // 计算放映计划时间表的控件区域(屏幕坐标) Rectangle showPlanRectangle = new Rectangle(x, y, spPanShowPlan.Width, spPanShowPlan.Height); if (showPlanRectangle.Contains(tempLabel.Location) == true) { spPanShowPlan.Controls.Add(tempLabel); } else { ShowPlan showPlan = tempLabel.Tag as ShowPlan; dataManager.RemoveTempData(showPlan); this.Controls.Remove(tempLabel); tempLabel.IsEnableTimeLabel = false; tempLabel.Dispose(); } isMouseDown = false; } }