AW: Da brauchst du doch keinen Timer
15.11.2009 12:29:33
Nepumuk
Hallo Tino,
ok, über die Menuleiste hab ich nicht bedacht, aber null Problemo:
' **********************************************************************
' Modul: DieseArbeitsmappe Typ: Element der Mappe(Sheet, Workbook, ...)
' **********************************************************************
Option Explicit
Private Sub Workbook_Activate()
Tabelle1.CheckBox1.Value = False
Application.DisplayFullScreen = False
Call Tabelle1.Initialize_Class
End Sub
Private Sub Workbook_Deactivate()
Call Tabelle1.Terminate_Class
End Sub
' **********************************************************************
' Modul: Tabelle1 Typ: Element der Mappe(Sheet, Workbook, ...)
' **********************************************************************
Option Explicit
Private WithEvents objCommandBarButton As clsCommandBarButton
Private Sub CheckBox1_Click()
Application.DisplayFullScreen = Not Application.DisplayFullScreen
Call Initialize_Class
End Sub
Private Sub objCommandBarButton_Click(blnValue As Boolean)
CheckBox1.Value = blnValue
End Sub
Friend Sub Initialize_Class()
Set objCommandBarButton = Nothing
Set objCommandBarButton = New clsCommandBarButton
Set objCommandBarButton.Set_CommandBarButton1 = CommandBars.FindControl(ID:=178)
Set objCommandBarButton.Set_CommandBarButton2 = CommandBars.FindControl(ID:=2951)
End Sub
Friend Sub Terminate_Class()
CheckBox1.Value = False
Set objCommandBarButton = Nothing
End Sub
' **********************************************************************
' Modul: clsCommandBarButton Typ: Klassenmodul
' **********************************************************************
Option Explicit
Public Event Click(blnValue As Boolean)
Private WithEvents mobCommandBarButton1 As CommandBarButton
Private WithEvents mobCommandBarButton2 As CommandBarButton
Friend Property Set Set_CommandBarButton1(objCommandBarButton As CommandBarButton)
Set mobCommandBarButton1 = objCommandBarButton
End Property
Friend Property Set Set_CommandBarButton2(objCommandBarButton As CommandBarButton)
Set mobCommandBarButton2 = objCommandBarButton
End Property
Private Sub mobCommandBarButton1_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
RaiseEvent Click(Ctrl.State = msoButtonUp)
CancelDefault = True
End Sub
Private Sub mobCommandBarButton2_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
RaiseEvent Click(False)
CancelDefault = True
End Sub
Gruß
Nepumuk