Вверх ↑
Ответов: 9906
Рейтинг: 351
#1: 2017-09-17 12:46:29 ЛС | профиль | цитата
Tri-j писал(а):
не помогает

Исходя из этого:
    property DefaultBtn: Boolean index 13
{$IFDEF F_P} read GetDefaultBtn
{$ELSE DELPHI} read fDefaultBtn
{$ENDIF F_P/DELPHI} write SetDefaultBtn;
{* |<#button>
|<#bitbtn>
Set this property to true to make control clicked when ENTER key is pressed.
This property uses OnMessage event of the parent form, storing it into
fOldOnMessage field and calling in chain. So, assign default button
after setting OnMessage event for the form. }
Надо делать по другому, вроде бы:
procedure THIButton.Init;
begin
Control := NewButton(FParent,_prop_Caption);
Control.OnClick := _OnClick;
// Control.DefaultBtn := _prop_DefaultBtn;
Control.Style := Control.Style or BS_MULTILINE;
inherited;
if _prop_DefaultBtn then Control.DefaultBtn := true; // moved down by Galkov...
end;

Но я не очень-то и проверял... А почему нет CancelBtn, если есть DefaultBtn - вообще не знаю...
карма: 9

1
Голосовали:3042
Редактировалось 4 раз(а), последний 2017-09-17 13:10:04