Positions images dans un formulaire

Lone-wolf

XLDnaute Barbatruc
Bonjour à tous,

j'aimerais positionner (en VBA) les cartes de cette façon:

90 et 180° horaire et 90° antihoraire.


Pour l'instant j'ai ça:

Code:
  Private Sub Changer_Click()
woot
Passe.Visible = True
Changer.Visible = False
Ajouter.Visible = True
Image6.Top = 286      'Images correspondant au joueur1
Image7.Top = 286
Image8.Top = 286
Image9.Top = 286
Image10.Top = 286
End Sub

Private Sub Ajouter_Click()
coin
Ajouter.Visible = True
Passe.Visible = True
Changer.Visible = False
End Sub

Private Sub Passe_Click()
woot
Changer.Visible = True
Passe.Visible = False
Ajouter.Visible = False

'Ceci affiche les 4 images (dos des cartes)
Image7.Top = 285.9
Image7.Picture = Feuil2.Image1.Picture
Image8.Top = 285.9
Image8.Picture = Feuil2.Image1.Picture
Image9.Top = 285.9
Image9.Picture = Feuil2.Image1.Picture
Image10.Top = 285.9
Image10.Picture = Feuil2.Image1.Picture
End Sub

Private Sub Image6_Click()
cli
If Image6.Top <> 276 Then
Image6.Top = 276
Else
If Image6.Top = 276 Then
Image6.Top = 286
End If
End If
End Sub

Private Sub Image7_Click()
cli
If Image7.Top <> 276 Then
Image7.Top = 276
Else
If Image7.Top = 276 Then
Image7.Top = 286
End If
End If
End Sub

Private Sub Image8_Click()
cli
If Image8.Top <> 276 Then
Image8.Top = 276
Else
If Image8.Top = 276 Then
Image8.Top = 286
End If
End If
End Sub

Private Sub Image9_Click()
cli
If Image9.Top <> 276 Then
Image9.Top = 276
Else
If Image9.Top = 276 Then
Image9.Top = 286
End If
End If
End Sub

Private Sub Image10_Click()
cli
If Image10.Top <> 276 Then
Image10.Top = 276
Else
If Image10.Top = 276 Then
Image10.Top = 286
End If
End If
End Sub

Private Sub UserForm_Initialize()

    Dim ico As String
    Dim x As Long
    ico = ThisWorkbook.Path & "\coeur.ico"
    x = Len(Dir(ico))
    If x = 0 Then Exit Sub
    x = ExtractIconA(0, ico, 0)
    SendMessageA FindWindow(vbNullString, Me.Caption), &H80, False, x
    
    Dim hWnd As Long
    hWnd = FindWindowA(vbNullString, Me.Caption)
    SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000

    
    Changer.Visible = True
    Ajouter.Visible = False
    Passe.Visible = False
    
    Image1.Picture = Feuil5.Image9.Picture
    Image2.Picture = Feuil5.Image11.Picture
    Image3.Picture = Feuil5.Image18.Picture
    Image4.Picture = Feuil5.Image24.Picture
    Image5.Picture = Feuil5.Image30.Picture
    Image6.Picture = Feuil2.Image54.Picture
    Image7.Picture = Feuil2.Image32.Picture
    Image8.Picture = Feuil2.Image45.Picture
    Image9.Picture = Feuil2.Image10.Picture
    Image10.Picture = Feuil2.Image36.Picture
    Image11.Picture = Feuil3.Image1.Picture
    Image12.Picture = Feuil3.Image13.Picture
    Image13.Picture = Feuil3.Image37.Picture
    Image14.Picture = Feuil3.Image29.Picture
    Image15.Picture = Feuil3.Image15.Picture
    Image16.Picture = Feuil4.Image7.Picture
    Image17.Picture = Feuil4.Image2.Picture
    Image18.Picture = Feuil4.Image9.Picture
    Image19.Picture = Feuil4.Image10.Picture
    Image20.Picture = Feuil4.Image12.Picture
End Sub

Et comment faire pour que l'ordi distribue les cartes de façon aléatoire, fasse une mise aléatoire et change les cartes pour les 3 autres joueurs?
 

Discussions similaires

Réponses
4
Affichages
720

Statistiques des forums

Discussions
312 510
Messages
2 089 147
Membres
104 050
dernier inscrit
Pepito93100