Re: Delphi: Application MenuPosted 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 : You could also let the user select a program, followed with a click on a button "Run". : 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 ******************************************************** [ DelphiLand: free Delphi source code, tips, tutorials ] |
|