Click here to Skip to main content
15,891,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralError that occured only in Release mode Pin
Yaron Abershitz18-Jan-05 20:05
Yaron Abershitz18-Jan-05 20:05 
GeneralRe: Error that occured only in Release mode Pin
Yulianto.18-Jan-05 20:48
Yulianto.18-Jan-05 20:48 
GeneralGeneral C++ question on constructors Pin
melwyn18-Jan-05 19:33
melwyn18-Jan-05 19:33 
GeneralRe: General C++ question on constructors Pin
Emilio Garavaglia18-Jan-05 21:56
Emilio Garavaglia18-Jan-05 21:56 
GeneralRe: General C++ question on constructors Pin
markkuk19-Jan-05 2:02
markkuk19-Jan-05 2:02 
GeneralRe: General C++ question on constructors Pin
Mike Dimmick19-Jan-05 2:47
Mike Dimmick19-Jan-05 2:47 
QuestionGet FileName of a file if know position ?? Pin
Le Hong Anh18-Jan-05 19:33
Le Hong Anh18-Jan-05 19:33 
QuestionHow to integrate background color with button control Pin
phijophlip18-Jan-05 19:23
phijophlip18-Jan-05 19:23 
In a dialog form there are three three edit boxes which and button.

The member variable of three edit boxes are of integer types.The three edit boxes represent the RGB color.Suppose if I click the button which on the form background color of the dialog form should according to the value entered the three edit boxes which are present on the dialog form.

The changing of the background color is given below


HBRUSH CBackColor1Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here

// TODO: Return a different brush if the default is not desired

if( pWnd == this)
{
pDC->SetTextColor(RGB(100, 255, 111));
pDC->SetBkColor(RGB(255, 255, 255));
hbr = (HBRUSH)(m_pBlackBkBrush->GetSafeHandle());
}

return hbr;
}

The code for the button control is given below

void CBackColor1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here

}

Can any one please tell how to integrate OnCtlColor member function with onButton1() member function .







Philip
AnswerRe: How to integrate background color with button control Pin
Aamir Butt18-Jan-05 20:26
Aamir Butt18-Jan-05 20:26 
AnswerRe: How to integrate background color with button control Pin
Aamir Butt18-Jan-05 20:49
Aamir Butt18-Jan-05 20:49 
GeneralAutomated press and release of keys in Keyboard and GetKeyState of keyboard Pin
vidhyas18-Jan-05 19:00
vidhyas18-Jan-05 19:00 
Generalserial numer of the CD Pin
includeh1018-Jan-05 18:40
includeh1018-Jan-05 18:40 
GeneralRe: serial numer of the CD Pin
Dudi Avramov20-Jan-05 0:35
Dudi Avramov20-Jan-05 0:35 
QuestionHow can i change the background color of a button control in vc++ Pin
phijophlip18-Jan-05 17:24
phijophlip18-Jan-05 17:24 
AnswerRe: How can i change the background color of a button control in vc++ Pin
Selvam R18-Jan-05 18:09
professionalSelvam R18-Jan-05 18:09 
GeneralRe: How can i change the background color of a button control in vc++ Pin
ThatsAlok18-Jan-05 18:26
ThatsAlok18-Jan-05 18:26 
AnswerRe: How can i change the background color of a button control in vc++ Pin
ThatsAlok18-Jan-05 18:10
ThatsAlok18-Jan-05 18:10 
GeneralRe: How can i change the background color of a button control in vc++ Pin
Selvam R18-Jan-05 22:30
professionalSelvam R18-Jan-05 22:30 
Questionwhat is the use of this pointer ? Pin
phijophlip18-Jan-05 17:22
phijophlip18-Jan-05 17:22 
AnswerRe: what is the use of this pointer ? Pin
Selvam R18-Jan-05 18:08
professionalSelvam R18-Jan-05 18:08 
AnswerRe: what is the use of this pointer ? Pin
David Crow19-Jan-05 4:23
David Crow19-Jan-05 4:23 
GeneralGrafMenu from Programming Windows Pin
LiYS18-Jan-05 17:16
LiYS18-Jan-05 17:16 
GeneralCDialog Derived run-time error Pin
LighthouseJ18-Jan-05 17:09
LighthouseJ18-Jan-05 17:09 
GeneralRe: CDialog Derived run-time error Pin
Serge Krynine18-Jan-05 18:27
Serge Krynine18-Jan-05 18:27 
GeneralRe: CDialog Derived run-time error Pin
LighthouseJ19-Jan-05 3:12
LighthouseJ19-Jan-05 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.