Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview
Message
De
06/08/1999 07:21:54
Bob Tracy
Independent Consultant
Driftwood, Texas, États-Unis
 
 
À
06/08/1999 06:55:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00250096
Message ID:
00250584
Vues:
24
Hi John,

Glad it helped. I know I had a heck of a time figuring out how to use this control but it was worth the effort.

The example was clipped from a treeview I use to display a complex bill of material. When SelectedItem.Index = 1 you are at the top of the tree and trying to access node.parent.text generates an error since there is no parent to access.

>Hi Bob,
>
>Thanks for the help. That didn't work for what I wanted but it did point me in the right direction and helped me solve it. What I found that worked for me was
>
>in the nodeclick method
>THISFORM.txtDir.Value = TRIM(node.text)
>
>Why did you check to see if the selecteditem.index is not equal to 1?
>
>Thanks
>>>Does anyone know how to reference the item selected in a treeview?
>>>
>>>oleTreeView1.Click
>>> ThisForm.txtTreeSelect.Value =
>>>
>>>
>>>Thanks
>>
>>John,
>>Look at the NodeClick property and try something like this:
>>
>>IF THIS.SelectedItem.Index <> 1
>> THISFORM.cSelectedParent = TRIM(node.parent.text)
>>ELSE
>> THISFORM.cSelectedParent = THISFORM.cSelectedPart
>>ENDIF
>>
>>HTH...Bob
Bob Tracy

Never engage in a battle of wits if you're only half armed.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform