Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
C++ Changing colour of Static Ctrl
Name: Jeff80000 Date: October 12, 2004 at 05:42:04 Pacific OS: WinXP Pro CPU/Ram: 3.4GHz
Comment:
I'm am developing an application in VC++ 6 but i need to change the background colour and the text colour of a static text object that is on my dialog. I can't find a way to do this. I need to change the background colour to Grey and the text to White. Any ideas on a really simple solution, thanks
Name: gimmpy224 Date: October 12, 2004 at 15:16:46 Pacific
Reply:
are you using MFC?
GIMPS
0
Response Number 2
Name: waterdog Date: October 13, 2004 at 19:39:39 Pacific
Reply:
When a static control is created, the parent window receives a WM_CTLCOLORSTATIC message. The WPARAM paramater equals the device context which can be used in the SetTextColor function to change the text colour in the control. The LPARAM paramater is the handle of the static control. You must return the handle to a colour brush that windows will use to colour the background of the control. A rough example: case WM_CTLCOLORSTATIC: if((HWND)lParam == handleofstaticcontrol)
SetTextColor((HDC)wParam,RGB(0,0,255)); // set color of text in control
Summary: I am trying to change the colour of a cell using the "If Function" i.e. If value of the cell is greater than 20, change colour of cell to green, else colour to be red. ...
Summary: Hi,everybody. There is a server that to derived IPs from this server. I want to make a web page until to change passwords of those acc--ts over Internet. If this write with ASP or ...Please explain de...
Summary: What code could I add to the following code that will raise an alert that a duplicate entry has been made? The end user can only enter a numerical value from 1-59, and if the user enters the same numb...