Registriert seit: 6. Apr 2011
Ort: Berlin
3.070 Beiträge
Delphi 10.4 Sydney
|
AW: TabControl und Events
9. Jul 2018, 09:46
Zu 1. aus der Unit ComCtrls:
Delphi-Quellcode:
...
procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; // <--- CN_ anstatt WM_
...
Delphi-Quellcode:
procedure TCustomTabControl.CNNotify(var Message: TWMNotify);
begin
with Message do
case NMHdr.code of
TCN_SELCHANGE:
Change;
TCN_SELCHANGING:
begin
Result := 1;
if CanChange then Result := 0;
end;
end;
end;
Change wird in der abgeleiteten Klasse TPageControl aufgerufen:
Delphi-Quellcode:
procedure TPageControl.Change;
var
Form: TCustomForm;
begin
if TabIndex >= 0 then
UpdateActivePage;
if csDesigning in ComponentState then
begin
Form := GetParentForm(Self);
if (Form <> nil) and (Form.Designer <> nil) then
Form.Designer.Modified;
end;
inherited Change;
end;
|