[AccessD] need ideas

Heenan, Lambert Lambert.Heenan at AIG.com
Tue Feb 18 11:24:00 CST 2003


Whether you use a class with WithEvents, or just a simple Sub that you call
in the option group's On_Click event, here's an example of the basic logic
that you could use to do the color changing...

Sub formatOpGroup(opGrp As OptionGroup, sCaption As String)
Dim c As Control
    
    For Each c In opGrp.Controls
        If TypeOf c Is Label Then
            If c.Caption = sCaption Then
                c.ForeColor = IIf(sCaption = "Yes", RGB(0, 255, 0), RGB(255,
0, 0))
            Else
                c.ForeColor = RGB(0, 0, 0)
            End If
        End If
    Next c
End Sub

Lambert

> -----Original Message-----
> From:	John Bartow [SMTP:jbartow at earthlink.net]
> Sent:	Tuesday, February 18, 2003 11:40 AM
> To:	AccessD
> Subject:	[AccessD] need ideas
> 
> I'm involved in an app where the color of the associated label for radio
> buttons in a frame should change once its selected.
> 
> The frames are all the same and have radio buttons with "Yes" and "No" as
> labels. They would like the NO to be red when selected and YES to be green
> when selected.
> 
> I was thinking of trying a class but this seems like it would be a bit
> more
> complicated than the text box background color changing class that we've
> discussed before.
> 
> Any ideas or suggestions?
> 
> JB
> 
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list