
25.07.2013, 13:19
|
 |
Начинающий
|
|
Регистрация: 10.02.2013
Сообщения: 197
Версия Delphi: XE3
Репутация: -624
|
|
Вот так чтоли
Код:
Type TButtonLabelClick=(lcYes, lcNo);
Function ShowDialogYesNo(TextOkno, TextMemo, TextYesButton, TextNoButton:String;
TextColorYesButton, TextColorNoButton, TextColorTenYesButton, TextColorTenNoButton:TColor;
ColorYesButton, ColorNoButton:TColor):TButtonLabelClick;
var
Form2: TForm2;
ColorYesLbl, ColorNoLbl:TColor;
TextColorYesLbl, TextColorNoLbl, TextColorTenYesLbl,TextColorTenNoLbl:TColor;
implementation
{$R *.dfm}
Function ShowDialogYesNo(TextOkno, TextMemo, TextYesButton, TextNoButton:String;
TextColorYesButton, TextColorNoButton, TextColorTenYesButton, TextColorTenNoButton:TColor;
ColorYesButton, ColorNoButton:TColor):TButtonLabelClick;
begin
Form2.Caption:=TextOkno;
Form2.Memo1.Text:=TextMemo;
Form2.Label1.Caption:=TextYesButton;
Form2.Label2.Caption:=TextNoButton;
Form2.Label1.Font.Color:=TextColorYesButton;
Form2.Label2.Font.Color:=TextColorNoButton;
Form2.Label1.ShadowColor:=TextColorTenYesButton;
Form2.Label2.ShadowColor:=TextColorTenNoButton;
Form2.Label1.Color:=ColorYesButton;
Form2.Label2.Color:=ColorNoButton;
//|||||||||||||||||||||||||||\\
If Form2.ShowModal=mrYes then
Result:=lcYes
else Result:=lcNo;
end;
procedure TForm2.Label1Click(Sender: TObject);
begin
Form2.ModalResult:=mrYes;
end;
procedure TForm2.Label1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Label1.TextStyle:=tsShadow;
end;
procedure TForm2.Label1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Label1.TextStyle:=tsNormal;
end;
procedure TForm2.Label2Click(Sender: TObject);
begin
Form2.ModalResult:=mrNo;
end;
procedure TForm2.Label2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Label2.TextStyle:=tsShadow;
end;
procedure TForm2.Label2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Label2.TextStyle:=tsNormal;
end;
|