[Gambas-user] System colors

Bruce Steers bsteers4 at gmail.com
Fri May 5 12:02:25 CEST 2023


On Fri, 5 May 2023 at 10:28, Martín <mbelmonte at belmotek.net> wrote:

> Hi,
>
> I do the following to get the system colours, but it only works with the
> constants. How can I get the values of the following properties?
>
>    Dim xColor As Class = Classes["Color"]
>    Dim sSymbol As String
>
>    For Each sSymbol In xColor.Symbols
>      Select xColor[sSymbol].Kind
>        Case Class.Constant
>          $aColors.Add([xColor[sSymbol].Value, sSymbol])
>        Case Class.Property
>          Print "Property: " & sSymbol
>        Case Class.Variable
>          Print "Variable: " & sSymbol
>      End Select
>    Next
>
> How I can obtain it in a simple way the default system colors?
>
> Property: Background
> Property: Foreground
> Property: LinkForeground
> Property: TextBackground
> Property: TextForeground
> Property: LightBackground
> Property: LightForeground
> Property: ButtonBackground
> Property: ButtonForeground
> Property: TooltipBackground
> Property: TooltipForeground
> Property: VisitedForeground
> Property: SelectedBackground
> Property: SelectedForeground
>
> Thanks.
>
> Martin.


Object.GetProperty() ?

Print "Property: " & sSymbol, Object.GetProperty(Color, sSymbol)

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230505/278c02a2/attachment.htm>


More information about the User mailing list