Move a PictureBox with mouse

后端 未结 6 711
情话喂你
情话喂你 2021-01-03 14:15

I\'m developing an app for windows mobile (Compact Framework 2.0). It has a WinForms with a PictureBox.

I want to move the image of the PictureBox but I don\'t know

6条回答
  •  一整个雨季
    2021-01-03 15:04

    Actually what you have done is correct. But you gave the MouseMove property to the picturebox. You should give that property to the Form(background).

    ex:

    private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
      imagenMapa.Left = e.X;
      imagenMapa.Top = e.Y;
    }
    

提交回复
热议问题