Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tree view menu
Message
 
To
17/03/2004 14:41:15
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00887215
Message ID:
00887327
Views:
18
A More detailed follow up

You seem to be using "2_","3_" for node keys. If it works - okay - but sometimes treeview nodes have issues with a numeric first character. I've seen "_2","_3" kinds of keys before.
*First a static file with a field to remember the tree node:
LAST_NODE C(2) 
*When you add the field, edit or replace LAST_NODE WITH "1_"

*Then you have a last selected node key memeory variable.
public ucLastNodeKey
*Assuming the static file is open
ucLastNodeKey=MySysDBF.LAST_NODE

*in your treeview init event
*add treeview nodes first
this.tag=[dummy]
this.nodeclick(this.Nodes(ucLastNodeKey))

*in your treeview NodeClick(Node)
if node.key#this.tag && Not a re-click
   this.hideselection=.f.
   node.selected=.t.
   store node.key to ucLastNodeKey,this.tag
   * Go run menu operation
else
   * Ignore - no change
endif

* In your app close event
replace mySysDBF.LAST_NODE with ucLastNodeKey

>Hi all, i'm trying to do a menu using treeview control to show users options and preserve the last option used next time they start the app. I put a treeview control on a form and this in the init event of it:
>
>LOCAL o, oNode
>o= thisform.oletree
>oNode=o.Nodes.Add(,1,"1_", "Compraventa",0)
>oNode.Image="manos"
>o.Nodes.Add(,1,"2_", "Utilidades",0)
>o.Nodes.Add(,1,"3_", "Ayuda",0)
>o.Nodes.Add("1_", 4, "4_", "Contratos",0)
>
>image "manos" is on imalistcontrol on same form, but this oNode.image="manos" shows an error.
>
>i need to save last option used in a local table and show this option next time user log in the app. Also i need to show images for each option, Some ideas?
>
>Thanks ....
>john harold
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform