Reader Level:
Articles

Joystick Control in VB.NET

By Brad Patterson on November 10, 2012
In this article and the attached source code project written in C# and Windows Forms, the author shows how to build a Joystick control that allows an object to move via the joystick control.
  • 0
  • 0
  • 4416
Download Files:
 

Hello everyone. Here is my joystick control to allow an object to move via the joystick control that is contained herein. Below is an except code snippet.

Private

Sub OnMouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
If isActive Then
MouseAt = New Point(e.X, e.Y)
PolarAtOld = MakeGrid(MouseAt)
magnitude = MagnitudeFromCenter()
GetCompassDirection()
OnPolarMouse(Me.Magnitude, Me.CompassPoint)
End If
End
Sub
<BrowsableAttribute(True), CategoryAttribute("Joystick"), DescriptionAttribute("Magnitude of the crosshair from the center")> _
Public ReadOnly Property Magnitude() As Double
Get
Return
magnitude
End Get
End
Property

 

As you can see that there is Designer support added so that the joystick is configurable.

v

COMMENT USING

Trending up