[Gambas-user] Iterating through and enabling and disabling controls on a form...
Fabien Bodard
gambas.fr at ...626...
Tue Feb 6 12:28:18 CET 2007
2007/2/6, Stephen Bungay <sbungay at ...981...>:
>
> ControlHandle.Enabled = True doesn't set Enabled to True if the form has
> Enabled set to False by default. However, if Enabled is set to True by
> default then ControlHandle.Enabled can successfully toggle the value, thus
> Disabling and Enabling the control. Is this a bug?
>
> ' Iterate through the buttons on a form and Enable or Disable them
> ' depending on if their tag value exists in the SkillSet Collection.
> PRIVATE SUB SetControlsState()
> DIM ControlHandle AS Control
> DIM X AS Integer
>
> FOR EACH ControlHandle IN ME.Controls
> SELECT CASE Object.Type(ControlHandle)
> CASE "Button"
> ' SkillSet is a collection.
> FOR X = 1 TO ME.SkillSet.Count
> IF CInt(ControlHandle.Tag) = ME.SkillSet[X].ID THEN
> ControlHandle.Enabled = TRUE
> ControlHandle.BackColor = Color.Green
> ELSE
> ControlHandle.Enabled = FALSE
> ControlHandle.BackColor = Color.DarkGreen
> END IF
> NEXT
> END SELECT
> NEXT
> END
In fact why do you want to enable a control when his container is not....
it's not logical ! no ?
-------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list