Undskylder at det tog så lang tid for mig at svare, men min installation af
win 2000 Pro DK
var noget af en udfordring, GISP.
HUSK AT TAGE EN BACKUP. LOL.
Nå, men her er mit bud ( det virker ).
Mange venlige hilsner.
Jan.
Begin VB.Form frmAkvarium
BackColor = &H00FFFFFF&
Caption = "Akvarium"
ClientHeight = 4785
ClientLeft = 1710
ClientTop = 1545
ClientWidth = 6495
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 4785
ScaleWidth = 6495
Begin VB.Timer Timer1
Interval = 10
Left = 240
Top = 720
End
Begin VB.CommandButton cmdSvøm
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "Svøm"
Default = -1 'True
Height = 612
Left = 0
TabIndex = 0
Top = 0
Width = 732
End
Begin VB.Image imgSvøm4
Appearance = 0 'Flat
Height = 615
Left = 3240
Stretch = -1 'True
Top = 240
Visible = 0 'False
Width = 1335
End
Begin VB.Image imgSvøm3
Appearance = 0 'Flat
Height = 2295
Left = 3480
Stretch = -1 'True
Top = 2280
Visible = 0 'False
Width = 855
End
Begin VB.Image imgSvøm2
Appearance = 0 'Flat
Height = 855
Left = 4440
Stretch = -1 'True
Top = 1200
Visible = 0 'False
Width = 1935
End
Begin VB.Image imgSvøm
Height = 1455
Left = 600
Stretch = -1 'True
Top = 1440
Width = 1095
End
Begin VB.Image imgVenstre
Height = 1455
Left = 240
Picture = "janfisk.frx":0000
Stretch = -1 'True
Top = 3120
Visible = 0 'False
Width = 1095
End
Begin VB.Image imgHøjre
Height = 1455
Left = 1680
Picture = "janfisk.frx":775E
Stretch = -1 'True
Top = 3120
Visible = 0 'False
Width = 1095
End
End
Attribute VB_Name = "frmAkvarium"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dx As Integer, dy As Integer
Dim dx2 As Integer, dy2 As Integer
Dim dx3 As Integer, dy3 As Integer
Dim dx4 As Integer, dy4 As Integer
Private Sub cmdSvøm_Click()
dy = 50
dx = 100
dy2 = 30
dx2 = -80
dy3 = 40
dx3 = 50
dy4 = 20
dx4 = -90
imgSvøm.Visible = True
imgSvøm.Picture = imgHøjre.Picture
imgSvøm2.Visible = True
imgSvøm2.Picture = imgVenstre.Picture
imgSvøm3.Visible = True
imgSvøm3.Picture = imgHøjre.Picture
imgSvøm4.Visible = True
imgSvøm4.Picture = imgVenstre.Picture
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Height = Screen.Height
Width = Screen.Width
Top = 0
Left = 0
End Sub
Private Sub Timer1_Timer()
If imgSvøm.Left + imgSvøm.Width + dx >= frmAkvarium.ScaleWidth Then
dx = -dx
imgSvøm = imgVenstre
End If
If imgSvøm.Left < 0 Then
dx = -dx
imgSvøm = imgHøjre
End If
If imgSvøm.Top + imgSvøm.Height + dy >= frmAkvarium.ScaleHeight Then dy
= -dy
If imgSvøm.Top < 0 Then dy = -dy
imgSvøm.Move (imgSvøm.Left + dx), (imgSvøm.Top + dy)
If imgSvøm2.Left + imgSvøm2.Width + dx2 >= frmAkvarium.ScaleWidth Then
dx2 = -dx2
imgSvøm2 = imgVenstre
End If
If imgSvøm2.Left < 0 Then
dx2 = -dx2
imgSvøm2 = imgHøjre
End If
If imgSvøm2.Top + imgSvøm2.Height + dy2 >= frmAkvarium.ScaleHeight Then dy2
= -dy2
If imgSvøm2.Top < 0 Then dy2 = -dy2
imgSvøm2.Move (imgSvøm2.Left + dx2), (imgSvøm2.Top + dy2)
If imgSvøm3.Left + imgSvøm3.Width + dx3 >= frmAkvarium.ScaleWidth Then
dx3 = -dx3
imgSvøm3 = imgVenstre
End If
If imgSvøm3.Left < 0 Then
dx3 = -dx3
imgSvøm3 = imgHøjre
End If
If imgSvøm3.Top + imgSvøm3.Height + dy3 >= frmAkvarium.ScaleHeight Then dy3
= -dy3
If imgSvøm3.Top < 0 Then dy3 = -dy3
imgSvøm3.Move (imgSvøm3.Left + dx3), (imgSvøm3.Top + dy3)
If
|