![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Субменю в PopupMenu [D7, WinXP]
Phoenix © (2005-05-24 12:32:00)Как добавить субменю в PopupMenu?
Alx2 (2005-05-24 12:37:00) [1]Пример в Help:
This example assumes that the main form of the application has a main menu with a Windows menu item. The following code adds a separator, and the name of all forms to the Windows menu.
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;
Gero (2005-05-24 12:35:00) [2]
> ЧТо бы не возникло непонимания уточню - как ПРОГРАММНО добавить
> субменю в PopupMenu
Не думаю, что кто-то попытался бы сделать это аппаратно.
Alx2 (2005-05-24 12:35:00) [3]MenuItem.Add(TMenuItem.Create(MenuItem));
Phoenix (2005-05-24 12:33:00) [4]ЧТо бы не возникло непонимания уточню - как ПРОГРАММНО добавить субменю в PopupMenu