Click here to Skip to main content
15,887,676 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [MFC] TextBox Pin
Naveen8-May-06 17:36
Naveen8-May-06 17:36 
GeneralRe: [MFC] TextBox Pin
Anu_Bala8-May-06 19:49
Anu_Bala8-May-06 19:49 
GeneralRe: [MFC] TextBox Pin
Naveen8-May-06 20:00
Naveen8-May-06 20:00 
AnswerRe: [MFC] TextBox Pin
Hamid_RT8-May-06 20:54
Hamid_RT8-May-06 20:54 
QuestionKeyboard Hook Fails in Terminal Session Pin
benm999999998-May-06 12:11
benm999999998-May-06 12:11 
AnswerRe: Keyboard Hook Fails in Terminal Session Pin
Naveen8-May-06 18:08
Naveen8-May-06 18:08 
GeneralRe: Keyboard Hook Fails in Terminal Session Pin
benm9999999910-May-06 5:50
benm9999999910-May-06 5:50 
QuestionDoing an NcPaint on a CEdit derived control. ( fixed , read for solution ) Pin
Maximilien8-May-06 9:29
Maximilien8-May-06 9:29 
I found the solution, which was in some other part of my code, I need to call Default() to force the drawing of the "inside" before drawing the border.


I'm trying to draw a border around a CEdit derived control.

The CEdit has the "Vertical Scroll"

void CMyEdit::OnNcPaint() 
{
 // needed to draw the inside.
 Default();


 CDC* pDC = GetParent()->GetDC();

 CRect screenRect;
 GetWindowRect( screenRect );
 ScreenToClient( screenRect );
	
 CRect newRect;
 newRect = screenRect;
 ClientToScreen( newRect );
 GetParent()->ScreenToClient( newRect );

 pDC->FrameRect( newRect, &m_BorderBrushFocus );
 newRect.DeflateRect( 1, 1, 1, 1 );
 pDC->FrameRect( newRect,&m_BorderBrushFocus );
}


When doing this, it draws the frame around the CEdit, but it hides the vertical scrollbar; when I start typing in the edit box, the "shape" of the scrollbar is visible, and if I add enough text to enable the scrollbar, it appears; but only if no repaint is necessary, then it will be erased.

Am I allowed to draw in such fashion ?

Thanks.




Maximilien Lincourt
Your Head A Splode - Strong Bad

-- modified at 16:00 Monday 8th May, 2006
AnswerRe: Doing an NcPaint on a CEdit derived control. ( fixed , read for solution ) Pin
Hamid_RT8-May-06 19:14
Hamid_RT8-May-06 19:14 
QuestionCWaitCursor Problems Pin
JBAK_CP8-May-06 8:10
JBAK_CP8-May-06 8:10 
AnswerRe: CWaitCursor Problems Pin
David Crow8-May-06 8:25
David Crow8-May-06 8:25 
GeneralRe: CWaitCursor Problems Pin
JBAK_CP8-May-06 8:51
JBAK_CP8-May-06 8:51 
AnswerRe: CWaitCursor Problems Pin
Michael Dunn8-May-06 10:06
sitebuilderMichael Dunn8-May-06 10:06 
AnswerRe: CWaitCursor Problems Pin
Nibu babu thomas8-May-06 18:48
Nibu babu thomas8-May-06 18:48 
GeneralRe: CWaitCursor Problems Pin
JBAK_CP9-May-06 2:17
JBAK_CP9-May-06 2:17 
QuestionHow to add Application and port into Firewall Exception list windows 2000 Pin
mahesh_patil1668-May-06 6:51
mahesh_patil1668-May-06 6:51 
QuestionUser clicks Pin
llp00na8-May-06 6:46
llp00na8-May-06 6:46 
AnswerRe: User clicks Pin
led mike8-May-06 7:56
led mike8-May-06 7:56 
GeneralRe: User clicks Pin
llp00na8-May-06 8:11
llp00na8-May-06 8:11 
GeneralRe: User clicks Pin
Stephen Hewitt8-May-06 15:56
Stephen Hewitt8-May-06 15:56 
AnswerRe: User clicks Pin
David Crow8-May-06 8:28
David Crow8-May-06 8:28 
GeneralRe: User clicks Pin
llp00na8-May-06 8:37
llp00na8-May-06 8:37 
GeneralRe: User clicks Pin
David Crow8-May-06 8:51
David Crow8-May-06 8:51 
GeneralRe: User clicks Pin
llp00na8-May-06 9:14
llp00na8-May-06 9:14 
GeneralRe: User clicks Pin
David Crow8-May-06 9:25
David Crow8-May-06 9:25 

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.