Hi folks,
I'm very new to VB, I'm trying to move up from VBA.
My problem is this, I have found some code that allows me to move some
textboxes on a form at runtime:
_____________________________CODE
START:_____________________________________
Public Class Form1
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2
Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left And
(Control.ModifierKeys And Keys.Shift) = Keys.Shift Then
TextBox1.Capture = False
Dim msg As Message = _
Message.Create(TextBox1.Handle, WM_NCLBUTTONDOWN, _
New IntPtr(HTCAPTION), IntPtr.Zero)
Me.DefWndProc(msg)
End If
TextBox1.Top = TextBox1.Top
End Sub
_______________________CODE END______________________
It works well, but everytime I close the form the textboxes return to
their original designtime designated positions.
Is there a way to make the changes persist so that when the form
closes and reopens the textbox stays in its new position?
Also the code above works, but I don't understand some parts of it.
Can anybody give me a beginners guide to how works?
MANY THANKS to all who reply.
Anthony