[Gambas-user] Set component's default color _Property

Benoît Minisini g4mba5 at gmail.com
Tue Jul 17 20:50:21 CEST 2018


Le 16/07/2018 à 11:56, Moviga Technologies via User a écrit :
> Question #1:
> 
> How should I correctly set the color property?
> The only example I found in the wiki was Color1{Color}=-1
> Trying to set the HEX value, but to no avail:
> 
> Public Const _Properties As String = 
> "*,Text,Border,Color1{Color}=&HDFDFDF&,Color2{Color}=&H9F9F9F&"

The default value must be in decimal, but this can be easily change in 
the IDE.

> 
> Question #2:
> 
> When I've changed or added some property (like Color1 above), or the 
> component image, the change is normally not reflected in the form designer.

It's normal, the IDE does not know how to draw your custom controls.

As for the property value, you just have to be sure that the default 
value defined in the _Properties string reflects the default value 
actually defined in the code. Otherwise the form designer will fail to 
handle the property correctly.

-- 
Benoît Minisini


More information about the User mailing list