VERSION 5.00 Object = "{7BC799E3-4B71-11CF-840E-444553540000}#2.0#0"; "JOYSTK32.OCX" Begin VB.Form Form1 Caption = "Form1" ClientHeight = 90 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 DrawWidth = 2 LinkTopic = "Form1" ScaleHeight = 6 ScaleMode = 3 'Pixel ScaleWidth = 312 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command3 Caption = "Restart" Height = 495 Left = 5520 TabIndex = 5 Top = 2040 Width = 1215 End Begin VB.CommandButton Command2 Caption = "Pause" Height = 495 Left = 3840 TabIndex = 4 Top = 2040 Width = 1215 End Begin VB.TextBox Text2 Height = 495 Left = 8880 TabIndex = 3 Text = "Y" Top = 2040 Width = 1215 End Begin VB.TextBox Text1 Height = 495 Left = 7200 TabIndex = 2 Text = "X" Top = 2040 Width = 1215 End Begin JoystkLib.Joystk Joystk1 Left = 4440 Top = 960 _Version = 131072 _ExtentX = 847 _ExtentY = 847 _StockProps = 64 Enabled = 0 'False End Begin VB.CommandButton Command1 Caption = "Start" Height = 495 Left = 2160 TabIndex = 1 Top = 2040 Width = 1215 End Begin VB.PictureBox Picture1 BackColor = &H00FFFFFF& DrawWidth = 2 Height = 3000 Left = 1680 ScaleHeight = 196 ScaleMode = 3 'Pixel ScaleWidth = 596 TabIndex = 0 Top = 2760 Width = 9000 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim c, n, X, Y As Integer Private Sub Command1_Click() Call grid ' calls subroutine that produces the grid Joystk1.Enabled = True End Sub Private Sub Command2_Click() Joystk1.Enabled = False End Sub Private Sub Command3_Click() Joystk1.Enabled = True End Sub Private Sub Form_Load() Width = Screen.Width * 0.75 'sets form to 75% of screen Height = Screen.Height * 0.75 Left = (Screen.Width - Width) / 2 ' centers form Top = (Screen.Height - Height) / 2 End Sub Private Sub Joystk1_Move(ByVal X As Long, ByVal Y As Long, ByVal Z As Long) Text1.Text = X Text2.Text = Y Picture1.PSet (c, X / 250), QBColor(1) Picture1.PSet (c, Y / 250), QBColor(4) c = c + 1 If c > 600 Then Picture1.Cls If c > 600 Then Call grid 'calls procedure "grid" produces lines If c > 600 Then c = 0 End Sub Public Sub grid() Y = 20 For n = 1 To 9 Picture1.Line (0, Y)-(600, Y), RGB(0, 255, 0) Y = Y + 20 Next n Picture1.Line (0, 99)-(600, 99), RGB(200, 200, 200) Picture1.Line (0, 100)-(600, 100), RGB(200, 200, 200) Picture1.Line (0, 101)-(600, 101), RGB(200, 200, 200) X = 20 For n = 1 To 29 Picture1.Line (X, 0)-(X, 200), RGB(0, 255, 0) X = X + 20 Next n End Sub