XL 2010 Déplacer librement une Usf (RESOLU)

misteryann

XLDnaute Occasionnel
Bonsoir le forum.
Savez-vous si il est possible de déplacer librement une usf. Je m'explique:
sur l'ordi de mon boulot la usf prend la totalité de l'écran (21') mais sur mon perso l'écran fait 15'.
Du coup je n'ai pas accès à certains boutons, textbox, etc.
Quelqu'un sait-il si il y a possibilité de déplacer la usf librement comme une fenêtre Windows (genre saisie de la usf avec le curseur en forme de croix fléché), ou est-ce impossible à réaliser ?

Bien cordialement.
Misteryann
 

patricktoulon

XLDnaute Barbatruc
bonjour
il me semble que prendre le train a l'envers est un peu to much
qu'elle est la raison qui fait que ce userform soit si grand au départ????
qu'elle en est l'utilité ?

dire qu'avec la simple api showwindowA et la findwindowA on peut mettre le userform adapté a l’écran et dans l’événement resize faire le prorata pour la fonction zoom
et hop c'est bon pour n'importe quel écran
;)
 

patricktoulon

XLDnaute Barbatruc
EXEMPLE EN 32 BITS
VB:
'date:16/08/2018 
'Author patricktoulon sur DVP et exceldownload
'UserForm resize/zomm + All buttonS in caption WITH API WINDOW
'version api 32 bits for excel download
Private Declare Function FWD Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SHW Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SWL Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim ORIGINALH#
Dim ORIGINALW#
Private Sub UserForm_Activate()
    SWL FWD(vbNullString, Me.Caption), -16, &H94CF0080
    ORIGINALH = Me.Height
    ORIGINALW = Me.Width
    SHW FWD(vbNullString, Me.Caption), 3
End Sub

Private Sub UserForm_Resize()
    Me.Zoom = 100 * Me.Height / ORIGINALH
End Sub
qu'il soit plus grand ou plus petit au départ ça fera le job
 

Statistiques des forums

Discussions
312 348
Messages
2 087 510
Membres
103 570
dernier inscrit
patrickb83p