Am Montag, den 27.06.2011, 22:31 +0200 schrieb M. Cs.:
> Thanks! I wonder whether it is possible with any kind of controls to
> do the same thing?
> 
> 2011/6/27, Caveat <gam...@caveat.demon.co.uk>:
> >
> 

Salut,

yes you can, but that's not all.

CONST myGotFocusColor AS Integer = &HAAFF7F&
CONST myLostFocusColor AS Integer = &HF9F9BD&

PUBLIC SUB SetEditColor(oObj AS Object, objLast AS Control)
DIM myControl AS String
DIM hClass AS Control
DIM hCont AS Container
    myControl = Object.Class(objLast)
    FOR EACH hClass IN oObj.Children
      ' is it like my LAST ?
      IF Object.Class(hClass) = myControl THEN
        ' only for debugging
        'PRINT  Object.Class(hClass) & "     LAST.TAG = " & objLast.Tag
& "          hClass.Tag = "  & hClass.Tag
        IF objLast.Tag = hClass.Tag THEN
            hClass.Background = myGotFocusColor
        ELSE
            hClass.Background = myLostFocusColor
        ENDIF
      ELSE
        ' TRY if it is a Container
        TRY hCont = hClass
        IF NOT ERROR THEN
            ' I call my self to find out if there are Cildren like my
LAST
            SetEditColor(hClass, objLast)
        ENDIF
      ENDIF
    NEXT
END

to call like that SetEditColor(ME, LAST)

Where ME can be a form or a container, and LAST a control. Mainly evoked
by LAST!


-- 
Amicalement
Charlie

PS that is gambas2 code


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to