TValueListEditor 和 TButtonedEdit 两个控件说明delphi
较新的Delphi有两个不太为人所知但很有趣的组件:TValueListEditor 和 TButtonedEdit
TValueListEditor用于输入一对键和值,TButtonedEdit最多可以选择两个按钮(左和右)

特别是第一个很有趣。两者都是时尚设计的样子。

在TValueListEditor中,您可以设置行为(即允许编辑等,列名称,绘图样式…)。此外,可以通过OnDrawCell进行自定义单元格绘图,这有时也很有用。

因此,如果我们通过LeftButton和RightButton属性将imagelist分配给TButtonedEdit,并设置可见性和按钮属性,我们可以编写最原始的行添加(使用右键TButtonedEdit)。
procedure TForm1.btn1RightButtonClick(Sender: TObject); begin lstValueListEditor.InsertRow(btn1.Text, IntToStr(Random(10)), True); end;
这是我们编辑任何文本的方式。这不一定是真正的坚果。幸运的是,我们有更多的机会。

procedure TForm1.FormCreate(Sender: TObject);
begin
lstValueListEditor.InsertRow('Text Položka', '', True);
lstValueListEditor.InsertRow('Klíč combo', 'val1', True);
with lstValueListEditor.ItemProps[1] do
begin
EditStyle := esPickList;
PickList.CommaText := 'val1,val2,val3';
end;
lstValueListEditor.InsertRow('Klíč tlačítko', 'hodnota', True);
with lstValueListEditor.ItemProps[2] do
begin
EditStyle := esEllipsis;
end;
end;
第一行是任意文本,第二行是列表中的选项选择,第三行是按钮。第三种情况是通过OnEditButtonClick操作按钮。

Datum: 2011-03-15 23:16:00
