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

Moviga Technologies moviga at mykolab.ch
Wed Jul 18 11:03:46 CEST 2018


Den 2018-07-17 20:50, skrev Benoît Minisini:

> 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.

Thank you!

> ... this can be easily change in the IDE.

I suppose you mean that you can make the change in the IDE. Not that 
there is an already existing option for it?

I know that it will not draw it, so your second assumption was the 
correct one. This is the string I've got now, but it is not reflected in 
the designer (yet), even though I've reloaded and restarted Gambas.

Public Const _Properties As String = 
"*,Text,Border,Color1{Color}=14671839,Color2{Color}=262119327"


More information about the User mailing list