Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with Treeview SelectedItem property
Message
From
31/07/2003 13:09:43
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00812987
Message ID:
00815487
Views:
19
Terry,
SNIP
>My efforts were with lisview (appologies for mixing ocx's). A .NULL. variable is not an object (where as: a node is!) - so that may explain the datatype errors.

I think you'll find that any data type that can contain a NULL also RETAINS its TYPE().

>
>I looked at my "episode" and found that this is how I got the data error.
>.SelectedItem = .NULL.
>?.SelectedItem.Text

Well I would expect this to fail, because even though .SelectedItem remains a type=object, it is now pointing to nowhere so it does NOT have a .Text property to refer to.

>
>I may have miswrote the data failure I experience with listview. After you try it that way - check it from this angle:
>.SelectedItem.Selected=.f.
>?.SelectedItem.Text

Here, again, I think it is 'just' a problem of weak typing (or whatever the academic terminology is). In VFP yoy can assign almost anything to almost anything else and there will be no problem UNLESS you then try to use that thing that you assigned an invalid value to.
In this case .SelectedItem 'accepts' the .F., but as soon as you try to use it...KA-POW!!
So in fact I don't think that assigning .F. to .SelectedItem is of ANY value whatsoever.

>
>>
>>Also .SelectedItem can certainly have a .NULL. value when the tree is first populated. I don't know exactly when this gets assigned but it could be as late as Tree.GotFocus()
>>
>Yes - I think that Onfocus (oops, GotFocus) is when it happens.

Well I think that the problem that originated this thread shows pretty conclusively that there is no SET 'time' when the focus is set.

cheers

>
>>Regards,
>>Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform