How to update the Delphi Object Inspector?

Following on from this question I recently posted: Can a Component Editor be executed on multiple components?

I have created a ComponentEditor for a new component that when executed shows a TOpenDialog to select a configuration File. When a File is loaded I read the data and copy the values to the calling component (which is Component as this is a TComponentEditor).

There are no problems at all, except that the Object Inspector is not updating to reflect the newly changed values - It only updates when clicking back on the component in the Designer.

It might not seem like such a big a deal, but I need the Object Inspector to update itself somehow so that I can see the properties have changed successfully (without having to switch focus back to the control).

So, is there some way of letting Delphi know that it should update/refresh the Object Inspector? I


根据需要修改组件后,组件编辑器需要调用IDesigner.Modified()方法,例如:

procedure TMyComponentEditor.ExecuteVerb(Index: Integer);
var
  Dlg: TOpenDialog;
begin
  ...
  Dlg := TOpenDialog.Create(nil);
  try
    ...
    if Dlg.Execute then
    begin
      ...
      Designer.Modified;
    end;
  finally
    Dlg.Free;
  end;
  ...
end;
链接地址: http://www.djcxy.com/p/63136.html

上一篇: 创建自定义TSetProperty属性编辑器

下一篇: 如何更新Delphi对象检查器?