Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
448to452
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
448to452
448to452
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Checkbox und Togglebutton

Checkbox und Togglebutton
07.07.2004 22:02:17
Romano
Hallo Forum,
suche nach einer Möglichkeit eine Checkbox und Togglebutton in einer
Symbolleiste zu realisieren. Geht das überhaupt und falls ja, wie?
Grüße Romano

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Checkbox und Togglebutton
K.Rola
Hallo,
solche controls gibts in Commandbars nicht, da heißt es, selber basteln.
Wenn du ein Beispiel brauchst, nochmal melden.
Gruß K.Rola
AW: Checkbox und Togglebutton
Romano
Hallo K.Rola,
bitte um ein Beispiel.
Grüße Romano
AW: Checkbox und Togglebutton
K.Rola
Hallo,
hier was zum Basteln:
Option Explicit
Option Private Module
Const MNAME As String = "DeineLeiste"
Sub make_Menu()
Dim cb As CommandBar, cbb As CommandBarButton
Call delete_Menu
Set cb = CommandBars.Add(MNAME)
Set cbb = cb.Controls.Add(1)
With cbb
.Style = 3
.Caption = "CheckBox1"
.FaceId = 2471
.OnAction = "MakroCheck"
End With
Set cbb = cb.Controls.Add(1)
With cbb
.Style = 3
.Caption = "ToggleButton1"
.FaceId = 478
.OnAction = "Toggle"
.State = 0
.BeginGroup = True
End With
With cb
.Position = 4
.Visible = True
.Left = 50
.Top = 150
End With
End Sub
Sub delete_Menu()
On Error Resume Next
CommandBars(MNAME).Delete
End Sub

Private Sub MakroCheck()
If CommandBars(MNAME).Controls(1).FaceId = 2471 Then
MsgBox "Checkbox nicht geklickt!"
CommandBars(MNAME).Controls(1).FaceId = 220
Else
MsgBox "Checkbox geklickt!"
CommandBars(MNAME).Controls(1).FaceId = 2471
End If
End Sub


Private Sub Toggle()
If CommandBars(MNAME).Controls(2).State = 0 Then
MsgBox "Toggle nicht geklickt!"
CommandBars(MNAME).Controls(2).FaceId = 1786
CommandBars(MNAME).Controls(2).State = -1
Else
MsgBox "Toggle geklickt!"
CommandBars(MNAME).Controls(2).FaceId = 478
CommandBars(MNAME).Controls(2).State = 0
End If
End Sub

Gruß K.Rola
Anzeige
Danke, funktioniert einwandfrei kT.
Romano
oo

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige