Есть пример программки с авторизацией, простейший.
Она, работает но проблема в том, что если откроется окно приветствие, то после закрытия его, форма закроется а приложение будит весеть в задачах.
В чем тут проблема?
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Const
login='vasya';
pass='pass';
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if (Edit1.Text=login) and (Edit2.Text=pass)
then
begin
Form2.Show;
Form1.Visible:=false;
end
else
ShowMessage('Ошибка!');
end;
end.
Код:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.