CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Delphi >  VCL组件开发及应用

这是个什么错误Unable to expand?

楼主nnnnyyyy(海洋之心)2006-03-13 20:19:03 在 Delphi / VCL组件开发及应用 提问

 
  我想给控件加一个像font那样的属性。就是前面有个加号点开后里面可以填的。但是现在点开后会报错Unable   to   expand?用的是类  
   
      TPosition   =   class   {************************************************方位结构类}  
          private  
          {   Private   declarations   }  
              FLeft:   integer;   //左起点  
              FTop:   integer;     //右起点  
              FWidth:   integer;   //长度  
              FHeight:   integer;   //高度  
              FAutoSize:   Boolean;   //自适应  
          protected  
          {   Protected   declarations   }  
   
          public  
          {   Public   declarations   }  
              //constructor   Create;  
   
              //destructor   Destroy();   override;  
          published  
          {   Published   declarations   }  
              property   Left:   integer   read   FLeft   write     FLeft;  
              property   Top:   integer   read   FTop   write   FTop;  
              property   Width:   integer   read   FWidth   write   FWidth;  
              property   Height:   integer   read   FHeight   write   FHeight;  
              property   AutoSize:   Boolean   read   FAutoSize   write   FAutoSize;  
          end;  
   
  constructor   TPosition.Create;  
  begin  
      FLeft   :=   0;  
      FTop   :=   0;  
      FWidth   :=   0;  
      FHeight   :=   0;  
      FAutoSize   :=   False;    
  end;  
   
  destructor   TPosition.Destroy;  
  begin  
   
      inherited;  
  end;  
  ......  
          FPicturePoistion:   TPosition;   //图片位置  
   
  ......  
          property   PicturePoistion:   TPosition   read   FPicturePoistion   write   FPicturePoistion;  
   
   
   
  constructor   TSpreadPanel.Create(AOwner:   TComponent);  
  begin  
      inherited   Create(AOwner);  
   
      FPicture   :=   TPicture.Create();  
      FPicturePoistion   :=   TPosition.Create;  
       
      //初始化各值  
      Color   :=   RGB(234,   247,   255);  
      DrawBorder   :=   True;  
      BevelOuter   :=   bvNone;  
      BorderColor   :=   clBackground;  
   
      Repaint;  
  end;  
   
  destructor   TSpreadPanel.Destroy;  
  begin  
      FPicture.Free;  
      FPicture   :=   nil;  
   
      FPicturePoistion.Free;  
      FPicturePoistion   :=   nil;  
       
      inherited;  
  end; 问题点数:80、回复次数:2Top

1 楼netfly(支点)回复于 2006-03-13 23:20:48 得分 50

TPosition   =   class   (TPersistent)Top

2 楼Kevin_Lmx(繁华阅尽)回复于 2006-03-14 00:26:55 得分 30

类似于Font、Items等属性,必须使用属性编辑器(PropertyEditor),才能够产生对话框或者枚举列表。楼主可以查询PropertyEditor或者RegisterPropertyEditor,得到相关帮助,我相信这些资料应该随处可见。Top

相关问题

  • 为什么会连接错误[Linker Fatal Error] Fatal: Unable to open file 'EHLIBB60.LIB'
  • 什么错误???
  • 什么错误?
  • 什么错误???
  • 什么错误?
  • 什么错误
  • 为什么出现"unable to load....-找不到指定的程序"这样的错误?
  • 请教unable to allocate 8704 bytes of shared memory 是什么错误,如何改正?
  • 小弟初学JBuilder,请问URL: Unable to open location: Socket is not connected: connect是什么错误啊?
  • 小弟初学JBuilder,请问URL: Unable to open location: Socket is not connected: connect是什么错误啊?

关键词

  • fheight
  • fautosize
  • fleft
  • fwidth
  • ftop
  • tposition
  • integer
  • declarations
  • read
  • property

得分解答快速导航

  • 帖主:nnnnyyyy
  • netfly
  • Kevin_Lmx

相关链接

  • Delphi类图书
  • Delphi类源码下载
  • Delphi控件下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo