![]() |
Change the background and foreground color of an MFC Edit Box
Define a CBrush pointer in your dialog Class
Code:
CBrush *brush;Code:
brush = new CBrush(RGB(49,49,49));Code:
switch (nCtlColor) { |
Re: Change the background and foreground color of an MFC Edit Box
1 Attachment(s)
Here sample Application!
|
Re: Change the background and foreground color of an MFC Edit Box
Nice sample.
|
Re: Change the background and foreground color of an MFC Edit Box
how can I insert an image as background of dialog box?
And How I change font of edit box(but static text must be another font)? thanks |
Re: Change the background and foreground color of an MFC Edit Box
Making it as a seperate threads will have more responses but I will give you some hints as how you can do that.
Quote:
1. You need to be doing is Derive a class from the CDialog and use that class for your dialog and in the PAINT message just use the bitblt function to render the image. 2. Add the PAINT message handler to the current dialog and draw the image to the DC of the paint method. Quote:
Quote:
|
Re: Change the background and foreground color of an MFC Edit Box
can I have a simple example on which create a custom background and a font different between static text and edit box text?
thanks |
Re: Change the background and foreground color of an MFC Edit Box
Quote:
|
Re: Change the background and foreground color of an MFC Edit Box
Thanks for your application. It helped me change the text colors of various controls.
|
Re: Change the background and foreground color of an MFC Edit Box
Is it possible to change the foreground color of a specific part of the text inside an edit box? For example "Error" should be red and the rest black.
|
Re: Change the background and foreground color of an MFC Edit Box
Quote:
Fine piece of code , very simple yet powerful. |
| All times are GMT +5.5. The time now is 07:50. |