unit MainForm;

interface

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

type
  TForm1 = class(TForm)
    Panel2: TPanel;
    btnCLOSE: TBitBtn;
    btnSTART: TBitBtn;
    procedure btnSTARTClick(Sender: TObject);
    procedure btnCLOSEClick(Sender: TObject);
  private
	 procedure Start_monitor();

  public

  end;

var
  Form1: TForm1;

implementation

uses SQLMonitor;
{$R *.dfm}

procedure TForm1.btnCLOSEClick(Sender: TObject);
begin
   Close();
end;

procedure TForm1.btnSTARTClick(Sender: TObject);
begin
   Start_monitor();
end;

procedure TForm1.Start_monitor();
var
   ret : Boolean;
   
begin
   ret := Assigned(FSQLMonitor);

   if not Ret then
   begin
      FSQLMonitor := TFSQLMonitor.Create(Application);
      FSQLMonitor.Show();
   end
   else begin
      FSQLMonitor.Show();
   end;
end;

end.

