private void CreateControls()
{
if (pictures[0] != null)
DisposeControls();
for (var i = 0; i < 52; i++)
{
var newPictureBox = new PictureBox();
newPictureBox.Width = 75;
newPictureBox.Height = 100;
//newPictureBox.BorderStyle = BorderStyle.Fixed3D;
pictures[i] = SizeImage(newPictureBox, i + 1);
}
}
private void DisplayControls()
{
for (var i = 51; i >= 0; i--)
{
var picture = pictures[i];
picture.Left = (i*15) + 15;
picture.Top = 50;
this.Controls.Add(picture);
}
}
所以,我有这个,但我所做的并不奏效。 更准确地说,我有2个图片框,我需要将PictureBox拖到PictureBox1 ... 我试过了:
//picture.MouseMove += (ss, ee) =>
//{
// if (ee.Button == MouseButtons.Left)
// {
// //create a temporary point
// Point temp = MousePosition;
// Point res = new Point(firstPoint.X - temp.X, firstPoint.Y - temp.Y);
// //apply value to object
// picture.Location = new Point(picture.Location.X, picture.Location.Y);
// //update first point
// firstPoint = temp;
// }
//};
但仍然无效.. 我怎么能让它发挥作用?