문제

사용자 지정 구성 요소에 상자 / 대화 상자를 추가하고 싶습니다.작은 버튼을 만드는 방법 [...] 객체 검사기에 나타납니다.타임 구성 요소에 Picure 지정과 마찬가지로.

도움이 되었습니까?

해결책

다음과 유사한 속성을 정의해야합니다.

//: Información acerca del paquete de componentes
property AboutMe:TFAbout read FAboutG stored false;
.

tfabout 는 사용자가 "Object Inspector"의 속성을 클릭하면 사용자가 보려는 양식을 정의 할 수 있습니다.

또한 3 점으로 Buuton을보고 싶다면 "속성 편집기"를 등록해야합니다. ... |OI에서.

이것은 샘플 단위입니다 :

unit UTAboutProp;

interface

uses
  DesignIntf, DesignEditors;

type
  TAboutGProp = class(TPropertyEditor)
  public
    procedure Edit(); override;
    function GetValue(): string; override;
    function GetAttributes(): TPropertyAttributes; override;
  end;

implementation

uses
  SysUtils, FormAbout, UConstantes;

procedure TAboutGProp.Edit();
begin
  with TFAbout.Create(nil) do
  try
    ShowModal();
  finally
    Free();
  end;
end;

function TAboutGProp.GetValue(): string;
begin
  result := Format(GLIBSI_LBL,[GLIBSI_VERSION]);
  result := '1.0';
end;

function TAboutGProp.GetAttributes(): TPropertyAttributes;
begin
  result := [paDialog,paReadOnly];
end;

end.
.

에 대해서는 "등록"이 "등록 편집기"로만 휴식을 취하십시오.이것은 "링크" 에 중요합니다.

구성 요소를 등록하기위한 코드가있는 경우 등록 정보를 등록하기위한 코드를 추가하십시오.

  RegisterPropertyEditor(TypeInfo(TFAbout),nil,'',TAboutGProp);
.

에 관해서는

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top