我有一个小代码,可以在运行时移动控件:
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2
Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left = True Then
Button1.Capture = False
Dim msg As Message = _
Message.Create(Button1.Handle, WM_NCLBUTTONDOWN, _
New IntPtr(HTCAPTION), IntPtr.Zero)
Me.DefWndProc(msg)
End If
End Sub
我需要在按钮移动后保存按钮的新位置并加载它。我想为此使用 My.Settings,但我不知道应该存储什么值。