Programming an event of click on the button “OK” of form Form2.in component Button1 property Caption = “OK”.Īs a result, form will have view as shown in Figure 7.įig.in component Label1 property Caption = “ Result = “.After that, form will look like as a dialog window.Īdditionally, we make setting components Label1 and Button1 of form Form2: The next step is set such properties of form Form2 using “Object Inspector”: To do this, first, we need to select form Form2. Let’s set up some properties of form Form2. The newly created form with placement of components We place on the form Form2 such components:Īs a result, two objects (variables) with names “Label1” and “Button1” will be created.Īlso, you need correct the size of form using mouse.Īs a result, the form Form2 will have view as shown in Figure 6.įig. In this file is described information about settings of form: form size, background color, text color, font settings and so on. Moreover, the file “ Unit2.dfm” will be created. Will be proposed to save the file of module of form as “ Unit2.cpp“.
5).Īfter calling the command of saving File -> Save All The object (variable) named “Form2” corresponds to the new form (Fig. 4): File -> New -> Form C++ BuilderĪs a result, the window of newly created form will be showed. To create a new form you need choose following command (Fig. The new form will be called after pressing on the button “Calculate”. In the new form you can output the result of calculation. To do this you need to select the form (component Form1) and in the property Caption enter the text “Volume of prism”.Īfter the changes and adjusting the size of components the application form has view as shown in Figure 3.
Property “Name” of main form of applicationįrom tab Standard you need to place on the form such components (Fig. In Object Inspector you can change the form’s name with the help of property Name (Fig. Developing the main form of application.Īt present, we have the main form of application named “ Form1“.The project name leave as “ Project1.cbproj“. The name of module of main form leave as is – “ Unit1.cpp“. ProgressĬreate the new project as “ VCL Form Application“.
To get the window of result we need create a new form. The result must be outputted as a separate window. Where V– volume of the prism, S 0 – area of basis., h– the length of prism height. The formula of volume of prism is following: An example of creating and calling a new form from main form of application in C++ Builderĭevelop the application, that calculates a volume of a prism.