Re: Delphi: Application Menu


[ Delphi Forum -- by DelphiLand ]

Posted by Lionel on December 19, 2003

In Reply to: Re: Application Menu posted by webmaster on December 19, 2003:

: If you think of it, a menu is a lot like a listbox. So let's simulate it with a listbox component: fill the listbox with the titles of your programs. You can fill it in the Object Inspector, but it's easier to maintain the code if you do this under program control, for example at program startup.

: Next, create an event handler for the OnClick event of the listbox (or the OnDblClick event, if you prefer a double click). In that procedure, find out which item is selected, and launch the corresponding program. For example, using a "case" construction:

: case Listbox1.ItemIndex of
: 0: launch_program_1;
: 1: launch_program_2;
: 2: launch_program_3;
: ...
: end;

: You could also let the user select a program, followed with a click on a button "Run".
: Or, to add a nice effect, run the selected program when the user selects it and presses the ENTER key on the keyboard.

: It's a bit too long to go over all the code here. I made a demo project with some extra's and zipped it into LAUNCHER.ZIP. You can download it from this password protected page:

: http://www.festra.com/dclub
: User name: dclub
: Password: your membership access password

********************************************************
   I really appreciate the help, the "Launcher" is exactly what I needed.
   Wishing you and yours a Merry Christmas, Thanks again.
   Lionel
******************************************************


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]