Dim ImArray() As New ImEvents Private Declare Function GetWindowLongA Lib "user32" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLongA Lib "user32" _ (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Function FindWindowA Lib "user32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Sub UserForm_Initialize() Dim Im As MSForms.Image For I = 11 To 20 If Dir(Application.ActiveWorkbook.Path & "\Logo\" & I & ".jpg") <> "" Then Set Im = Me.Frame1.Controls.Add("Forms.Image.1", "Image" & I) With Im .Picture = LoadPicture(Application.ActiveWorkbook.Path & "\Logo\" & I & ".jpg") If I Mod 2 = 0 Then .Left = 260 Else .Left = 17 End If .AutoSize = False If I = 11 Then .Top = 20 Else If I Mod 2 = 0 Then .Top = Controls("Image" & I - 1).Top Else .Top = (I - 10) * 22 End If End If .BorderColor = &H8000000F .AutoSize = True .ControlTipText = "B.U " & I - 10 End With Frame1.Height = (I - 10) * 22 + 50 Me.Height = (I - 10) * 22 + 85 ReDim Preserve ImArray(11 To I) Set ImArray(I).ImEvents = Im End If Next I Dim hwnd As Long hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _ "X", "D") & "Frame", Me.Caption) SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'If CloseMode = 0 Then Cancel = True End Sub