Bonjour,
Tu peux aussi fabriquer ce petit écran de veille en placçant sut ta
Form un contrôle Timer et un PictureBox avec une image dedans.
Pour quitter l'écran, un click avec le bouton gauche de la souris.
Option Explicit
Dim DeltaX, DeltaY As Integer ' Déclare les variables.
Private Sub Timer1_Timer()
Picture1.Move Picture1.Left + DeltaX, Picture1.Top + DeltaY
If Picture1.Left < ScaleLeft Then DeltaX = 100
If Picture1.Left + Picture1.Width > ScaleWidth + ScaleLeft Then
DeltaX = -100
End If
If Picture1.Top < ScaleTop Then DeltaY = 100
If Picture1.Top + Picture1.Height > ScaleHeight + ScaleTop Then
DeltaY = -100
End If
End Sub
Private Sub Form_Load()
With Form1
.BorderStyle = 1
.WindowState = 2
.BackColor = vbBlack
.Caption = "Ecran de veille"
End With
With Picture1
.AutoSize = True
.BorderStyle = 0
.BackColor = vbBlack
End With
Timer1.Interval = 100 ' Définit l'intervalle.
DeltaX = 100 ' Initialise les variables.
DeltaY = 100
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
End
End Sub
si celà te convient, clique réponse acceptée
jpleroisse
|