Autor Beitrag
Sina4ever
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 76



BeitragVerfasst: Mo 11.09.06 11:46 
hallo,

ich erstelle mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
mi := tmenuitem.Create(self);
mi.Caption := 'Download';
mi.OnClick := downloadfree;
PopupMenu1.Items.Add(mi);


einen eintrag im popupmenu1...

jetzt möchte ich aber noch einen nächsten eintrag hinzufügen, der dann aber nochmals ein untereintrag/untermenü hat, kann mir wer sagen wie das geht?

Sina
Carl Johnson
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

Win XP
D3
BeitragVerfasst: Mo 11.09.06 20:42 
Du machst im prinzip dasselbe wie zuvor, am Schluss dann jedoch:

mi.Items.Add(XYZ...);

Dann hast du ein Untermenü des Untermenüs erstellt
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 11.09.06 21:48 
Hallo,

es gibt auch noch die Funktion NewSubMenu, ein Beispiel:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
PopupMenu1.Items.Add(NewSubMenu('Datei',0,'',
                               [
                               NewItem('Neu',0,False,True,NeuClick,0,''),
                               NewItem('Laden',0,False,True,LadenClick,0,''),
                               NewItem('Beenden',0,False,True,BeendenClick,0,'')
                               ]));

Damit wird ein MenuItem incl. SubMenü-Items erstellt.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )