...Har selv fundet ud af det men tak for hjælpen alligevel...
Hvad var svaret?
Software is here and now but rock and roll is forever.
Dette skal i et modul:
<pre>
Option Explicit
Public Type tPOINT
X As Integer
Y As Integer
End Type
Public Sub Main()
' do not run more than one program
If App.PrevInstance = True Then End
' Test
' frmPause.Show
' Start
Select Case Command
Case Is = "/s"
frmPause.Show
Case Else
End Select
End Sub
</pre>
Dette skal i din form:
<pre>
Dim CursorPos As tPOINT
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Dim Punkt(1 To 8) As tPOINT
Dim InvertX1 As Boolean
Dim InvertY1 As Boolean
Dim InvertX2 As Boolean
Dim InvertY2 As Boolean
Dim InvertX3 As Boolean
Dim InvertY3 As Boolean
Dim InvertX4 As Boolean
Dim InvertY4 As Boolean
Private Sub Form_Load()
Randomize Timer
Height = Screen.Height
Width = Screen.Width
Punkt(2).X = Width / 2
Punkt(2).Y = Height / 2
Punkt(4).X = Width / 2
Punkt(4).Y = Height / 2
Punkt(6).X = Width / 2
Punkt(6).Y = Height / 2
Punkt(8).X = Width / 2
Punkt(8).Y = Height / 2
InvertX1 = False
InvertY1 = False
InvertX2 = True
InvertY2 = True
InvertX3 = False
InvertY3 = False
InvertX4 = True
InvertY4 = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
SetCursorPos CursorPos.X, CursorPos.Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static Start As Byte
Static Punkt As tPOINT
If Start < 2 Then
Start = Start + 1
Punkt.X = X
Punkt.Y = Y
CursorPos.X = X
CursorPos.Y = Y
SetCursorPos Screen.Width, Screen.Height
Exit Sub
End If
If Punkt.X <> X Or Punkt.Y <> Y Then End
End Sub
Private Sub timPaint_Timer()
If WindowState <> 2 Then
WindowState = 2
End If
Static AntGange As Integer
AntGange = AntGange + 1
If AntGange > 500 Then
Cls
AntGange = 0
End If
' Find dots
' Circle 1
If InvertX1 = True Then
Punkt(2).X = Punkt(2).X + Int(Rnd * 200) + 1
If Punkt(2).X > Screen.Width - 1000 Then
InvertX1 = False
End If
Else
Punkt(2).X = Punkt(2).X - Int(Rnd * 200) + 1
If Punkt(2).X < 0 + 1000 Then
InvertX1 = True
End If
End If
If InvertY1 = True Then
Punkt(2).Y = Punkt(2).Y + Int(Rnd * 200) + 1
If Punkt(2).Y > Screen.Height - 1000 Then
InvertY1 = False
End If
Else
Punkt(2).Y = Punkt(2).Y - Int(Rnd * 200) + 1
If Punkt(2).Y < 0 + 1000 Then
InvertY1 = True
End If
End If
' Circle 2
If InvertX2 = True Then
Punkt(4).X = Punkt(4).X + Int(Rnd * 200) + 1
If Punkt(4).X > Screen.Width - 1000 Then
InvertX2 = False
End If
Else
Punkt(4).X = Punkt(4).X - Int(Rnd * 200) + 1
If Punkt(4).X < 0 + 1000 Then
InvertX2 = True
End If
End If
If InvertY2 = True Then
Punkt(4).Y = Punkt(4).Y + Int(Rnd * 200) + 1
If Punkt(4).Y > Screen.Height - 1000 Then
InvertY2 = False
End If
Else
Punkt(4).Y = Punkt(4).Y - Int(Rnd * 200) + 1
If Punkt(4).Y < 0 + 1000 Then
InvertY2 = True
End If
End If
' Circle 3
If InvertX3 = True Then
Punkt(6).X = Punkt(6).X + Int(Rnd * 200) + 1
If Punkt(6).X > Screen.Width - 1000 Then
InvertX3 = False
End If
Else
Punkt(6).X = Punkt(6).X - Int(Rnd * 200) + 1
If Punkt(6).X < 0 + 1000 Then
InvertX3 = True
End If
End If
If InvertY3 = True Then
Punkt(6).Y = Punkt(6).Y + Int(Rnd * 200) + 1
If Punkt(6).Y > Screen.Height - 1000 Then
InvertY3 = False
End If
Else
Punkt(6).Y = Punkt(6).Y - Int(Rnd * 200) + 1
If Punkt(6).Y < 0 + 1000 Then
InvertY3 = True
End If
End If
' Circle 4
If InvertX4 = True Then
Punkt(8).X = Punkt(8).X + Int(Rnd * 200) + 1
If Punkt(8).X > Screen.Width - 1000 Then
InvertX4 = False
End If
Else
Punkt(8).X = Punkt(8).X - Int(Rnd * 200) + 1
If Punkt(8).X < 0 + 1000 Then
InvertX4 = True
End If
End If
If InvertY4 = True Then
Punkt(8).Y = Punkt(8).Y + Int(Rnd * 200) + 1
If Punkt(8).Y > Screen.Height - 1000 Then
InvertY4 = False
End If
Else
Punkt(8).Y = Punkt(8).Y - Int(Rnd * 200) + 1
If Punkt(8).Y < 0 + 1000 Then
InvertY4 = True
End If
End If
' Draw Circle
DrawWidth = 3
'ForeColor = BackColor
'Circle (Punkt(1).X, Punkt(1).Y), 1000
'Circle (Punkt(3).X, Punkt(3).Y), 1000
'ForeColor = RGB(Int(Rnd * 254) + 1, Int(Rnd * 254) + 1, Int(Rnd * 254) + 1)
'ForeColor = RGB(255, 0, 0)
Circle (Punkt(2).X, Punkt(2).Y), 250, RGB(255, 0, 0)
Circle (Punkt(4).X, Punkt(4).Y), 100, RGB(0, 255, 0)
Circle (Punkt(6).X, Punkt(6).Y), 150, RGB(0, 0, 255)
Circle (Punkt(8).X, Punkt(8).Y), 200, RGB(255, 255, 0)
' Gem punkter
Punkt(1).X = Punkt(2).X
Punkt(1).Y = Punkt(2).Y
Punkt(3).X = Punkt(4).X
Punkt(3).Y = Punkt(4).Y
Punkt(5).X = Punkt(6).X
Punkt(5).Y = Punkt(6).Y
Punkt(7).X = Punkt(8).X
Punkt(7).Y = Punkt(8).Y
End Sub
</pre>
Husk at sætte en timer på din form og kald den: timPaint
Formen skal i dette tilfælde hede: frmPause
I Am The Cyborg, and i'm here to serve