>>>>IF nKeyCode = 9 >>>> NODEFAULT >>>>ENDIF>>>well what I am getting at is that when a textbox receives the focus, the users should onlt be allowed to hit enter or click on QUIT. There are other controls but if user clicks on them, trouble occurs. I'd hate to issue disables all over the place then enabled them afterwards, alot of code.
* A button click or your textbox gotfocus thisform.setall("Enabled",.f.) && Disable all this.enabled = .t. && Except this * If used textbox gotfocus in valid enable all * Would fire when Enter pressed thisform.setall("Enabled",.t.) && Enable allA click shield trick :
* Make the shield thisform.addobject("ClickShield","Shape") with thisform.ClickShield .left = .parent.left .top = .parent.top .height = .parent.height .width = .parent.width .borderstyle = 0 && Transparent border .backstyle = 0 && Transparent .visible = .t. && Not visible in fact but to put into work endwith * All mouse events would be intercepted by shape * If desired it could be made into a class * and add code to dblclick, click etc mouse events * to be filtered and passed to only desired controls * here another simple trick to get underlying control * this.zorder(1) && Put the shield at back of other control * thisform.scalemode = 3 && Pixels * oObjectAtCurrentpos = sys(1270,; * nXcoord + this.left, ; * nYcoord + this.top) * this.zorder(0) && Put in front * Here do whatever with control ie: oObjectAtCurrentpos.click * Remove the shield thisform.removeobject("ClickShield")Cetin