Re: Any way to use custom colors for text that are not in color table?


Steven Blank
 

Adrian,

Regarding the font FG and BG colors of relevant Magic controls, the colors must be defined in the color table. If you've placed a .NET control on your form, then FG and BG colors can be set in the control by modifying the appropriate property and DNSet() expressions.

The one control, well, two controls actually, wherein you CAN specify colors not defined in the color table would be the Rich Text and Rich Edit controls. If you're unfamiliar with the concept of rich text, it could be thought of as the precursor to HTML, in that various formatting commands can be embedded within the text using tokens.

To reverse engineer a block of rich text, create a small document using Microsoft Word Pad and save it as a Rich Text (*.rtf) document. Then you can peek under the sheets using your favorite text editor, like Notepad, Notepad++, Ultra-Edit, or somesuch.

To see an example of rich text at runtime, execute DDF Maker from your Studio's Tools menu. On the "Welcome" window, click on the hyperlink "Contributed by Steven G. Blank" to open the "About" window. The area you see bounded in red below is a Magic Rich Text control:



Steven G. Blank
Ξ SGBlank Consulting


On 5/17/2022 10:11 PM, Adrian Wick wrote:
Hello all,

is it possible to use hval function in some way for font color? If it is possible, how do you combine than the foreground and the background colors?
Or there is no other way and ill have to add it to color table?

Regards
A

Join main@magicu-l.groups.io to automatically receive all group messages.