Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

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
Avatar of Peter Kiers
Peter Kiers
Flag of Netherlands image

ASKER

send the wrong picture...
Examle.jpg
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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;

Open in new window

Thanks,
could you help me with the BtnFileClick
How do i have to implement it in the BtnFileClick procedure?

P.

Because i appreciate your help i will put it in a new question.

P.
procedure TForm1.btnAddFileClick(Sender: TObject);
var aText: string;
begin
  if (TreeView1.Selected <> nil) and (Treeview1.Selected.ImageIndex = 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;
lol, not fast enough i guess