delphi valuelisteditor控件的使用

1.获取valuelisteditor的value的值:

   str := valuelisteditor.value['top']; top为key的内容。

2. 获取valuelisteditor的key值:

   str:=valuelisteditor.key[0]; 获取第0 个key值。

3.插入一行数据

valuelisteditor.InsertRow('pp','pp1',true);
//第一个参数:key的值(字符串型)
//第二个参数: value的值(字符串型)
//第三个参数:是否追加,TRUE在最后一行加上一行,FALSE在获得焦点的一行的后面加上一行.

4. 删除一行数据

ValueListEditor1.DeleteRow(2);

5.如何选择行列
 当前选的行通过currrow:=Valuelisteditor1.row获得
 当前选的列通过currcol:=ValueListEditor1.col获得

6.ValueListEditor,用string.clean清除!

7.一个key值,多个value.

procedure TForm1.ValueListEditor1GetPickList(Sender: TObject;
const KeyName: String; Values: TStrings);
var
    str:string;
begin
    str:=self.ComboBox1.Text;
    str:=leftStr(str,4);
    if str='Edit' then
    begin
        if KeyName='BorderStyle' then
        begin
            Values[0]:='bssingle';
            values[1]:='bsnone';
        end;
    end;
end;

另一个方法

ValueListEditor1.ItemProps[0].PickList.Add('a1');
ValueListEditor1.ItemProps[0].PickList.Add('a2');
ValueListEditor1.ItemProps[0].PickList.Add('a3');

第三种方法:

    Index := ValueListEditor1.InsertRow('Size', '9', True);
     with ValueListEditor1.ItemProps[Index - 1].PickList do
    begin
Add('9');
Add('11');
Add('13');
Add('20');
end;

8。加入。。按钮

Index := ValueListEditor1.InsertRow('Color', 'clRed', True);
ValueListEditor1.ItemProps[Index - 1].EditStyle := esEllipsis;

procedure TForm1.ValueListEditor1EditButtonClick(Sender: TObject);
var
nRow: Integer;
begin
nRow := ValueListEditor1.Row;
case nRow of
2:
with TColorDialog.Create(nil) do
begin
if Execute then
ValueListEditor1.Cells[2, nRow] := ColorToString(Color);
end;
end;
end;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Delphi DevExpress控件是Devexpress公司旗下的用户界面套包,包含了数据录入、图表、数据分析、导航、布局等多种控件,可以帮助开发者创建出优秀的用户体验和高影响力的业务解决方案。同时,Delphi DevExpress控件还可以利用开发者现有的VCL技能为未来构建下一代应用程序。\[1\]\[2\] 要在Delphi使用DevExpress控件,您需要按照以下步骤进行操作: 1. 下载并安装DevExpress VCL Controls套件。 2. 在Delphi中创建一个新项目。 3. 在项目中添加DevExpress控件单元,例如dxShellControls。 4. 在您的代码中使用DevExpress控件的类和方法来实现您的需求。 需要注意的是,如果您在C++Builder项目中使用DevExpress控件,并且禁用了"Disable incremental linker"和"Link with runtime packages"选项,那么在重新构建应用程序时可能会出现错误。\[3\] 希望这些信息对您有所帮助! #### 引用[.reference_title] - *1* *3* [Delphi开发工具DevExpress VCL全新发布v21.1.5](https://blog.csdn.net/AABBbaby/article/details/120409370)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Delphi开发工具DevExpress VCL 2021年新版首发(附高速下载)](https://blog.csdn.net/AABBbaby/article/details/113307597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值