Board index » delphi » TreeView - Select

TreeView - Select

I'm going mad with this TTreeView-component!
My actual problem:
If I try to delete the selected Node, I get
an error message, if no one is selected.
Thats OK - I would do the same.
But I have found no proper way, to check out
IF there is a selected node.

Any Idea out there?

Thanks
Christof Schmidt
si...@lynet.de
ICQ-Number: 1489513

 

Re:TreeView - Select


Did you try :

if (Assigned(TreeView1.Selected)) then begin
  ... do your stuff here ...
end;

Ron.
--
Ron Loewy, HyperAct, Inc. http://www.hyperact.com - Publishers of
HyperTerp and WebApp

On 5 Jun 1997 14:08:27 GMT, "Christof Schmidt" <si...@lynet.de> wrote:

Quote
>I'm going mad with this TTreeView-component!
>My actual problem:
>If I try to delete the selected Node, I get
>an error message, if no one is selected.
>Thats OK - I would do the same.
>But I have found no proper way, to check out
>IF there is a selected node.

>Any Idea out there?

>Thanks
>Christof Schmidt
>si...@lynet.de
>ICQ-Number: 1489513

Re:TreeView - Select


Quote
Christof Schmidt wrote:

> I'm going mad with this TTreeView-component!
> If I try to delete the selected Node, I get
> an error message, if no one is selected.
> But I have found no proper way, to check out
> IF there is a selected node.

if TreeView1.Selected = nil then Exit;

Simple as that, right ?
--
Peter

Remove the ! from my address to send e-mail. Sorry.

Other Threads