
07.05.2014, 12:42
|
 |
Профессионал
|
|
Регистрация: 06.08.2012
Адрес: Кривой Рог
Сообщения: 1,791
Версия Delphi: Delphi 7, XE2
Репутация: 4415
|
|
Цитата:
Сообщение от Dagmanor
Код:
type TCalendarGrid = class(TMGrid)
FConnection: TFBConnectionInterface;
FDBPath:String;
public
EventMass : array[0..11] of TMonthEventArray;
constructor Create(AOwner: TComponent)
property DBPath:String read FDBPath write FDBPath;
end;
Как можно сделать событие OnChange для DBPath. (как у TEdit)
Используется Delphi 7 .
|
Примерно так:
Код:
type
TCalendarGrid = class(TMGrid)
private
FDBPath: String;
FOnChange: TNotifyEvent;
procedure SetDBPath(const Value: String);
public
property DBPath: String read FDBPath write SetDBPath;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
implementation
{ TCalendarGrid }
procedure TCalendarGrid.SetDBPath(const Value: String);
begin
if FDBPath <> Value then
begin
FDBPath := Value;
if Assigned(OnChange) then OnChange(Self);
end;
end;
|