Professional Documents
Culture Documents
Option Explicit
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA"
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA"
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe Function GetSystemMenu Lib "user32" (ByVal hWnd As Long,
ByVal bRevert As Long) As Long
Private Declare PtrSafe Function DeleteMenu Lib "user32" (ByVal hMenu As Long,
ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare PtrSafe Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal
nCmdShow As Long) As Long
Private Declare PtrSafe Function EnableWindow Lib "user32" (ByVal hWnd As Long,
ByVal fEnable As Long) As Long
Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As
Long
Private Declare PtrSafe Function SetFocus Lib "user32" (ByVal hWnd As Long) As Long
Private Declare PtrSafe Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA"
(ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As
Long
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As
Long) As Long
AtualizarEstiloForm
End Property
End Sub
-----------------------------------------------------------------------------------
----
2 - Crie um m�dulo (normal)
Crie um m�dulo normal no seu projeto e insira o c�digo abaixo.
Option Explicit
Type POINTAPI
x As Long
Y As Long
End Type
Type MSLLHOOKSTRUCT
pt As POINTAPI
mouseData As Long
flags As Long
time As Long
dwExtraInfo As Long
End Type
Const HC_ACTION = 0
Const WH_MOUSE_LL = 14
Const WM_MOUSEWHEEL = &H20A
GetHookStruct = udtlParamStuct
End Function
Function LowLevelMouseProc _
(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
LowLevelMouseProc = True
End With
End If
Exit Function
End If
UnhookWindowsHookEx hhkLowLevelMouse
LowLevelMouseProc = CallNextHookEx(0, nCode, wParam, ByVal lParam)
End Function
Sub Hook_Mouse()
If hhkLowLevelMouse <> 0 Then
UnhookWindowsHookEx hhkLowLevelMouse
End If
hhkLowLevelMouse = SetWindowsHookEx _
(WH_MOUSE_LL, AddressOf LowLevelMouseProc, Application.Hinstance, 0)
End Sub
Sub UnHook_Mouse()
End Sub
-----------------------------------------------------------------------
3 - Crie um formul�rio
Pronto, agora em todos os formul�rios que voc� criar no seu projeto, insira o
c�digo abaixo. Cada um no seu respectivo procedimento.
'Essa parte vai no topo do seu c�digo, fora dos subs e procedimentos'
Dim nAtualizaForm As New Classe1
Dim T
Dim frmUserWidth As Double
Dim frmUserWidthRatio As Double
Dim frmUserHeight As Double
Dim frmUserHeightRatio As Double
Dim r As Integer
Dim c As Integer
Dim ctl As Control
frmUserWidth = Me.InsideWidth
frmUserHeight = Me.InsideHeight
end sub
frmUserWidth = Me.InsideWidth
frmUserHeight = Me.InsideHeight
End Sub
---------------------------------------------------------------------------
Tela de Login com Design Moderno em VBA'
End Sub
End Sub
End Sub
Private Sub bt_linkedin_Click()
'APROVEITA E ME SEGUE L� NO LINKEDIN - OBRIGADO
ActiveWorkbook.FollowHyperlink Address:="https://www.linkedin.com/in/fernando-
nepomuceno-6a740599"
End Sub
End Sub
With Me.lbl_dark
.Left = Me.lbl_white.Left
.Top = Me.lbl_white.Top
End With
With Me.bt_go_dark
.Left = Me.bt_go_white.Left
.Top = Me.bt_go_white.Top
End With
End Sub
End Sub
Sub modo_dark()
'SUB PARA ATIVAR O MODO DARK, OCULTA TODOS OS ELEMENTOS DO MODO WHITE E CARREGA O
GIF DO MODO DARK
Me.lbl_dark.Visible = True
Me.bt_modo_dark.Visible = False
Me.lbl_white.Visible = False
Me.bt_modo_white.Visible = True
Me.bt_fechar_dark.Visible = True
Me.bt_fechar_white.Visible = False
Me.lbl_bem_vindo.ForeColor = RGB(254, 255, 255)
Me.lbl_orienta.ForeColor = RGB(254, 255, 255)
Me.lbl_cad.ForeColor = RGB(254, 255, 255)
Me.bt_go_white.Visible = False
Me.bt_go_dark.Visible = True
End Sub
Sub modo_white()
'SUB PARA ATIVAR O MODO WHITE, OCULTA TODOS OS ELEMENTOS DO MODO DARK E CARREGA O
GIF DO MODO WHITE
Dim gif As String
Me.lbl_dark.Visible = False
Me.bt_modo_dark.Visible = True
Me.lbl_white.Visible = True
Me.bt_modo_white.Visible = False
Me.bt_fechar_dark.Visible = False
Me.bt_fechar_white.Visible = True
Me.lbl_bem_vindo.ForeColor = &H80000012
Me.lbl_orienta.ForeColor = &H404040
Me.lbl_cad.ForeColor = &H404040
Me.bt_go_white.Visible = True
Me.bt_go_dark.Visible = False
End Sub
---------------------------------------------------------------------
Sub conexao()
pasta = ThisWorkbook.Path
cs = "Provider=Micosoft.ACE.OLEDB.12.0;" _
& "Data Source=C:\myFolder\myAccessFile.accdb;" _
& "Persist Security Info=False;"
MsgBox cs
End Sub
------------------------------------------------------------------------
Sub Reset()
Static xCloseTime
If xCloseTime <> 0 Then
ActiveWorkbook.Application.OnTime xCloseTime, "SaveWork1", , False
End If
xCloseTime = Now + TimeValue(xTime)
ActiveWorkbook.Application.OnTime xCloseTime, "SaveWork1", , True
End Sub
Sub SaveWork1()
'Updated by Extendoffice 2019/1/20
Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub
-----------------------------------------------------------------------------------
------
excluir
-----------------------------------------------------------------------------------
---------------------------
-----------------------------------------------------------------------------------
-------------------
Salva
Range("A3").EntireRow.Insert
Range("B3").Value = Nome.Value
Range("C3").Value = Oferta.Value
Range("D3").Value = D�zimo.Value
Range("E3").Value = Data.Value
Nome.Text = ""
Oferta.Text = ""
D�zimo.Text = ""
Data.Text = ""
----------------------------------------------------------------------
hidetilebarandbordar me