-- 作者:飞
-- 发布时间:2012/1/30 12:21:00
--
可以实现的,代码如下
\'全局代码--------------------------------------------------------------------------------------------------------------------
Public XX,YY As Single
Public Sub Panel_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) If e.Button = Windows.Forms.MouseButtons.Left Then XX = e.X YY = e.Y End If End Sub
Public Sub Panel_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) If e.Button = Windows.Forms.MouseButtons.Left Then sender.Parent.Location = New Point(sender.Parent.Location.X - XX + e.X, sender.Parent.Location.Y - YY + e.Y) End Sub
\'窗口AfterLoad事件代码--------------------------------------------------------------------------------------------------------------------
AddHandler e.Form.Panel.MouseDown,AddressOf Panel_MouseDown AddHandler e.Form.Panel.MouseMove,AddressOf Panel_MouseMove
[此贴子已经被作者于2012-1-30 12:38:37编辑过]
|