delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
有没有一种控件可以实现如下功能???在线等! VCL组件开发及应用
http://www.delphi2007.net/DelphiVCL/html/delphi_20061220150258245.html
在dbcombobox中可不可以  
           
        显示值                   提交值  
            男                           1    
            女                           0  
   
  在选择时显示的是显示值,可是提交post时,提交的是int型的0或1;  
  其中dbcombobox只联接一个数据源!不用在listdatastore中联接其它数据源来对应提交值!  
   
  (注:只联接一个数据源!)  
   
 

没有。只能用dblookupcombobox

用数据集字段的事件  
   
  procedure   TForm1.ADOQuery1SexGetText(Sender:   TField;   var   Text:   string;  
      DisplayText:   Boolean);  
  begin  
      case   Sender.AsInteger   of  
          0:   Text   :=   '女';  
          1:   Text   :=   '男';  
      end;  
  end;  
   
  procedure   TForm1.ADOQuery1SexSetText(Sender:   TField;   const   Text:   string);  
  begin  
      if   Text   =   '女'   then  
          Sender.Value   :=   0  
      else   if   Text   =   '男'   then  
          Sender.Value   :=   1;  
  end;  
 

 
  多谢了!老大啊,你答了我发的两个贴的同一个题!我的分也只好给你加一次了!在那个贴子中已经结了!

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