Peter Kiers
asked on
Help needed with TreeView
Dear Experts,
I want to use a treeview, but i don't know nothing about it.
And i need to make my treeview working asap.
So there will be lots of points to be earned.
I have 2 buttons on the toolbar, one is for to create a node as a folder in the treeview
and 1 is to create a file in a treeview. For every node there is a window appearing
where the user can enter the filename or foldername.
How can I do that?
Greeting, PeterKiers
Example.jpg
I want to use a treeview, but i don't know nothing about it.
And i need to make my treeview working asap.
So there will be lots of points to be earned.
I have 2 buttons on the toolbar, one is for to create a node as a folder in the treeview
and 1 is to create a file in a treeview. For every node there is a window appearing
where the user can enter the filename or foldername.
How can I do that?
Greeting, PeterKiers
Example.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for the solutions, it works great.
One litte question you have used a Edti1 on the form
where the user can enter a name for his file or folder.
but I want to have the edit1 on separate dialogform
is it possible to create one dynamicly or do i have
to create 2 forms.
P.
One litte question you have used a Edti1 on the form
where the user can enter a name for his file or folder.
but I want to have the edit1 on separate dialogform
is it possible to create one dynamicly or do i have
to create 2 forms.
P.
did you try
procedure TForm1.btnAddFolderClick(Sender: TObject);
var aText: string;
begin
if InputQuery('Folder', 'Enter a folder name', aText) then
AddItem(aText, 0, nil);
end;
ASKER
Thanks,
could you help me with the BtnFileClick
How do i have to implement it in the BtnFileClick procedure?
P.
could you help me with the BtnFileClick
How do i have to implement it in the BtnFileClick procedure?
P.
ASKER
Because i appreciate your help i will put it in a new question.
P.
P.
procedure TForm1.btnAddFileClick(Sen der: TObject);
var aText: string;
begin
if (TreeView1.Selected <> nil) and (Treeview1.Selected.ImageI ndex = 0) then
begin
if InputQuery('File', 'Enter a file name', aText) then
AddItem(aText, 1, TreeView1.Selectedl);
end else
ShowMessage('Select a folder in the treeview first.');
end;
var aText: string;
begin
if (TreeView1.Selected <> nil) and (Treeview1.Selected.ImageI
begin
if InputQuery('File', 'Enter a file name', aText) then
AddItem(aText, 1, TreeView1.Selectedl);
end else
ShowMessage('Select a folder in the treeview first.');
end;
lol, not fast enough i guess
ASKER
Examle.jpg