[Gambas-user] Disable controls by Tag

Jesus Guardon jguardon at ...2035...
Thu May 28 16:30:14 CEST 2009


Hi all

It seems a basic question, but I'm unable to get it to work.
I need to enable/disable a group of mixed controls in the Main Form, but 
instead of doing individually, I'd prefer to do so by iterating.

Following is the code I'm using and it gives an error "Wanted string, 
date or integer, got function instead"

What I'm doing wrong?

PUBLIC SUB btnQuick_Click()     'toggle button

     DIM hCtl AS Control

     IF btnQuick.Value = TRUE THEN
         FOR EACH hCtl IN FMain.Controls
             IF hCtl.Tag = "exclude" THEN hCtl.Enabled = FALSE
             'DEBUG hCtl.Tag
         NEXT
     ELSE
         FOR EACH hCtl IN FMain.Controls
             IF hCtl.Tag = "exclude" THEN hCtl.Enabled = TRUE
         NEXT
     ENDIF

END

Regards

Jesus




More information about the User mailing list