Solved

creating an interface

Posted on 1998-08-10
3
122 Views
Last Modified: 2010-04-04
I would like to create an interface whereby one has 3 options to select. Each option will call a separate procedure. How could I do this on Delphi 1?
Please, I have already created a form in which the open dialog icon is used to read a set of data into a record.
Thank you
0
Comment
Question by:liau080698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 20 total points
ID: 1361848
Hi,
How would you like to visualise these options? Radiobuttons?
If so...
1. Set the first radiobutton's Tag property to 1, the second's to 2 and so on...
2. Select the first radiobutton. In the object inspector, on tab "Events" write (for instance) "OptionClick" in the "OnClick" combobox and press enter.
3. Write something like this:
  procedure TForm1.OptionClick(Sender: TObject);
  begin
    // your code begins here
    if not ( Sender is TRadioButton ) then Exit; // not a valid option
    case ( Sender as TRadioButton ).Tag of
      1: ; // option 1
      2: ; // option 2
      3: ; // option 3
    end;
    // or...
    // MyOption := ( Sender as TRadioButton ).Tag;
    // ...and ends here
  end;
4. Then mark all the other radiobuttons and select the "OptionClick" event in "OnClick" combobox in the object inspector and press enter.
5. Run the project...

Done!

/// John
0
 

Expert Comment

by:andrewjackson
ID: 1361849
erajoj has given one possible solution using radio buttons but you could simply have 3 buttons or menus each with their own OnClick event.  It really depends on what you are trying to do.

Look at other Windows application for inspiration.  If the options are something like 'Accept', 'Reject', 'Cancel' or 'Create', 'Delete', 'Edit' then I think 3 buttons / menus are better than radio buttons.
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1361850
Yes, menus and buttons are probably better in most cases, but the radiobutton example contains some simple tricks is/as/tag that can be useful and besides; the "mode d'emploi" isn't very different in the button/menu case.

/// John
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question