Chapter One Introduction to-delphi (II.) (1)

Source: Internet
Author: User

1.2.3 Design a simple user interface
Start working from a blank form first. We will design a simple program: open a window on the screen, there is a frame in the window, with three buttons to change the shape of the frame, and then use an icon button to make the frame color settings, through the Color Editing dialog box to choose which color to become.

Use the File New Application menu item on the menu to generate a new project file. At this point, the form shown in Figure 1.2 appears on the screen. the selection part into the form

A component (Component) is a key element in establishing a Delphi application. Delphi provides users with a wealth of parts library, both visual parts (such as editing boxes, buttons), and so on, there are not visible parts (such as system timer, datasheet, etc.). They are arranged on each page of the component panel, respectively, by function.

Move the mouse to the component panel, "hesitation" on the part button for one or two seconds, a small yellow box will pop up, write the name of the part, we call it a hint (Hint). When you click the left arrow on the part you want to select, the part button is pressed to indicate that the part is currently selected. Then, move the mouse over the form, press the left button, and the part is placed in the form. The outline of the widget will show eight small black squares called the sizing regulator (sizing Handles). It can also indicate that the object is in the current editing state, in addition to being used by the user to resize the dimension. At this point, press the ' delete ' key to remove the part.

On the component panel, click on the "Additional" page tab, switch to Additional page, and then move the mouse, one by one to see the hint method to view the name of the part, find the "Shape" part (its icon is round, square, triangular three geometry), Place it to the left of the form.

Press the "Standard" tab again to locate the button part (the icon has an OK button on it). Delphi allows you to add multiple parts of the same type without having to pick them up every time you go to the parts palette. Hold down the Shift key while clicking the left mouse button on the button part, where the button part is pressed and has a blue border indicating that it has been selected for fixing. Clicking the left arrow in the three position on the right of the form will place three identical button parts. Move the mouse cursor to the arrow icon to the left of the part palette, which is the deselect button, and it is not prompted. When you press it, you will notice that the button widget buttons resume bouncing state. Otherwise, each time the left mouse click action on "Form1" causes a button part to be added.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.