Örnek uygulamanızın düzenlenmiş hali ektedir. "FTrz" isimli form ilk açılacak form olarak ayarlanmıştır.
MOlaylarTrz isimli modüle
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal wRevert As Long) As Long
Private Declare Function EnableMenuItem Lib "user32" (ByVal hMenu As Long, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long
Public Sub AccessCloseButtonEnabled(pfEnabled As Boolean)
' Comments: Control the Access close button.
' Disabling it forces the user to exit within the application
' Params : pfEnabled TRUE enables the close button, FALSE disabled it
' Owner : Copyright © FMS, Inc.
' Source : Total Visual SourceBook
' Usage : Permission granted to subscribers of the FMS Newsletter
On Error Resume Next
Const clngMF_ByCommand As Long = &H0&
Const clngMF_Grayed As Long = &H1&
Const clngSC_Close As Long = &HF060&
Dim lngWindow As Long
Dim lngMenu As Long
Dim lngFlags As Long
lngWindow = Application.hWndAccessApp
lngMenu = GetSystemMenu(lngWindow, 0)
If pfEnabled Then
lngFlags = clngMF_ByCommand And Not clngMF_Grayed
Else
lngFlags = clngMF_ByCommand Or clngMF_Grayed
End If
Call EnableMenuItem(lngMenu, clngSC_Close, lngFlags)
End Sub
Kodları eklenmiş, FTrz isimli formun açıldığında olayına da
Call AccessCloseButtonEnabled(False)
Kodu eklenmiştir.
Site Kuralları:
c) Birden fazla soruyu aynı konuda sormayınız. Her soru için farklı başlıklı yeni konu açınız. Birden fazla soru sorarsanız bu uygulama yapımına girer, Bu Site "Ödev veya Program Yaptırma Sitesi" Değildir.