Solved

creating an interface

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

19 Experts available now in Live!

Get 1:1 Help Now