[Gambas-user] Iterating through and enabling and disabling controls on a form...
sbungay
sbungay at ...981...
Tue Feb 6 20:57:57 CET 2007
Hi Fabien.
I goofed on the semantics of the email. The form is enabled, it is
the control in the form that is not enabled, having set Enabled=False at
design time. The sentence;
>>ControlHandle.Enabled = True doesn't set Enabled to True if the form
>>has Enabled set to False by default.
Should actually read
>>ControlHandle.Enabled = True doesn't set Enabled to True if the
>>control on the form had its' Enabled property set to False at design
>>time.
Sorry for the confusion, thanks for the reply.
Steve.
Fabien Bodard wrote:
> 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
>>
>
> -------------------------------------------------------------------------
> 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