Page 1 of 1
FontColor for a label or an edit objetcs
Posted: Mon Jun 25, 2007 8:21 pm
by endloop
Hello,
I have some problems with the "fontcolor" attribute because in the documentation you say that is a boolean type. So, what is the syntax to have blue words in a label for example ?
This kind of syntax is no good :
[code]
Mylabel.fontcolor=True
[/code]
I have the same question with the "color" property... A little sample of code should be welcome ;D
Thank you very much
Best regards,
Richard.
FontColor for a label or an edit objetcs
Posted: Wed Jun 27, 2007 3:35 pm
by Marco
Hi, the color is an integer value but can give up in a hexadecimal value.
color=$hff00ff ff stand for 255 it contains three parts
0-255 for red,0-255 for green,0-255 for blue.
I think it is easier to use the rgb function ie
blabla.color=rgb(45,9,255)
best regards
FontColor for a label or an edit objetcs
Posted: Wed Jun 27, 2007 5:23 pm
by endloop
Hi,
Thank you for this answer but I think I have another problem. This code works :
[code]
dim etiquette1 as label
etiquette1.Parent=maforme
etiquette1.top=75
etiquette1.left=140
etiquette1.fontcolor=rgb(0,128,192)
etiquette1.caption="le produit est : "
[/code]
But this one does`nt work :
[code]
dim etiquette1 as label
etiquette1.Parent=maforme
etiquette1.top=75
etiquette1.left=140
etiquette1.fontcolor=$hC08000
etiquette1.caption="le produit est : "
[/code]
The compiler says : "[b][i]Error 18, line 29 : function or variable $hC08000 does not exists[/i][/b]" Why ? Is there a function or an object attribute for that ? It appears nowhere in the documentation.
Because it is very useful to use the "extra" menu with the palette ... and the palette doesn`t give the rgb code of the colour, just the hexadecimal code.
Best regards
FontColor for a label or an edit objetcs
Posted: Wed Jun 27, 2007 7:20 pm
by PaPi
Hi, the hexadecimal: &hffcc12 for example, but in your code is $h....
PaPi
FontColor for a label or an edit objetcs
Posted: Wed Jun 27, 2007 9:45 pm
by Marco
Sorry slip of the finger
best regards
FontColor for a label or an edit objetcs
Posted: Thu Jun 28, 2007 1:28 pm
by endloop
OK, it works fine.
Thank you,
Best regards,
Richard.