Solved

creating an interface

Posted on 1998-08-10
3
120 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
  • 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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