Solved

creating an interface

Posted on 1998-08-10
3
117 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now