Leandro, bom dia.
Coloque no form o seguinte código:
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function IniciaJanela Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function MoveJanela Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Private Declare Function ExibirÍcone Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
LParam As Any) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
'// Estilo Janela
Private Const WS_CAPTION = &HC00000
Private Const WS_BARRA_TAREFAS = &H40000 '// Barra de tarefas
Private Const WS_MENU As Long = &H80000 '// Menu
Private Const WS_CX_MINIMIZAR As Long = &H20000 '// Botão maximizar
Private Const WS_CX_MAXIMIZAR As Long = &H10000 '// Botão minimizar
Private Const WS_POPUP As Long = &H80000000
'// Estado da janela
Private Const SW_EXIBIR_NORMAL = 1
Private Const SW_EXIBIR_MINIMIZADO = 2
Private Const SW_EXIBIR_MAXIMIZADO = 3
Private Const ESTILO_PROLONGADO = (-20) '// Estilo prolongado
Private Const ESTILO_ATUAL As Long = (-16) '// Um novo estilo de janela
'// Contante do Ícone
Private Const FOCO_ICONE = &H80
Private Const ICONE = 0&
Private Sub UserForm_Activate()
Form_Personalizado = FindWindowA(vbNullString, Me.Caption)
ESTILO = IniciaJanela(Form_Personalizado, ESTILO_ATUAL)
ESTILO = ESTILO Or WS_CX_MAXIMIZAR
ESTILO = ESTILO Or WS_POPUP '
ESTILO = ESTILO Or WS_CAPTION
MoveJanela Form_Personalizado, ESTILO_ATUAL, (ESTILO)
ESTILO = IniciaJanela(Form_Personalizado, ESTILO_PROLONGADO)
ESTILO = ESTILO Or WS_BARRA_TAREFAS
MoveJanela Form_Personalizado, ESTILO_PROLONGADO, ESTILO
DrawMenuBar Form_Personalizado
SetFocus Form_Personalizado
ShowWindow Form_Personalizado, SW_EXIBIR_MAXIMIZADO
'If GetScreenResolution = "800x600" Then
'Me.Zoom = 100
'Else
'Me.Zoom = 130
'End If
End Sub
Se a resposta lhe foi útil, clique no joinha!
Postado : 22/12/2016 6:14 am