请问AddObject(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode;
的具体用法,ptr可以对应数据库中的一条记录吗?
ttreeveiw;Ttreenode;Ttreenodes的关系是什么。
的具体用法,ptr可以对应数据库中的一条记录吗?
ttreeveiw;Ttreenode;Ttreenodes的关系是什么。
解决方案 »
- memo赋值时候,str:= 'abc' + #13 + #10 + 'good'怎么不能显示成两行呢?
- 数据库插入的问题!急,在线等
- Edit.text和网络捕获的数据内容写入数据库
- 急!!!!!!!!!是什么原因产生这个错误 A CALL TO AN OS FUNCTION FAILED
- 回答问题就上分了!
- 请问如何将字符串‘2003年8月5日’转换成日期型呢?我用strtodatetime出错!
- 初学者问题:哪里配置DELPHI IDE环境?? 在线等待
- 老鱼,小昂,千俩狂死郎,你们还在吗,接分
- 鼠标捕捉的高级问题
- 请教截取字符串的函数。
- 与"is not a valid identifier"相关的问题。回复均有分。总分100。
- 向各位大虾请教个很弱智的问题!!
PMyRec = ^TMyRec;
TMyRec = record
FName: string;
LName: string;
end;Assuming these types are used, the following code adds a node to TreeView1 as the last sibling of a specified node. A TMyRec record is associated with the added item. The FName and LName fields are obtained from edit boxes Edit1 and Edit2. The Index parameter is obtained from edit box Edit3. The item is added only if the Index is a valid value.procedure TForm1.Button1Click(Sender: TObject);var
MyRecPtr: PMyRec;
TreeViewIndex: LongInt;
begin
New(MyRecPtr);
MyRecPtr^.FName := Edit1.Text;
MyRecPtr^.LName := Edit2.Text;
TreeViewIndex := StrToInt(Edit3.Text);
with TreeView1 do
begin
if Items.Count = 0 then
Items.AddObject(nil, 'Item' + IntToStr(TreeViewIndex), MyRecPtr)
elseif (TreeViewIndex < Items.Count) and (TreeViewIndex >= 0) then
Items.AddObject(Items[TreeViewIndex], 'Item' + IntToStr(TreeViewIndex), MyRecPtr); end;
end;After an item containing a TMyRec record has been added, the following code retrieves the FName and LName values associated with the item and displays the values in a label.procedure TForm1.Button2Click(Sender: TObject);begin
Label1.Caption := PMyRec(TreeView1.Selected.Data)^.FName + ' ' +
PMyRec(TreeView1.Selected.Data)^.LName;
end;delphi 帮助中的例子
主要是对data:请解释一下,不太明白!!!