comprotery.pas

来自「所有delphi的入门例子」· PAS 代码 · 共 61 行

PAS
61
字号
unit comProtery;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses SysUtils, Windows, Messages, Classes, Graphics, Controls, StdCtrls,
  ExtCtrls, Forms, ComServ, ComObj, StdVcl, AxCtrls, ComCtrls;

type
  TPropertyPage1 = class(TPropertyPage)
    Label1: TLabel;
    Label2: TLabel;
    dpiker: TDateTimePicker;
    cmbStart: TComboBox;
    chkToday: TCheckBox;
    chk3d: TCheckBox;
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
    procedure UpdatePropertyPage; override;
    procedure UpdateObject; override;
  end;

const
  Class_PropertyPage1: TGUID = '{995533D6-25F6-4A5A-A36B-822C60F700A3}';

implementation

{$R *.DFM}
//uses XCalendar_Tlb;

procedure TPropertyPage1.UpdatePropertyPage;
begin
  { Update your controls from OleObject }
  chk3d.Checked :=OleObject.ctl3d;
  chktoday.Checked :=oleobject.usecurrentDate;
  cmbstart.ItemIndex := oleobject.startofweek;
  dpiker.Date := oleobject.calendardate;

end;

procedure TPropertyPage1.UpdateObject;
begin
  { Update OleObject from your controls }
  oleobject.ctl3d := chk3d.Checked;
  oleobject.usecurrentDate := chktoday.Checked;
  oleobject.startofweek := cmbstart.ItemIndex;
  oleobject.calendardate := dpiker.Date;
end;

initialization
  TActiveXPropertyPageFactory.Create(
    ComServer,
    TPropertyPage1,
    Class_PropertyPage1);
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?