
06.04.2012, 08:44
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
uses Unit2, Unit3, Unit4, Unit5;
...
function Check(const User, Pass: String): TForm;
begin
if (User='админ') and (Pass='sysop') then Result:=Form2
else if (User='секретарь') and (Pass='masha') then Result:=Form3
else if (User='бухгалтер') and (Pass='nomoney') then Result:=Form4
else if (User='итд') and (Pass='anykey') then Result:=Form5
else Result:=nil;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
AForm: TForm;
begin
AForm:=Check(ComboBox1.Text, Edit1.Text);
if AForm=nil then ShowMessage('Oops')
else AForm.ShowModal;
end;
__________________
Пишу программы за еду.
__________________
|