delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
想建一个带分隔条的label 控件; Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiBase/html/delphi_20061206182116257.html
想建一个带分隔条的label   控件;  
   
  是竖式的分隔条,能不能实现?如何实现?  
   
 

用TBevel控件,复制到你的窗体上看看效果  
   
  object   Label1:   TLabel  
      Left   =   72  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label1'  
  end  
  object   Bevel1:   TBevel  
      Left   =   105  
      Top   =   192  
      Width   =   3  
      Height   =   13  
  end  
  object   Label2:   TLabel  
      Left   =   108  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label2'  
  end  
 

我在复制到unit1.pas   下以后,报错:  
   
  [Error]   Unit1.pas(52):   Declaration   expected   but   'OBJECT'   found  
   
   
   
  我是放在这地方的;  
  unit   Unit1;  
   
  interface  
   
  uses  
      Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms,  
      Dialogs,   DB,   ADODB,   Grids,   DBGrids,   ExtCtrls,   DBCtrls,   StdCtrls;  
   
  type  
      TFrmPMLR   =   class(TForm)  
          ADOConnection1:   TADOConnection;  
          ADOTable1:   TADOTable;  
          DataSource1:   TDataSource;  
          DBGrid1:   TDBGrid;  
          DBNavigator1:   TDBNavigator;  
          Label1:   TLabel;  
          Button1:   TButton;  
          Button2:   TButton;  
          procedure   Button1Click(Sender:   TObject);  
          procedure   Button2Click(Sender:   TObject);  
      private  
          {   Private   declarations   }  
      public  
          {   Public   declarations   }  
      end;  
   
  var  
      FrmPMLR:   TFrmPMLR;  
   
  implementation  
   
  {$R   *.dfm}  
   
  procedure   TFrmPMLR.Button1Click(Sender:   TObject);  
  var  
  NewString:   string;  
  begin  
              InputQuery('输入查询条件','查询品名为',   NewString);  
              ADOTable1.Locate('PM',NewString,[LoPartialkey]);  
  end;  
   
  procedure   TFrmPMLR.Button2Click(Sender:   TObject);  
    var  
  NewString:   string;  
  begin  
              InputQuery('输入过滤条件','过滤品名为       ',   NewString);  
              ADOTable1.Filter:='PM   like   '+''''+'%'+NewString+'%'+'''';  
              ADOTable1.Filtered:=true;  
   
  end;  
   
    object     Label1:   TLabel;  
      Left   =   72  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label1'  
  end  
  object   Bevel1:   TBevel  
      Left   =   105  
      Top   =   192  
      Width   =   3  
      Height   =   13  
  end  
  object   Label2:   TLabel  
      Left   =   108  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label2'  
  end  
   
      Left   =   72  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label1'  
  end  
  object   Bevel1:   TBevel  
      Left   =   105  
      Top   =   192  
      Width   =   3  
      Height   =   13  
  end  
  object   Label2:   TLabel  
      Left   =   108  
      Top   =   192  
      Width   =   32  
      Height   =   13  
      Caption   =   'Label2'  
  end  
   
   
   
   
  end.  
   
   
   
   
   
 

强烈鄙视问题解决后不结贴的人!  
  强烈鄙视技术问题解决后把贴子转移到非技术区的人!  
  鄙视你们!  
   
  http://community.csdn.net/Expert/topic/5216/5216675.xml?temp=.9262659

复制到你的窗体上  
  复制到你的窗体上  
  复制到你的窗体上  
  复制到你的窗体上  
   
  -_-!!!!!!  
   
  不是复制到你的单元中

晕倒

我是新手,原来创建对象的代码可以直接往窗体上粘贴呀!  
   
 

posted on 2009-04-22 10:45 delphi2007 阅读(186) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。