How to set foreground and background colors on Edit Box and Text Box

Started by rp108, August 22, 2014, 03:07:27 AM

Previous topic - Next topic

rp108

Hi All,

I found some references on the MS Win32api pages but they seemed to be oriented to the MFC and I was not able to figure how to untangle them to use in Pelles C - which I have found to be wonderfully CLEAN.

Any help is much appreciated.   :)

Thanks,
rp108

NOTE: I am developing a Dialog-based app. What I mean by "Text Box" is using the drag and drop Pelles feature for text display, just as a label, and "edit Box" I mean where the user enters text.

Robert


TimoVJL

May the source be with you

rp108

Thanks Gentlemen,

In the label-button project, there is a type conditional statement that I don't understand. It appears to be a compile time conditional but I do not understand WHAT is being tested.

#if 0
blah blah blah
#endif

I don't understand WHAT is being tested for:    0

Other than that, I will pare-down the example to only what I need (set color of text and background in a text or edit box), and see if I can get it running.

Can you tell me about the  #if above, please?

Thanks,
rp108


frankie

#if 0
..... //Test code that will never be compiled
#endif

It's a common practice to insert test code (or other optional code) that can be compiled only by manually enabling it changing the test condition to #if 1
#if 1
..... //Test code that will be compiled
#endif

It is more convenient that using // or /* ... */ (that can create problems with other comment, line extensions using backslash, etc).

PellesC IDE provides in context menu->surround by the option to surround selected lines with an #if0 ... #endif construct (context menu in source editor is triggered by right clicking).
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide