Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another Treeview question (hopefully the last one)
Message
De
31/10/2001 13:40:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/10/2001 13:29:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00575243
Message ID:
00575781
Vues:
25
Chris,
If user checks or unchecks with mouse/keyboard it fires. If you do it in code (ie: OleTree.Nodes('NodeKey').Checked = .t.) then it doesn't.

Create a treeview with checkboxes and insert the code I sent in nodecheck (remove if node.key = 'Root'). When you click a node it fires the code and checks/unchecks children. However setting children checked property doen't fire nodecheck.

Cetin

>Hi Cetin,
>
>Thanks for your reply. So if you programatically check or uncheck the checked property the nodechecked event doesn't fire? Then how can we determine if someone checks or unchecks an item?
>
>This is how I set it up. 'MakeLink' is a function I've made to determine if the checkboxed should be checked. 'IsExpanded' is a function that determines if the node was previously expanded.
>
>scan  && scan table full of treeview values
>	if empty(tparent)
>		loNode = thisform.acxTreeView.nodes.add(, , alltrim(tname), alltrim(tdescrip))
>	else
>		loNode = thisform.acxTreeView.nodes.add(alltrim(tparent), tnum, alltrim(tname), alltrim(tdescrip))
>	endif
>	if thisform.makelink(alltrim(thisform.txtPid.value), alltrim(tname))
>		loNode.checked = .t.
>	endif
>	if thisform.isexpanded(alltrim(tname))
>		loNode.expanded = .t.
>	endif
>
>endscan
>
>
>Thank You Very Much,
>Chris
>
>>Yes Chris,
>>It fires when a node is checked or unchecked. It doesn't fire if Checked property is set programmatically.
>>ie: I use this code to automatically check-uncheck child nodes of a root node :
>>
>>*** ActiveX Control Event ***
>>Lparameters node
>>If node.key = 'Root'
>>	llChecked = node.Checked
>>	If node.Children > 0
>>		Node.Child.Checked = llChecked
>>		lnIndex  = Node.Child.Index
>>		Do while lnIndex # Node.Child.LastSibling.Index
>>			this.Nodes(lnIndex).Next.Checked = llChecked
>>			lnIndex = this.Nodes(lnIndex).Next.Index
>>		Enddo
>>	Endif
>>Endif
>>
Cetin
>>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform