FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
Como peuedo añadir un item a un main menu???
Hola querria saber como añadir a un Tmainmenu items mediante comandos. Por ejemplo al presionar un boton del formulario.
|
#2
|
|||
|
|||
sacado de la ayuda del Delphi
Código:
procedure TForm1.Button1Click(Sender: TObject); var NewItem: TMenuItem; I : integer; begin { first create the separator } NewItem := TMenuItem.Create(Self); NewItem.Caption := '-'; { add the new item to the Windows menu } Windows.Add(NewItem); { now create and add a menu item for each form } for I := 0 to Screen.FormCount-1 do begin NewItem := TMenuItem.Create(Self); NewItem.Caption := Screen.Forms[i].Name; Windows.Add(NewItem); end; end; |
|
|
|