DelphiFan Magazine

Top Menu

Main Menu

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS

logo

DelphiFan Magazine

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS
  • How to add a server application written in UNIGUI to startup?

  • UniGUI Expiry Link Anonymizer

  • UniGUI Add CAPTCHA to the WEB project

  • UniGui. Unique hybrid of Delphi and JS

  • How to transform a blob field into string lines (varchar) in SQL Firebird?

CODE SAMPLESDELPHI
Home›CODE SAMPLES›Introduction to the properties of the delphi TForm class

Introduction to the properties of the delphi TForm class

By admin
December 2, 2020
2260
0
Share:

The TForm class has many properties. Some of these properties are uncommon and rarely used, while others are widely used. Here I talk about some widely used properties, but not some obvious properties, such as Caption, Color, Left, Top, Width, Height, etc.

Design stage attributes

1. The ActiveControl property is used to set the space. When the form is activated, the control will be focused.

2. AutoScroll, HorzScrollBar and VertScrollBar properties are used together to control the scroll bar of the form. If AutoScroll is set to True (the default state), so when the form is too small to display all components, the scroll bar will be automatically displayed.

3. The BorderIcons property is to control the system buttons that appear on the window during the runtime. The available buttons include the system menu, minimize and maximize buttons, and help buttons.

4. The BorderStyle property indicates what type of border the window will use. Its default value is bsSizeable, and the window created by this value is scalable. Non-scalable types include bsDialog and bsNone.

5. ClientWidth and ClientHeight properties can specify the height and width of the client area, rather than the width and height of the full form (the client area of the form refers to the area between the title bar and the menu bar within the border) . When you need to change the client area to a specific size and adjust other parts of the window, you can use these two properties to set the ClientWidth and ClientHeight properties, and the Width and Height properties will be changed automatically.

6. The Constraints property is used to set the maximum and minimum length and width of the form. As long as the MaxWidth, MaxHeight, MinWidth and MinHeight values are simply set to predetermined values, the form will meet these restrictions.

7. The DefautMonitor attribute determines which monitor the form will use in a multi-monitor environment.

8. The Font property is used to describe the font used in the form. Here we need to understand a very important point, which is to prevent any component on the form from inheriting the form font, that is, as long as the form font is changed, it is fine. Change the fonts used by all components at the same time. If the fonts of individual controls are manually changed, when the font of the main form changes, the fonts of the controls will not change.

9. The FormStyle property is usually set to fsNormal. If you want a form to always be at the top level, you can use fsStayOnTop. MDI forms use fsMDIForm, and MDI child forms use fsMDIChild.

10. HelpContext and HelpFiles. The HelpContext property is used to set the help context ID of the form. If the context help of the form is activated, the Windows help system will be activated when the F1 key is clicked. The context ID is used to instruct the Help system to display the help file Which page of the specific. The HelpFiles property is the name of the help file to be used when the F1 key is clicked.

11. The Icon property is used to set the icon. This icon is used on the title bar of the form when the form is displayed at runtime, and it is the same when the form is minimized. In some cases, setting this property is invalid. For example, when FormStyle is set to fsDialog, the Icon property is ignored.

12. KeyPreview property. When this property is True, the OnKeyPress and OnKeyDown events of this form will be generated as long as any component on the form is clicked. By default, this property is False. When the component on the form is focused, the window The body does not accept keyboard events.

13. Position property. When the form is initialized, the Position property determines the size and position of the form. There are three options for this property:

poDesigned will cause the position of the form to be the position at design time;
poDefault makes Windows set the size and position according to the usual Windows Z-order algorithm (Z-order is used by Windows to determine where to display a new window on the screen. If the new window has no special position information, it will be in front of the screen. Displayed at the bottom right of a window);
poScreenCenter makes the window appear in the center of the screen every time.

14. The Visible property determines whether the form is initially visible. In the running phase, it can determine whether the form is visible and can be used to hide or display the form.

