Why not flush the buffers at the top of the node click:
procedure NodeClick(node)
IF thisform.check_datachanged()
thisform.cmdSave.Click()
endif
node.selected=.t.
endproc
>Hi, all:
>
> I am useing treeview as a Customer List. When user click the treeview, before Navagitor to an new record, i need to check out that if there are some unsaved data in buffer.So, if it is, and user chosed return form my dialog, I have to prevent the treeview's NodeClick() events from happening. I add this in treeview's MouseDown:
>
>Treeview.MouseDown:
>********************************************
>LPARAMETERS button, shift, x, y
>LOCAL loNode as Object
>
>loNode = this.hitTest(x/96*1440, y/96*1440)
>
>IF thisform.check_datachanged()
> NODEFAULT
> RETURN .F.
>ENDIF
>********************************************
>
>And add this in treeview's nodeClick() event:
>
>Treeview.NodeClick()
>********************************************
>LPARAMETERS node
>
>WAIT WINDOW "NodeClick hanppened!"
>********************************************
>
>Unfortunately,I kept see the "NodeClick hanppened!" msg displaying, even though the form's check_datachanged() Return .f..
>
>How to prevent treeview's nodeclick() from happening?
Imagination is more important than knowledge