Hi,
I am looking to create an eLearning resource using VB2008. I have a
form with a background picture of a cross section of a strand of hair
magnified x1000. The around the edge of the hair strand there are
empty boxes. The boxes are part of the background image (jpg).
The user drags a command button, labelled, for example, 'Hair
Follicle' over to an empty box and drops 'within'. This process is
repeated for the remaining command buttons / labels. So in essence,
the user is simple moving command buttons to other locations on the
form but the background image gives the illusion that they are
dropping the labels in empty boxes.
I have managed to use the following code to move the command buttons
around the form and I can position them over the empty boxes
sucessfully.
Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove
If e.Button = System.Windows.Forms.MouseButtons.Left 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
I would like the command buttons to snap into place when they are
dropped. Is this possible? I would also like to test if the command
buttons are dropped onto the correct labels and feedback given to the
user in the form of a dialog box.
Any ideas? Any help is much appreciated.
Thanks,
Paul