unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls;

type
  TFMain = class(TForm)
    Panel1: TPanel;
    Shape: TShape;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    DBGrid1: TDBGrid;
    procedure FormShow(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FMain: TFMain;

implementation

uses DataModule;

{$R *.dfm}

procedure TFMain.BitBtn1Click(Sender: TObject);
begin
	Close();
end;

procedure TFMain.FormActivate(Sender: TObject);
begin
	Shape.Brush.Color := clRed;

	if DM.ADOConnection1.Connected then
   begin
      Shape.Brush.Color := clGreen;
   end;
end;

procedure TFMain.FormShow(Sender: TObject);
begin
   DBGrid1.Align := alClient;
end;

end.
