Thank you all for your valuable ideas. I've done the code working, and as you pointed out, it's better to avoid Do While loops at all costs. Here is the code I've used in the NodeClick event.
Lparameters Node
Thisform.B1.Enabled = .F.
* --- Be sure we select a Child, not a Parent node ... and only certain children, not all of them
For i = 1 To This.Nodes.Count
If This.Nodes.Item(i).Selected
Endif
Next
If !(Inlist(This.Nodes.Item(i).FullPath, 'Taxonomy', 'Identifiers', 'Hormones'))
If Inlist(This.Nodes.Item(i).Parent.Key, 'TX', 'ID', 'FB', 'R', 'NT', 'MT', 'G', 'OT')
FullNodeCrochiu = This.Nodes.Item(i).FullPath
ThisForm.B1.Enabled = .T.
Endif
Endif
Now, even if I select a Parent, I can anytime close the form. With Do while loop I couldn't do this and I was stuck in the loop.
All the best,
Neculai