zoukankan      html  css  js  c++  java
  • ValueListEdit控件的用法

    valuelisteditor控件的使用

    valuelisteditor控件的使用
    ━━━━━━━━━━━━━━━━━━━━━━━━━━

    1 如何添加行:insertrow函数

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

    2 最重要的几个属性:

    1)keys
      用它可以修改对应KEY的值,如你想修该第四行的值.
      ValueListEditor1.Keys[4]:='i love you' ;
      //注意,你的参数不能超过你的控件已有的行数.

    2)VALUES
      用它是改变VALUE列值的有效手段.
      ValueListEditor1.Values['KEY列的值']:='dongwei';
      //用于已知道KEY列的值修改VALUE列的值.

    3)KEYOPTIONS
      ValueListEditor1.KeyOptions:=[keyedit,..,..];
      ValueListEditor1.KeyOptions:=[];

    BCB下的使用:

    添加允许编辑:ValueListEdit->KeyOption = ValueListEdit1->KeyOptions<<KeyEditing;

    去除允许编辑:ValueListEdit->KeyOption = ValueListEdit1->KeyOptions>>KeyEditing;

    直接这样写:ValueListEdit1->KeyOptions<<KeyEditing;对于ValueListEdit控件是不会有效果的,这一点与TStringGrid控件不可。
    TStringGrid 是从 TCustomDrawGrid-->TCustomGrid 继承的, 设置其 Options 属性, 是调用了TCustomGrid 的 SetOptions方法。而 ValueListEditor 是从 TCustomDrawGrid 继承来的, 设置其 Options 属性, 是调用了 TValueListEditor 的 SetOptions 方法。所以有差异。

      //它有四个可选参数,可以全选,也可以用一部分,用逗号隔开.他是个集合类型的.
      //第二行是使他的四个参数全部失效,具体各个参数具体应用的环境,自己去侃侃它自带的帮助吧,因为我的英语水平很臭.
      //keyedit//可以编辑KYE列的值
      keyadd   //可以添加KEY,VALUE对,但KEYEDIT要包含在内(使用向下箭头)
      keydelete//可以删除KEY,VALUE对(我却发现不能,可能我翻译有问题,或者水平&&&)
      keyunique//不能添加两组相同的KEYVALUE对.

    4)DeleteRow
      ValueListEditor1.DeleteRow(2);
      //删除一指定行

    5)free
      释放掉

    6)titlecaptions属性
      ValueListEditor1.TitleCaptions.Append('我的世界');//在固定行追加标题,该例追加了名为'我的世界'的一列
      ValueListEditor1.TitleCaptions.Strings[0]:='美丽的世界';//修改第一列的固定行标题

    7) colcount
      添加列
      ValueListEditor1.ColCount:=3;

      ValueListEditor1.Row:=1;
      ValueListEditor1.KeyOptions:=[keyedit];
      ValueListEditor1.Keys[1]:='i love you' ;
      ValueListEditor1.Values['i love you']:='dongwei';
      ValueListEditor1.InsertRow
      ValueListEditor1.Keys[ValueListEditor1.RowCount-1]:=''

    8)清空ValueListEdit

    9)下拉框:

             VLEdit->ItemProps["1"]->PickList->Add("ON");
             VLEdit->ItemProps["1"]->PickList->Add("OFF");

    10)清空:

    VLEdit->Strings->Clear();

    11)VLEdit默认至少为2行:头和一个空行


  • 相关阅读:
    Chapter 2 Sockets and Patterns【选译,哈哈】 Part 2 Messags Partterns
    WPF动态更改Image控件图片路径
    Chapter 2 Sockets and Patterns【选译,哈哈】 Part 1
    Chapter 2 Sockets and Patterns【选译,哈哈】 Part 4 Handling Errors and ETERM
    Chapter 2 Sockets and Patterns【选译,哈哈】 Part 3 Messags Partterns
    Visual Studio 2008 测试项目无法正常显示解决办法
    Ext.NET控件介绍—Form控件
    ThoughtWorks(中国)程序员读书雷达
    Ext.net 中日期格式的计算
    Sql 分割 键值对字符串 得到某值对应的名称
  • 原文地址:https://www.cnblogs.com/actionke/p/4192636.html
Copyright © 2011-2022 走看看