Tips:
1. Adding an item to a group
// add something in the first group
with
AddItem(Groups[0])
do
begin
Add('633669');
Add(datetostr(now+1));
Add('Development
TPlanner/TDBPlanner');
end;
2. Programmatically changing an item's text
in a group
with
AdvOutlookList1
do
begin
// this changes column 0 & 1 text of item 1 in group 0
Groups[0].ChildItem[1].Strings[0]
:=
'111111';
Groups[0].ChildItem[1].Strings[1]
:=
datetostr(now);
Invalidate;
end;
3. Inserting a new child item at a position
in a group
with
AdvOutlookList1.Groups[0].InsertChild(1)
do
begin
// this inserts a new item in the first group after the first item
Add('52256');
Add((DateToStr(now-4));
Add('Update
website');
end;
4. Programmatically changing a group node
state
AdvOutlookList1.Groups[0].Expanded
:=
false;
5. Associating an object with an AdvOutlookList item
proceduree
TForm1.AdvOutlookList1ItemClick(Sender:
TObject; Item:
POGLItem;
Column: Integer);
begin
// show the value of the object assigned to the item
clicked
showmessage(inttostr(integer(item.ItemObject)));
end;
procedure TForm1.FormCreate(Sender:
TObject);
begin
with advoutlooklist1.AddGroup('group')
do
begin
AddChild.Add('item
1');
// assign the object to the item
ChildOGLItem[0].ItemObject
:= TObject(1);
// assign the
object to the item
AddChild.Add('item
2');
ChildOGLItem[1].ItemObject
:= TObject(2);
end;
end;
|
Программирование для чайников.
|