各位老师,我在窗口的图上框中,代码是参考这样:
全局代码
Public Sub pictureBox1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim PictureBox1 = sender
If e.Delta > 0 Then
PictureBox1.Width += 50
PictureBox1.Height += 50
PictureBox1.Top -= e.Y / PictureBox1.Height * 50
PictureBox1.Left -= e.X / PictureBox1.Width * 50
Else
PictureBox1.Width -= 50
PictureBox1.Height -= 50
PictureBox1.Top += e.Y / PictureBox1.Height * 50
PictureBox1.Left += e.X / PictureBox1.Width * 50
End If
End Sub
窗口放一个图片框,afterload事件
Dim PictureBox1 As System.Windows.Forms.panel = e.Form.Controls("PictureBox1").basecontrol
AddHandler PictureBox1.MouseWheel, AddressOf pictureBox1_MouseWheel
图片框MouseEnter事件
e.sender.Select()
想请问一下,如何将图片局部放大或者用鼠标简单移动一下位置的呢,请各位老师指导一下,谢谢!