我写了个控件(从TPanel继承),需要在设计期根据载入的配置文件来动态生成新控件,同时可以保存本控件上的其他控件,用的是ComponentToString和StringToComponent来保存和载入。但是在设计期载入配置文件,生成的控件不能被编辑,和运行期一样。
请问如何才能在设计期动态生成可以被编辑的控件?就是说,在设计期生成设计期的控件。
谢谢
请问如何才能在设计期动态生成可以被编辑的控件?就是说,在设计期生成设计期的控件。
谢谢
解决方案 »
- 在注册表里写了自动运行程序的路径,为什么还不行?
- 在DELPHI裡Ctrl+F7/Ctrl+F8/Ctrl+F10的值是????
- 调用DLL中的窗体,怎样动态创建唯一窗体?
- 怎样控制windows右键弹出菜单的某个子项?
- [100分请教]公司实习初学Delphi,问几个DBGrid的菜问题,请大家帮忙!
- 请问在不用任何第三方控件的情况下....
- 谁知道在DELPHI中怎么用汇编
- 现在还有人用Delphi吗
- 大侠大侠快快来,帮帮小弟一个忙
- 谁有delphi5.0的安装序列号?急!很急!!!!
- 如何将2006-06-10转换为二00六年六月十日这种格式?
- 各位大哥:我想完成从txt文件中提取一个特定的字符串,如何完成,,,急急!!!!!!
var
Count, Size, I, J : Integer;
PropInfo : PPropInfo;
PropData : PTypeData;
PropValue : string;
PropEdit : TPropEditor;
PropObject : TComponent;
begin
Count := GetPropList(Component.ClassInfo, tkProperties, nil);
Size := Count * SizeOf(Pointer);
FreeMem(FPropList);
GetMem(FPropList, Size);
Count := GetPropList(Component.ClassInfo, tkProperties, FPropList);
ClearPropEditors;
for I := 0 to Count - 1 do
begin
PropInfo := FPropList^[I];
PropEdit := nil;
if IsPublishedProp(Component, PropInfo^.Name) then
begin
PropEdit := CreatePropEditor(Component, FOwnerComponent, PropInfo^.Name);
if Assigned(PropEdit) then
begin
FPropEditorList.Add(PropEdit);
//PropValue := GetPropValue(Component, PropInfo^.Name);
PropValue := PropEdit.Value;
VEdit.Strings.Add(Format(VStr, [PropInfo^.Name, PropValue]));
SetPropEdit(PropEdit, VEdit, VEdit.Strings.Count - 1);
end;
end;
end;
end;
比如ClearPropEditors、CreatePropEditor这些是你的自定义过程吧?
都请贴一下啊,谢谢!
CSDN怎么这样了啊~~这么多天都没人理~~~
5555555555~~~~~~~~~~~~~~~~~