Click here to Skip to main content
16,006,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read line per line using CFile object Pin
Nish Nishant7-Apr-02 0:08
sitebuilderNish Nishant7-Apr-02 0:08 
QuestionHow to save drawings in the window to file in format of '.bmp' or '.jpg',etc? Pin
mzt6-Apr-02 23:11
mzt6-Apr-02 23:11 
AnswerRe: How to save drawings in the window to file in format of '.bmp' or '.jpg',etc? Pin
Wolfram Steinke6-Apr-02 23:35
Wolfram Steinke6-Apr-02 23:35 
AnswerRe: How to save drawings in the window to file in format of '.bmp' or '.jpg',etc? Pin
Christian Graus6-Apr-02 23:53
protectorChristian Graus6-Apr-02 23:53 
QuestionDoes how making the window size be more than certain value ,but not twinkle? Pin
mzt6-Apr-02 23:02
mzt6-Apr-02 23:02 
AnswerRe: Does how making the window size be more than certain value ,but not twinkle? Pin
Paul M Watt7-Apr-02 7:13
mentorPaul M Watt7-Apr-02 7:13 
GeneralLow-Level CD access Pin
Hyien6-Apr-02 22:08
Hyien6-Apr-02 22:08 
GeneralMFC text box flicker Pin
ejw6-Apr-02 15:05
ejw6-Apr-02 15:05 
I have 2 text boxes, one for inputting numbers and the other is a read only box that reads in that number. Depending on whether that number is even or odd, the read only box changes its background to green(even) or red(odd). However, the text inside the read only box then flickers when it's displayed. How do I fix this?

This is what I have done:

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

CEdit * pEditReadOnly = (CEdit *)GetDlgItem(IDC_EDIT_DISPLAY); //read only
HWND hWndReadOnly = pEditReadOnly->GetSafeHwnd();

if(m_brush)
DeleteObject(m_brush);

CString input_value;

m_INPUT_BOX_VALUE.GetWindowText(input_value); //get value from input
m_DISPLAY_BOX_VALUE.SetWindowText(input_value); //read box displays it

long int number = atoi(input_value); //convert input_value to integer

if(nCtlColor == CTLCOLOR_STATIC &&
hWndReadOnly == pWnd->GetSafeHwnd())
{
pDC->SetBkMode(TRANSPARENT);
if (number % 2 == 0) { // if even change background to green
m_brush = CreateSolidBrush(RGB(0,255,0)); // green background
pDC->SetTextColor(RGB(0,0,0)); // black text
}
else { // else it is odd (red)
m_brush = CreateSolidBrush(RGB(255,0,0)); // red background
pDC->SetTextColor(RGB(255,255,255)); // white text
}
hbr = m_brush;
}
return hbr;
}
GeneralRe: MFC text box flicker Pin
Shog96-Apr-02 15:51
sitebuilderShog96-Apr-02 15:51 
GeneralRe: MFC text box flicker Pin
ejw6-Apr-02 16:09
ejw6-Apr-02 16:09 
GeneralRe: MFC text box flicker Pin
Nish Nishant6-Apr-02 16:38
sitebuilderNish Nishant6-Apr-02 16:38 
GeneralRe: MFC text box flicker [oops] Pin
Nish Nishant6-Apr-02 16:39
sitebuilderNish Nishant6-Apr-02 16:39 
GeneralRe: MFC text box flicker [oops] Pin
Shog96-Apr-02 18:33
sitebuilderShog96-Apr-02 18:33 
GeneralRe: MFC text box flicker [oops] Pin
Nish Nishant6-Apr-02 18:46
sitebuilderNish Nishant6-Apr-02 18:46 
GeneralRe: MFC text box flicker [oops] Pin
Shog96-Apr-02 18:43
sitebuilderShog96-Apr-02 18:43 
GeneralRe: MFC text box flicker Pin
Shog96-Apr-02 18:29
sitebuilderShog96-Apr-02 18:29 
GeneralRe: MFC text box flicker Pin
ejw6-Apr-02 18:56
ejw6-Apr-02 18:56 
QuestionCan we get extended info from RAS Connection Pin
Tili6-Apr-02 13:22
Tili6-Apr-02 13:22 
GeneralSending a file over socket Pin
Rickard Andersson206-Apr-02 10:27
Rickard Andersson206-Apr-02 10:27 
GeneralRe: Sending a file over socket Pin
Nish Nishant6-Apr-02 14:57
sitebuilderNish Nishant6-Apr-02 14:57 
GeneralRe: Sending a file over socket Pin
Rickard Andersson207-Apr-02 0:27
Rickard Andersson207-Apr-02 0:27 
GeneralRe: Sending a file over socket Pin
6-Apr-02 15:37
suss6-Apr-02 15:37 
GeneralRe: Sending a file over socket Pin
Nish Nishant6-Apr-02 16:36
sitebuilderNish Nishant6-Apr-02 16:36 
GeneralSending CChildView a Message :: MFC Pin
valikac6-Apr-02 9:52
valikac6-Apr-02 9:52 
GeneralRe: Sending CChildView a Message :: MFC Pin
Michael Dunn6-Apr-02 14:56
sitebuilderMichael Dunn6-Apr-02 14:56 

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.