>With BeforeRowColchange I can prevent the Grid form changing rows when the data is not completed as I want.
>With the Valid event I can prevent the Grid from losing focus to other controles when the data in the row is not completed as I want. Other controles are not accesible then as I have tested and that works well.
>
>The problem I have is with the TreeView controle. When no other control can get the focus the TV can. Why is that ? Because it is an ole control ??
>
This is true partially.
grid.valid prevent the Grid from VFP losing focus also for an olecontrol
( olecontrol.Gotfocus doesn't fired )
What VFP doesn't do is to capture the queue of the messages that OS send to the ActiveX;
as a result all the inside events
*** ActiveX Control Event ***of the olecontrol are fired however.
Unfortunately the treeview doesn't support a CancelEvent prop/param.
Then you have to control these events
this.tag ="gotfocus"
this.tag =""
IF m.this.tag == ""
RETURN
ENDIF
....
However you remembers,
in VFP it is not possible to stop the lostfocus among different forms,
even if the current form is Modal.
This is a very serious error,
but it seems that it don't interest anybody.
>Now I'm trying to do it with more code with the GotFocus event of the TV. But can someone tell me how this works or have to work ??
>
>Regards,
>Jan