delphi valuelisteditor控件的使用

delphi valuelisteditor控件的使用
2010-04-21 16:49

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
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值