Skip to main content

AccessTr.neT


VT'de Tüm form Araç Çubuklarını otomatik değiştirme

VT'de Tüm form Araç Çubuklarını otomatik değiştirme

Information #1
Aşağıdaki kod ile VT'deki tüm formların araç çubukları değiştirebilirsiniz. En iyisi her VT için yönetim paneli oluşturulması.

PHP Kod:
Public Sub SetFormToolbars()
Dim objFrm As AccessObjectfrm As Formctl As Control
    
' Go through every form in the database
    For Each objFrm In CurrentProject.AllForms
        ' 
Skip fixing any "plain" examples
        
If Right(objFrm.Name5) <> "plain" Then
            DoCmd
.OpenForm FormName:=objFrm.NameView:=acDesignWindowMode:=acHidden
            
' Set a pointer to the form just opened
            Set frm = Forms(objFrm.Name)
            ' 
Set custom menu and toolbars for the form object
            
' .. only for primary forms
            If Left(frm.Name, 3) = "frm" Then
                ' 
Clear any saved filter while we're at it
                Forms(frm.Name).Filter = ""
                ' 
Set the custom menu bar
                Forms
(frm.Name).MenuBar "FormMenuBar"
                ' Set the custom toolbar
                Forms(frm.Name).Toolbar = "FormToolbox"
                ' 
Set the custom shortcut menu bar
                Forms
(frm.Name).ShortcutMenuBar ""
            
End If
            
' Loop through all controls
            For Each ctl In frm.Controls
                ' 
Skip control types that don't have a ShortcutMenuBar property
                If (ctl.ControlType <> acCustomControl) And _
                    (ctl.ControlType <> acSubform) And _
                    (ctl.ControlType <> acRectangle) And _
                    (ctl.ControlType <> acLabel) And _
                    (ctl.ControlType <> acLine) And _
                    (ctl.ControlType <> acPageBreak) Then
                    ' 
Set the custom control shortcut menu
                    ctl
.ShortcutMenuBar ""
                
End If
            
' Loop through all controls on the form
            Next ctl
            ' 
Fix AllowDesignChanges while we're at it
            frm.AllowDesignChanges = False
            ' 
Close and save the result
            DoCmd
.Close acFormobjFrm.NameacSaveYes
        End 
If
    
' Loop to get the next form
    Next objFrm
    ' 
Clean up
    Set ctl 
Nothing
    Set frm 
Nothing
    Set objFrm 
Nothing
End Sub 

Burdaki kod plain'le başlayan formları es geçer, uyarlamayı unutmayınız.
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
VT'de Tüm form Araç Çubuklarını otomatik değiştirme - Yazar: mehmeser - 17/07/2009, 20:32
Task