publicado el 12 de septiembre8 años hola amigos buenas noches cordial saludo a todos lo que han ayudado, hoy traigo un tema de ubicación de mensaje en formulario, lo que quiero realizar es ubicar el mensaje cuando el formulario se maximizar y se Restaurar según en la ubicación actual. saludos, Mensaje.xlsm
publicado el 12 de septiembre8 años hola te hago algunas correcciones en cuanto a las declaraciones de las apis y esta lo que buscas, por otro lado le puse para que puedas modificar el tamaño estirando por el borde, si lo quieres como antes le pones WS_MINIMIZEBOX or WS_MAXIMIZEBOX en ves de WS_TILEDWINDOW Option Explicit #If VBA7 Then Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As LongPtr #If Win64 Then Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrA" (ByVal hWnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongPtrA" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As LongPtr #Else Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As LongPtr #End If #Else Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long #End If Private Const WS_TILEDWINDOW As Long = &HCF0000 Private Const WS_MINIMIZEBOX As Long = &H20000 Private Const WS_MAXIMIZEBOX As Long = &H10000 Private Const GWL_STYLE As Long = (-16) Private Sub UserForm_Initialize() Dim lngMyHandle If Application.Version < 9 Then lngMyHandle = FindWindow("THUNDERXFRAME", Me.Caption) Else lngMyHandle = FindWindow("THUNDERDFRAME", Me.Caption) End If SetWindowLong lngMyHandle, GWL_STYLE, GetWindowLong(lngMyHandle, GWL_STYLE) Or WS_TILEDWINDOW DrawMenuBar lngMyHandle End Sub Private Sub UserForm_Resize() Barradelmenú.Width = Me.InsideWidth Mensaje.Left = Me.InsideWidth - Mensaje.Width End Sub
hola amigos buenas noches
cordial saludo a todos lo que han ayudado, hoy traigo un tema de ubicación de mensaje en formulario, lo que quiero realizar es ubicar el mensaje cuando el formulario se maximizar y se Restaurar según en la ubicación actual.
saludos,
Mensaje.xlsm