VB2010 如何拖动没有标题栏的窗口?
VB2010如何拖动没有标题栏的窗口?Form中添加了一个PictureboxPicturebox的作用交换为标题栏的作用,就是按住Picturebox可以拖动窗口需要代...
VB2010 如何拖动没有标题栏的窗口?
Form中添加了一个Picturebox
Picturebox 的作用交换为标题栏的作用,就是按住Picturebox可以拖动窗口
需要代码 展开
Form中添加了一个Picturebox
Picturebox 的作用交换为标题栏的作用,就是按住Picturebox可以拖动窗口
需要代码 展开
展开全部
Public Class Form1
Dim prepoint As Point
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = MouseButtons.Left Then
prepoint = e.Location
End If
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then
Me.Top += e.Location.Y - prepoint.Y
Me.Left += e.Location.X - prepoint.X
End If
End Sub
End Class
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询