trungn077 > 22-04-13, 12:32 AM
quan_pc > 30-04-13, 12:46 AM
Trích dẫn:Option Compare Databasesau đó bạn tạo 1 form có chứa các nút sau(nên tạo 1 nút liên kết đến cái form này)
'Chíp khai báo cáo h?ng s?
Private Const MF_DISABLED = &H2&
Private Const MF_ENABLED = &H0&
Private Const MF_GRAYED = &H1&
'Chíp khai báo cáo hàm API c?n dùng
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
'Chíp t?o các Sub
Public Sub DisableSysMenu(ByVal hmenuTrackPopup As Long, ByVal mPosition As Long, ByVal mstr As String)
Dim r1 As Long
r1 = ModifyMenu(hmenuTrackPopup, mPosition, MF_DISABLED Or MF_GRAYED, mPosition, mstr)
End Sub
Public Sub EnableSysMenu(ByVal hmenuTrackPopup As Long, ByVal mPosition As Long, ByVal mstr As String)
Dim r1 As Long
r1 = ModifyMenu(hmenuTrackPopup, mPosition, MF_ENABLED, mPosition, mstr)
End Sub
Public Sub NoCloseButton(ByVal mhwnd As Long)
Dim mstr As String
mstr = String$(100, " ")
r2 = GetSystemMenu(mhwnd, 0)
r3 = GetMenuString(r2, 61536, mstr, 100, 0)
mstr = Trim$(mstr)
Call DisableSysMenu(r2, 61536, mstr)
End Sub
Public Sub YesCloseButton(ByVal mhwnd As Long)
Dim mstr As String
mstr = String$(100, " ")
r2 = GetSystemMenu(mhwnd, 0)
r3 = GetMenuString(r2, 61536, mstr, 100, 0)
mstr = Trim$(mstr)
Call EnableSysMenu(r2, 61536, mstr)
End Sub
Function Thanhcongcu(strAcToolBar As String)
Select Case strAcToolBar
Case "Yes"
DoCmd.ShowToolbar "Ribbon", acToolbarYes
Case "No"
DoCmd.ShowToolbar "Ribbon", acToolbarNo
Case Else
MsgBox "ShowRibbonBar Permision use only Yes/No (string) value."
End Select
End Function
trungn077 > 30-04-13, 11:49 PM
quan_pc > 01-05-13, 01:16 PM