On Sun, 25 Aug 2013, Kende Kriszti??n wrote: > > Hi, > > > > Something like this: > > > > For i = 1 To 55 > > Button & i &.Enable = True > > Next > > > > Of course, this does not work. > > So what the way? > > > > Thanks > > > > For example: > > Dim ctrl As Control > > For Each ctrl In FMain.Controls > > If InStr(ctrl.Name, "Button") = 1 Then ctrl.Enabled = True > > Next >
One other possibility is to use the Action class: Action["thebuttons"].Enabled = True As a supplement to Kende's answer, you can also have the Form search the exact names for you: FMain.Controls["Button" & Str$(i)].Enabled = True Also, if they are all in the same container (and are the only ones in the container), you can initially set only the container to Enabled = False which would also disable its children. Reenabling the container will reenable all the children, too. Regards, Tobi ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user