 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ramy Guest
|
Posted: Tue May 31, 2005 10:18 am Post subject: Re: dynamically Add Items to a PopupMenu |
|
|
TForm1 *Form1;
TMainMenu *MainMenu;
TMenuItem *Item1, *Item2, *Item3, *Item4, *Item5, *Item6;
MainMenu = new TMainMenu( YourForm );
Item1 = new TMenuItem( MainMenu );
Item2 = new TMenuItem( MainMenu );
Item3 = new TMenuItem( MainMenu );
Item4 = new TMenuItem( MainMenu );
Item5 = new TMenuItem( MainMenu );
Item6 = new TMenuItem( MainMenu );
Item1->Caption = "File";
Item2->Caption = "Open...";
Item3->Caption = "Save...";
Item4->Caption = "Port";
Item5->Caption = "COM1";
Item6->Caption = "COM2";
MainMenu->Items->Add( Item1 );
Item1->Add( Item2 );
Item1->Add( Item3 );
Item1->Add( Item4 );
Item4->Add( Item5 );
Item4->Add( Item6 );
Form1->Menu = MainMenu;
"Grety" <valid (AT) emailaddress (DOT) com> wrote:
| Quote: | hi
how could I dynamically Add Items to a PopupMenu?
|
|
|
| Back to top |
|
 |
Rudy Velthuis [TeamB] Guest
|
Posted: Tue May 31, 2005 11:33 am Post subject: Re: dynamically Add Items to a PopupMenu |
|
|
At 11:43:37, 01.06.2005, Grety wrote:
| Quote: | hi
how could I dynamically Add Items to a PopupMenu?
|
MyItem = NewItem("Menu item text", 0, false, true, MyItemClick,
0, "MyItem");
MyMenu->InsertComponent(MyItem);
MyMenu->Insert(InsertPosition, MyItem);
for a separator line, you can use NewLine() instead of NewItem().
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de
"I have often regretted my speech, never my silence."
- Xenocrates (396-314 B.C.)
|
|
| Back to top |
|
 |
Ron Sawyer Guest
|
Posted: Tue May 31, 2005 5:59 pm Post subject: Re: dynamically Add Items to a PopupMenu |
|
|
Others have answered the how's - let me chime in with the when. The popup
menu has an OnPopup event that is called just before pop-up menu appears.
"Grety" <valid (AT) emailaddress (DOT) com> wrote
| Quote: | hi
how could I dynamically Add Items to a PopupMenu?
|
|
|
| Back to top |
|
 |
Grety Guest
|
Posted: Wed Jun 01, 2005 9:43 am Post subject: dynamically Add Items to a PopupMenu |
|
|
hi
how could I dynamically Add Items to a PopupMenu?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|