Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   Eliminar Item de el menú ( TMainMenu) (https://www.clubdelphi.com/foros/showthread.php?t=62483)

Carmelo Cash 28-12-2008 21:23:31

Eliminar Item de el menú ( TMainMenu)
 
Hola Foro.
Quería saber si es posible borrar un Item del menu. Hasta ahora he probado
Mainmenu1.Items.Delete(2), Pero esto me borra toda la columa 2, y necesito borrar solo algunos items, identificandolos por el caption u otra forma.
Gracias por su atención.

cHackAll 28-12-2008 22:02:02

Código Delphi [-]
// MainMenu1.Items[2].Delete(2);
 MainMenu1.Items[2][2].Enabled := False;

Carmelo Cash 29-12-2008 12:19:39

Ok
 
Esto era lo que necsitaba.

Gracias cHackAll por tu ayuda :cool:

MasterXP 29-12-2008 13:52:47

Y si quieres identificarlos por el caption puedes hacer:

Código Delphi [-]procedure TForm_Menu.Eliminar_Menu; var I: Integer; Temp: TComponent; begin for I := ComponentCount - 1 downto 0 do begin Temp := Components[i]; if Temp is TMenuItem then begin if TMenuItem(Form_Menu.FindComponent(Temp.Name)).Caption = 'Caption del Menu' Then begin //ejecutar tu codigo end; end; end; end;


La franja horaria es GMT +2. Ahora son las 15:06:37.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi