FontColor for a label or an edit objetcs

In this category you can exchange your programming questions and solutions.
Post Reply
endloop
Posts: 10
Joined: Wed Jun 20, 2007 1:26 pm

FontColor for a label or an edit objetcs

Post: # 78Post endloop
Mon Jun 25, 2007 8:21 pm

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.

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

FontColor for a label or an edit objetcs

Post: # 79Post Marco
Wed Jun 27, 2007 3:35 pm

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

endloop
Posts: 10
Joined: Wed Jun 20, 2007 1:26 pm

FontColor for a label or an edit objetcs

Post: # 80Post endloop
Wed Jun 27, 2007 5:23 pm

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

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

FontColor for a label or an edit objetcs

Post: # 81Post PaPi
Wed Jun 27, 2007 7:20 pm

Hi, the hexadecimal: &hffcc12 for example, but in your code is $h....
PaPi

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

FontColor for a label or an edit objetcs

Post: # 82Post Marco
Wed Jun 27, 2007 9:45 pm

Sorry slip of the finger

best regards

endloop
Posts: 10
Joined: Wed Jun 20, 2007 1:26 pm

FontColor for a label or an edit objetcs

Post: # 83Post endloop
Thu Jun 28, 2007 1:28 pm


OK, it works fine.

  Thank you,

    Best regards,

             Richard.

Post Reply