Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 13.01.20 12:51 
Moin Forum,

wie kann ich bei Firemonkey in einem TMainMenu die Anzahl untergeordneter MenuItems abfragen?


MainMenu1.Items[0]...? Count geht nicht. ComponentCount und ChildrenCount passt auch nicht.
Habe in einem Beispiel vier Untermenüs und möchte diese gerne auflisten.
Einloggen, um Attachments anzusehen!
_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 13.01.20 13:06 
TMainMenu.ItemsCount müßte aber passen.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 13.01.20 13:48 
Ja, für die Anzahl MenuItems. Aber nicht für deren SubItems.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 13.01.20 14:11 
Ach so: Items[X] liefert ein TFmxObject, welches du erst noch in ein TMenuItem casten mußt.
Und über GetItemsCount kommst du dann an die Anzahl der Untermenüs.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 13.01.20 14:20 
Das wars, danke! :-)

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...