Click here to Skip to main content
15,928,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Make Edit Control un-editable Pin
dabs19-Feb-04 3:50
dabs19-Feb-04 3:50 
GeneralRe: Make Edit Control un-editable Pin
David Crow19-Feb-04 5:54
David Crow19-Feb-04 5:54 
GeneralRe: Make Edit Control un-editable Pin
Prakash Nadar19-Feb-04 6:17
Prakash Nadar19-Feb-04 6:17 
GeneralRe: Make Edit Control un-editable Pin
David Crow19-Feb-04 6:46
David Crow19-Feb-04 6:46 
GeneralRe: Make Edit Control un-editable Pin
Steve S19-Feb-04 7:30
Steve S19-Feb-04 7:30 
GeneralRe: Make Edit Control un-editable Pin
Prakash Nadar19-Feb-04 14:07
Prakash Nadar19-Feb-04 14:07 
GeneralRe: Make Edit Control un-editable Pin
Ravi Bhavnani19-Feb-04 7:26
professionalRavi Bhavnani19-Feb-04 7:26 
GeneralRe: Make Edit Control un-editable Pin
J.B.19-Feb-04 15:38
J.B.19-Feb-04 15:38 
Thanks Ravi, and the other guys who have posted to help,
really appreciate it.

Ravi's suggested method seems to work for my needs for now. In addition to the original codes, I also have to re-initialise the brush. Without doing that, the area that is outside the text rectangle area (depends on the font size that is set) will be all in black.

LRESULT MyDlg::OnCtlColorStatic(WPARAM wParam, LPARAM lParam)
{
    // Override this method to impart a normal background to the edit
    // control
    HDC hDC = (HDC)wParam;
    HWND hwndCtl = (HWND) lParam;
    UINT uCtrlId = ::GetDlgCtrlID (hwndCtl);

    // Delete the old brush
    m_brushBkg.DeleteObject();
    // Create a new brush in the specified color (white)
    m_brushBkg.CreateSolidBrush(RGB (255, 255, 255));

    if (uCtrlId == IDC_LABEL_DISPLAY) {
    CDC *pDC = CDC::FromHandle (hDC);
    pDC->SetBkColor (RGB (255, 255, 255));
        return (LRESULT) (HBRUSH) m_brushBkg.GetSafeHandle();
    }
    return Default();
}

GeneralRe: Make Edit Control un-editable Pin
Ravi Bhavnani20-Feb-04 4:09
professionalRavi Bhavnani20-Feb-04 4:09 
GeneralRe: Make Edit Control un-editable Pin
J.B.20-Feb-04 5:12
J.B.20-Feb-04 5:12 
QuestionHow do I create AVI animation from series of BMPs? Pin
johannks19-Feb-04 3:23
johannks19-Feb-04 3:23 
AnswerRe: How do I create AVI animation from series of BMPs? Pin
Admiral Quality19-Feb-04 11:15
Admiral Quality19-Feb-04 11:15 
GeneralSoundcards - advanced interfaces Pin
peterchen19-Feb-04 3:14
peterchen19-Feb-04 3:14 
GeneralRe: Soundcards - advanced interfaces Pin
Prakash Nadar19-Feb-04 5:18
Prakash Nadar19-Feb-04 5:18 
GeneralOverriding HyperLink in CHtmlEditCtrl Pin
panzerdivisionmarkus19-Feb-04 2:43
panzerdivisionmarkus19-Feb-04 2:43 
GeneralExecuting an exe file without using shell commands like execv or ShellExecute etc Pin
Member 48989819-Feb-04 1:05
Member 48989819-Feb-04 1:05 
GeneralRe: Executing an exe file without using shell commands like execv or ShellExecute etc Pin
David Crow19-Feb-04 3:02
David Crow19-Feb-04 3:02 
GeneralRe: Executing an exe file without using shell commands like execv or ShellExecute etc Pin
Michael Dunn19-Feb-04 4:41
sitebuilderMichael Dunn19-Feb-04 4:41 
GeneralRe: Executing an exe file without using shell commands like execv or ShellExecute etc Pin
Prakash Nadar19-Feb-04 5:14
Prakash Nadar19-Feb-04 5:14 
GeneralRe: Executing an exe file without using shell commands like execv or ShellExecute etc Pin
Anonymous19-Feb-04 12:37
Anonymous19-Feb-04 12:37 
QuestionHow to make transparent CProgress in CDialog ? Pin
vgrigor19-Feb-04 0:12
vgrigor19-Feb-04 0:12 
AnswerRe: How to make transparent CProgress in CDialog ? Pin
Prakash Nadar19-Feb-04 2:20
Prakash Nadar19-Feb-04 2:20 
GeneralRe: How to make transparent CProgress in CDialog ? Pin
vgrigor19-Feb-04 4:19
vgrigor19-Feb-04 4:19 
QuestionChange the bitmap in a Toolbar? Pin
LittleYellowBird19-Feb-04 0:07
LittleYellowBird19-Feb-04 0:07 
AnswerRe: Change the bitmap in a Toolbar? Pin
Robert A. T. Káldy19-Feb-04 3:16
Robert A. T. Káldy19-Feb-04 3:16 

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.