6
A
回答
8
如果你的類被用作其他組件的屬性,要使用Object Inspector來調用你的對話框,那麼你必須實現並註冊自定義屬性編輯器,例如:
interface
uses
DesignIntf, DesignEditors;
type
TMyClassProperty = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
end;
procedure Register;
implementation
uses
MyClassUnit;
procedure TMyClassProperty.Edit;
begin
with TMyDialog.Create(nil) do
try
ShowModal;
finally
Free;
end;
end;
function TMyClassProperty.GetAttributes: TPropertyAttributes;
begin
Result := inherited GetAttributes + [paDialog];
end;
procedure Register;
begin
RegisterPropertyEditor(TypeInfo(TMyClass), nil, '', TMyClassProperty);
end;
+0
+1我誤解了這個問題 –
相關問題
- 1. 如何製作pentaho自定義組件?
- 2. 如何在製作克隆時複製自定義屬性
- 3. 控制自定義屬性
- 4. 屬性自定義控制
- 5. Custom ExtJs組件的自定義屬性
- 6. 自定義組件屬性類型
- 7. 自定義組件必需屬性
- 8. Netbeans自定義組件屬性
- 9. 在自定義組件屬性
- 10. 自定義控件中的組屬性
- 11. Android自定義組件屬性
- 12. 自定義控件中的屬性組
- 13. 自定義組件屬性LiveBindings
- 14. Qml定義自定義屬性組
- 15. 如何用組件定義屬性?
- 16. Vanilla Web組件自定義事件屬性和屬性
- 17. 如何在jsf中添加自定義組件的自定義屬性?
- 18. 如何使用WPF中的屬性製作自定義形狀?
- 19. 自定義文件屬性
- 20. jsf自定義組件聲明強制屬性
- 21. 帶註解的JSF自定義組件屬性屬性
- 22. 如何使用自定義組件屬性?
- 23. 如何處理android自定義組件中的@string屬性?
- 24. JSF自定義組件:如何獲取屬性<f:ajax />
- 25. 如何自定義屬性添加到組件
- 26. 如何通過名稱訪問自定義組件屬性?
- 27. 如何在自定義的delphi組件中實現stringlist屬性?
- 28. 如何進行動畫的自定義圖形組件屬性
- 29. 自定義組件dataGrid selectionMode作爲屬性
- 30. 在android中製作自定義組件
+1不知道爲什麼有人低估了一個很好的問題 –
@David:不知何故,最近Delphi的所有問題都沒有任何評論,因此得不到任何評論。也許有人不明白箭頭的用途是什麼? :) –