我在面板中有一个仅用于调整的绘制栅格。在这个栅格上,用户可以建立简单的 circuritys。我添加了一些功能,以便用户可以调整连接。问题是超出的一切都被粉饰了。有没有可能做这样的事情?我添加了 2 个屏幕截图,以便更清楚我的意思:
http://www.pic-upload.de/gal-337018/f5lsv1/1.html
代码:
private void UserMovesButton(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
if (FirstFinished != 0)
{
dummy.Color = MainPanel.BackColor;
Start = connectionButtons[ActualIndex - 1].Location;
drawline();
Start = connectionButtons[ActualIndex + 1].Location;
drawline();
}
dummy.Color = Color.Black;
Control controlToMove = (Control)sender;
controlToMove.BringToFront();
controlToMove.Location = new Point(controlToMove.Location.X + e.Location.X - 10,
controlToMove.Location.Y + e.Location.Y - 10);
{
Start = connectionButtons[ActualIndex - 1].Location;
Stop.X = controlToMove.Location.X + e.Location.X - 10;
Stop.Y = controlToMove.Location.Y + e.Location.Y - 10;
FirstFinished = 1;
drawline();
Start = connectionButtons[ActualIndex + 1].Location;
drawline();
Thread.Sleep(10);
}
}
}
(Connectionbuttons 是一个包含按钮的列表)
我已经考虑过使用 z 轴,但 drawline 不支持这样的东西。