Create Delphi Windows Forms Application and Windows Form - MainForm.
 
 
 
 
1. Create Delphi Windows Forms Application

    
On the File menu , click  New. and then click Windows Forms Application. New Project - Project1 and New File name WinForm.pas appears.
                                              Form created:



On the View menu , click  Project Manager. In Project Manager appears all components created ...

                      Project Manager :



 Rename  the  components created ...

 On the View menu , click  Object Inspector. In Object Inspector modify the following ...

 
 1-  Project1 -  Windows Forms Application created
 

  Old New
File Name: Project1.bdsproj App-WF.bdsproj

   2-  WinForm.pas - the File name  created
 

  Old New
File Name: WinForm.pas MainForm .pas


   3 - T
WinForm-  Form  name created  
 

  Old New
Name: TWinForm TMainForm

                                                                Details, look:    Modify the  Properties of  TWinForm (WinForm.pas)   


         The codes  corresponding to the Windows Form created by system ....     File name - WinForm.pas

unit WinForm;

interface

uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;

type
TWinForm = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
public
constructor Create;
end;

[assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]

implementation

{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinForm.InitializeComponent;
begin
Self.Components := System.ComponentModel.Container.Create;
Self.Size := System.Drawing.Size.Create(300, 300);
Self.Text := 'WinForm';
end;
{$ENDREGION}

procedure TWinForm.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;

constructor TWinForm.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;

end.


                           
2. TheWindows Form -  Mainform,  design
 


   

  Classes used in this Form:
         System.Drawing, System.Collections, System.ComponentModel, System.Windows.Forms, System.Data, System.Resources, Borland.Vcl.SysUtils ;



 
Type of Controls used in this Form:
          MainMenu, Timer, PictureBox, Label and  StausBar

 
 1- Modify the  Properties of  TWinForm (WinForm.pas)   
  • Modify TWinForm (WinForm.pas) On the View menu , click  Object Inspector. In Object Inspector modify the following ...
     
  •   Old New
    Caption:
    Name:
    Icon:
    Menu:
    Maximizebox:
    StartPosition:
    Size:
    WinForm
    T
    WinForm
    (Icon)
    (none)
    True
    WindowsDefaultLocation
    300,300
    MainForm
    Main_Form
    (
    Icon)
    (none)
    False

    CenterScreen
    592,502

 

 Save the following files created ...
  • In C:, Create  the Folder App-WFDelphi (C:\App-WFDelphi),
  • On the File menu , click  Save As, the Save Mainform As dialog box appears... In this Folder save  Form - Mainform and  Application App-WF  

 

 Add Folder and  picture files ...

 

 Add the following controls to ...

 

 The codes  corresponding ...

 

 

 


Previous Home
2
Next