Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Treeview question (hopefully the last one)
Message
From
31/10/2001 13:40:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/10/2001 13:29:09
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00575243
Message ID:
00575781
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform