Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with Treeview SelectedItem property
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00812987
Message ID:
00814129
Views:
15
>Hi Jim,
>
>
>THISFORM.Tree.SelectedItem = THISFORM.Tree.Nodes(1)
>
>

Viv -
SelectedItem is a reference and probably always be an object:
We can:
SelectedItem.Selected=.f.
or
SelectedItem.Selected=.t. && Only way to uurn off highlight when TV has focus

It seems the code Jim's code (THISFORM.Tree.SelectedItem = THISFORM.Tree.Nodes(1)) is trying to do more than just reference. It's trying to assign a node to the reference, which is usually accomodated with a Nodes(xxx).Selected=.t.

I wonder what Mr. Nelson is up to, hmmmm..., he has got something up his sleeve.


>In re-reading your original post it sounds to me as if ThisForm.Tree.Nodes(1) is the item that is, for some reason, not an object? .SelectedItem will accept a node object or a logical value (as long as it's false) and it looks as if it's not getting either.
>
>I still think your chances of solving this will be much improved if you are *sure* of the source of the error.
>
>If you can't use ASSERTS then why not a message box:
>

>IF TYPE("THISFORM.Tree.Nodes(1)") <> "O"
> = messagebox("Node not an object")
>ENDIF
>

>
>Regards,
>Viv
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform