Hi Dragan,
>I told you it reacts differently depending on the way you access the button. Too unreliable.
I access buttons only by mouse clicking (can not acces by tab, because I have 3 grids, one button and one navstand on my form).
>>>* button.when
>>>thisform.LastActive=thisform.activecontrol
>>
>>>
>>>* button.lostfocus
>>>
>>>thisform.LastActive.Setfocus
>>>nodefault
>>
>> I think we need to use macro here like:
>>
>>thisform.&LastActive..Setfocus
>>and this code should be in click event after dodefault()
>No macro - it would not keep any names, it would keep an object referrence (thisform.activecontrol returns an object referrence), and this referrence behaves as an alias to the real object, and you can call its methods.
Ok, great. But I decided not to use LastActive as a form poperty, but as a NavStand class property (all my buttons are on navstand). So, how do I call this right now?
in buttons when event
this.parent.LastActive=thisform.activecontrol
right?
in buttons click event (after all lines of code)
what?
I can not assign thisform.activecontrol, I beleive, so, how can I operate here?
Local lcControl
lcControl=this.parent.LastActive
thisform.lcControl.SetFocus() ????????
Because I think that easier to create a property for a class than create a new property for a form (if we will use different classes for forms).
Am I right?
>> But here is the potential problem - if our controls are not on the form, but on the page or another container object - how can we operate here?
>
>The object in the pageframe would create a reference to itself in thisform.LastActive, no matter where it's contained. Just try it.
Thanks
If it's not broken, fix it until it is.
My Blog