有问题controls.add(pic)
private void blockRoadMouseMove(System.Object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (Control.ModifierKeys == Keys.Control)
{
int yo = this.Location.Y;
int startx = this.Left;
int cx = startx;
int mo = e.X + this.Left - clickOffsetX;
DrawingControl.SuspendDrawing(mainPic);
mainPic.SuspendLayout();
blockRoad pic = new blockRoad(mainPic);
DrawingControl.SuspendDrawing(pic);
for (int t = cx; t < mo; t += 20)
{
pic.setChar(this.Image, t, yo);
}
mainPic.ResumeLayout();
DrawingControl.ResumeDrawing(mainPic);
}
}
}
我用那个
class DrawingControl
{
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
private const int WM_SETREDRAW = 11;
public static void SuspendDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, false, 0);
}
public static void ResumeDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
parent.Refresh();
}
}
问题是在一个位置添加许多(图片)下一个位置添加许多..下一个添加...
在(每个)一个位置添加许多图片我想在每个位置添加(一个)图片