Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 665109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:40:25+00:00 2026-05-13T23:40:25+00:00

In my Delphi Project i want to have a ‘Settings’ button that when clicked,

  • 0

In my Delphi Project i want to have a ‘Settings’ button that when clicked, opens a second form (i think this is the correct term, i essentially want a new window to open) for settings.

When the user has finished changing the settings on this new form, i want the form to close on a button click.

The settings the user types in will also need to be accessible to the first, ‘main’ form.

So, for example, if my programme consisted of a main form, that calculated ‘A’ + ‘B’ (A and B being integer variables), with the settings form allowing the user to set values for A and B, how would i do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:40:25+00:00Added an answer on May 13, 2026 at 11:40 pm

    That’s not too difficult if you understand Delphi’s object model. A form is an object that descends from TObject, backed by a DFM file to make setting up the layout easier. The controls on it are other objects, and by default they’re publicly visible to other objects from other units, like your other form. There are two ways to do this.

    The easy way is to have your other form’s code read the values from the controls directly once you’re done with the first form. Just use stuff like MyString := Form2.EditBox.Text;. This isn’t particularly good style, but it works.

    The right way to do it is to either put public properties on your form that will retrieve the values of the controls, or a function that will read them and return some sort of object or record containing all the settings. This takes a bit more work, but it results in cleaner code that’s less likely to cause trouble if you modify things down the road.

    EDIT: In response to the question in the comment:

    To make one form show and hide another, you call Show and Hide on it. Or if you want it to show up in a modal dialog box, call the ShowModal method, which takes care of the hiding for you, as long as you create a button that sets ModalResult. (See the helpfile for details on how these methods work.)

    Of course, the form has to have been created first. Either it can be autocreated by the DPR, which is good for simple programs but not so great once you get a lot of forms in your app, or you can create it in code. Henk has an example of how to do that, though I wouldn’t recommend using the with keyword. And if you created the form yourself, make sure to Free it afterwards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple rave reports(projects) in the project(the delphi project) and I want to
I have a Delphi application that has a document browser as the main form.
I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting
I am responsible for a Delphi/Win32 project management application. I have just completed a
I've been working on a project in Delphi 7 where I wanted to have
I copied some Delphi code from one project to another, and found that it
How to find and remove unused Delphi runtime packages from a project that uses
I have a rather large (freeware) project written with Delphi 2007 which is using
Delphi 2009 uses build configurations . When you create a new project you have
I am doing some refactoring of my Delphi project. I want to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.