15. The WindowState property can set the current state of the form (maximized, minimized and normal).

Runtime only properties

Some attributes can only be accessed through code during the runtime. Here are some common runtime attributes.

1. The ActiveMDIChild property is read-only and returns a pointer to the currently active MDI child window. If there is no currently active MDI child window or the application is not an MDI application, ActiveMDIChild returns 0.

2. Canvas represents the canvas of the form. You can draw bitmaps, lines, shapes or text on the form through the Canvas property in the running phase. In most cases, the Label component is used to draw text on the form, the Image component is used to display images, and the Shape component is used to draw graphics, but sometimes when you need to draw a canvas during the runtime, you can use the Canvas property.

3. The ClientRect property contains the coordinates of the top, left, right, and bottom of the client area of ​​the form.

4. The Handle property returns the handle of the form. This property is used when the handle needs to be passed to the Windows API function.

5. ModalResult is used to indicate how to close a modal window. If there is a dialog box, it has an OK button and a Cancel button. When the user clicks the OK button, the ModalResult can be set to mrOK. When the user clicks the Cancel button, you can Set it to mrCancel, so that you only need to read ModalResult to call the form to see which button is clicked to close the window. Other values ​​include mrYes, mrNo, and mrAbort.

6. The Owner property is a pointer to the owner of the form. The owner of the form is an object that has the right to delete the form when the form is not needed.

7. The Parent property is a pointer to the parent form.

Tagsdelphidelphi tformformform properties
Previous Article

Two Ways to Improve the Development Efficiency ...

Next Article

Delphi Android permissions

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

admin

Related articles More from author

  • CODE SAMPLESDELPHI

    UniGUI special objects

    November 11, 2020
    By admin
  • DELPHIFIREMONKEY

    Delphi Android APP Automatic Update

    October 31, 2020
    By admin
  • CODE SAMPLESDELPHI

    Several Delphi programs for obtaining Windows system information

    November 23, 2020
    By admin
  • CODE SAMPLESDELPHIFIREMONKEY

    Delphi Android internal system related operations

    December 11, 2020
    By admin
  • DELPHI

    Install help and samples for Rad Studio

    September 27, 2020
    By admin
  • CODE SAMPLESDELPHI

    DBGrid beautification and SQLite display problem

    November 24, 2020
    By admin

Leave a reply Cancel reply

You may interested

  • CODE SAMPLESDELPHI

    Talk about the application of SSL protocol in Delphi [transfer]

  • CODE SAMPLESDELPHI

    How to set up Unigui to run on Linux Operating System

  • CODE SAMPLESDELPHI

    How create a new uniGUI application

  • LATEST REVIEWS

  • TOP REVIEWS

Timeline

  • January 27, 2021

    How to add a server application written in UNIGUI to startup?

  • January 27, 2021

    UniGUI Expiry Link Anonymizer

  • January 26, 2021

    UniGUI Add CAPTCHA to the WEB project

  • January 26, 2021

    UniGui. Unique hybrid of Delphi and JS

  • January 13, 2021

    How to transform a blob field into string lines (varchar) in SQL Firebird?

Latest Comments

Find us on Facebook

Follow Us on Instagram

logo

Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.

About us

  • 660 Pennsylvania Avenue Southeast #100 Washington, DC 20003
  • 0123456789
  • adsdelphi@gmail.com
  • Recent

  • Popular

  • Comments

  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • UniGUI Expiry Link Anonymizer

    By admin
    January 27, 2021
  • UniGUI Add CAPTCHA to the WEB project

    By admin
    January 26, 2021
  • UniGui. Unique hybrid of Delphi and JS

    By admin
    January 26, 2021
  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • Amazing Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

    By admin
    August 13, 2020
  • Critical Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

    By admin
    September 4, 2020
  • Setting up the IDE for your first Android Application in Delphi

    By admin
    September 7, 2020

Follow us

Find us on Facebook

© Copyright Delphifan Forum. All rights reserved.