Wow twice!!! ..I never gave the right attention to SEEK function... Cool one... Mostly on mult-task environment...
Your solution for check/uncheck works fine... But... so many functions for so simple task... If we still had the possibility for vfp10... Maybe this will be inserted on the wish-list.
The expression of: "toNode.Checked = !toNode.Checked=.t." was only that tries on faith on the impossible things.. Originally was written as your advice...
Makes me recall that phrase: "exhausted all logic possibilities makes the first option illogical the more reasonable to use".
Thank you great Sergey...
Cláudio
>You cannot uncheck checkbox from within of a treeview. See
Treeview - programmatically UNcheck a mouse-checked node Message #
731673>
>Also there's no need to make code more complicated that it should be.
>
>* This convoluted expression
>toNode.Checked = !toNode.Checked=.t.
>* Is the same as simple
>toNode.Checked = !toNode.Checked
>
>
> Select mytableA
> Set Order To client_id
> Seek toNode.Tag
> If Found() ...
>* can be shortened to
> If SEEK(toNode.Tag, "mytableA", "client_id") ...
><pre>
>
>>
>>at mytreeview.nodecheck method I'm trying to:<pre>*** ActiveX Control Event ***
>>Lparameters toNode
>>This.SelectedItem = toNode
>>If Empty(toNode.Tag)
>> Thisform.actionrecursive_in_child( toNode )
>>Else
>> Select mytableA
>> Set Order To client_id
>> Seek toNode.Tag
>> If Found() and !Empty(clients.email)
>> toNode.Checked = !toNode.Checked=.t.
>> Else
>> toNode.Checked = .f.
>> *This.SelectedItem.Checked = .f.
>> * ?? CHR(07)
>> * ThisForm.Container1.Text10.SetFocus()
>> * NODEFAULT
>> * RETURN .f.
>> Endif
>>Endif
>>
>>
>>My goal is about to doesn't allow the user check items with empty field of client's email...
>>
>>So, if I Follow this code with debug... it run and does fine what I'm trying to do... But after notecheck method it becomes checked again with no logic reason.
>>
>>Is there a way, on treeview, to allow check only in some sort of data??
>>
>>TIATOALL
>>
>>Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20