Bonsoir à tous,
Voici une macro qui te permettra d'avoir ton userform entièrement transparent. Du coup plus de croix, plus rien sauf ton Textbox et tes deux bouttons.
Private frmRegion As Long, hWnd As Long, msg1 As String, msg2 As String
Private Sub UserForm_Initialize()
ChangeFormEffect
End Sub
Private Sub ChangeFormEffect()
Dim W As Single, H As Single, cl As Long, ct As Long, cw As Long, ch As Long
Dim i As Integer, R As Long, Outer As Long, Inner As Long
hWnd = FindWindow(vbNullString, Me.Caption)
W = Me.Width * 1.33: H = Me.Height * 1.33
frmRegion = CreateRectRgn(0, 0, 0, 0)
Const X As Single = 3: Const Y As Single = 22
Const RGN_OR = 2
Const RGN_DIFF = 4
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Visible Then
ct = Y + (1.33 * Me.Controls(i).Top): ch = ct + (1.33 * Me.Controls(i).Height)
cl = X + (1.33 * Me.Controls(i).Left): cw = cl + (1.33 * Me.Controls(i).Width)
R = CreateRectRgn(cl, ct, cw, ch)
CombineRgn frmRegion, R, frmRegion, RGN_OR
End If
Next
SetWindowRgn hWnd, frmRegion, True
End Sub
Private Function Status() As Byte
Status = Sheets("Feuil1").Activate
End Function
J'espère que cela te conviendra.
A bientôt
Ludwig