Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable a node
Message
 
À
23/12/2005 15:11:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01080629
Message ID:
01080733
Vues:
18
>Hi
>Is there a way to disable a node in a Treeview, the way we do it with any object in vfp? that is MyObject.enabled = .F.
>I can`t find any property of nodes (or I'm not looking where I should) that let me do that.
>Thanks and merry christmas to all
>Hernan
If you're using OCX version 6 then you have a forecolor property:
* here is the call to set the node's forecolor ..
setNodeEnableColor(oTV.Nodes(cTheSelectedNodeKey),.f.)

PROCEDURE setNodeEnableColor(oNode,llEnabled)
oNode.forecolor=IIF(llEnabled,RGB(255,0,0),RGB(0,0,255))
ENDPROC &&setNodeEnableColor(oNode,llEnabled) 

* Then at top of your node click
PROCEDURE  NodeClick(node)
IF node.forecolor=RGB(0,0,255) && Disabled
   node.selected=.f.
   * do disabled node house keeping here
ELSE && it's enabled
   node.selected=.t.
   * do enabled node processing here
ENDIF &&node.forecolor=RGB(0,0,255) && Disabled
ENDPROC &&NodeClick(node)
We don't have forecolor in OCX version 5.
If you are attempting to prohibit a process when a "cluster" node is selected (as opposed to a "leaf" node), then you could simply reset the state. In this presentation (download #16575) there is a demonstration on applying different house keeping rules based on cluster or leaf selection.
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform