在Form的Object Inspector的Properties中有一个ActiveControl属性,
往Form里加上Button1那么ActiveControl的下拉菜单就有Button1,如果
再加上一个Button2,那么下拉菜单就有Buttton1和Button2了...如果自己写一个组件里面也要定义一个这样的属性,怎么来写(实现)呢?
往Form里加上Button1那么ActiveControl的下拉菜单就有Button1,如果
再加上一个Button2,那么下拉菜单就有Buttton1和Button2了...如果自己写一个组件里面也要定义一个这样的属性,怎么来写(实现)呢?
解决方案 »
- delphi5中没有定义PCardinal类型该怎么处理?
- {黄贴18禁}看看强人是怎么在不切掉自己小jj的情况下称出小jj的重量 !!!
- 如何实现像MSN那样,对方发送文件后,我这边的MEMO里面出现接收或拒绝字样,并可以点击实现功能??
- 请帮忙:QRRichText的问题。如何知道QRRichText的高度?
- 如何用程序给StringGrid1增加一行?
- 如何自定义stringgrid中的各行颜色?
- 如何将ADOQuery查询结果显示至DBGrid中去?
- 有关于数据库控件的问题
- KYLIX2企业版的问题
- 急:谁Delphi6下的压缩控件,delphi5的不能用了
- 怎样取得汉字的声母?
- 关于窗体的显示问题,各位帮忙,给很多分!
begin
if FActiveControl <> Control then
begin
if not ((Control = nil) or (Control <> Self) and
(GetParentForm(Control) = Self) and ((csLoading in ComponentState) or
Control.CanFocus)) then
raise EInvalidOperation.Create(SCannotFocus);
FActiveControl := Control;
if not (csLoading in ComponentState) then
begin
if FActive then SetWindowFocus;
ActiveChanged;
end;
end;
end;
VCL里面的,自己模仿着做慢慢能行的
TTest = class(TComponent)
private
FNewProp: TButton;
published
property NewProp: TButton read FNewProp write FNewProp;
end;