Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to hide the view of MDI program at startup Pin
mr20032-Sep-03 8:07
mr20032-Sep-03 8:07 
GeneralRe: how to hide the view of MDI program at startup Pin
KaЯl2-Sep-03 8:29
KaЯl2-Sep-03 8:29 
Questionhow to hide the view of MDI program Pin
Anonymous1-Sep-03 8:05
Anonymous1-Sep-03 8:05 
QuestionHow to fit a bitmap into a CStatic control Pin
tico_tech1-Sep-03 7:38
tico_tech1-Sep-03 7:38 
AnswerRe: How to fit a bitmap into a CStatic control Pin
Anonymous1-Sep-03 10:46
Anonymous1-Sep-03 10:46 
GeneralAnybody please help with linked list implementation Pin
digiman20031-Sep-03 6:02
digiman20031-Sep-03 6:02 
GeneralRe: Anybody please help with linked list implementation Pin
DViggiano1-Sep-03 7:11
DViggiano1-Sep-03 7:11 
GeneralOnPaint problem Pin
YaronNir1-Sep-03 5:59
YaronNir1-Sep-03 5:59 
hi all,

I have a round dialog, i use the OnColorCTL to color the background of the dialog to yellow. i use OnPaint and dc.TextOut to display text on the round dialog. also i want to draw an ellipse as a mark for the round dialog border

here is the code i use in the OnPaint():

void CRoundDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting

	CRect rect,rectTmp;
	GetWindowRect(rect);
	ScreenToClient(rect);
	

	rectTmp = CRect(rect.left + 17 * SPACE_MARGINGS,
					rect.top  + 23 * SPACE_MARGINGS,
					rect.Width(),
					rect.Height());

	// draw the dialog backgroud 
	CBrush* pOldBrush = dc.SelectObject(&m_brush);

	dc.SetBkColor(MESSAGE_BOX_DIALOG_BK_COLOR);
	dc.SetTextColor(MESSAGE_BOX_TEXT_COLOR);
	
	dc.TextOut(rectTmp.left,rectTmp.top,m_szText);


	dc.PatBlt(0, 0,rect.Width(),rect.Height(), PATCOPY);

	//draw the ellipse border
	CPen* pOldPen= dc.SelectObject(&m_Pen);
	rect.DeflateRect(4,4,4,4);
	dc.Ellipse(rect);

	dc.SelectObject(pOldBrush);
	dc.SelectObject(pOldPen);
	
}


trouble is that i see the rectangle but i don't see the text.....

can any1 help here?

thanks in advanced

Yaron

Ask not what your application can do for you,
Ask what you can do for your application
GeneralRe: OnPaint problem Pin
Stefan Pedersen1-Sep-03 10:34
Stefan Pedersen1-Sep-03 10:34 
GeneralRe: OnPaint problem Pin
YaronNir2-Sep-03 4:08
YaronNir2-Sep-03 4:08 
GeneralRe: OnPaint problem Pin
Neville Franks1-Sep-03 10:47
Neville Franks1-Sep-03 10:47 
GeneralRe: OnPaint problem Pin
YaronNir2-Sep-03 4:08
YaronNir2-Sep-03 4:08 
GeneralI would like to calculate pi. Pin
Snyp1-Sep-03 4:23
Snyp1-Sep-03 4:23 
GeneralRe: I would like to calculate pi. Pin
Ted Ferenc1-Sep-03 4:53
Ted Ferenc1-Sep-03 4:53 
GeneralRe: I would like to calculate pi. Pin
Dominik Reichl1-Sep-03 6:32
Dominik Reichl1-Sep-03 6:32 
GeneralRe: I would like to calculate pi. Pin
User 66581-Sep-03 5:31
User 66581-Sep-03 5:31 
GeneralRe: I would like to calculate pi. Pin
Anonymous1-Sep-03 6:52
Anonymous1-Sep-03 6:52 
GeneralSTL deque container question Pin
YaronNir1-Sep-03 3:59
YaronNir1-Sep-03 3:59 
GeneralRe: STL deque container question Pin
ZoogieZork1-Sep-03 4:20
ZoogieZork1-Sep-03 4:20 
GeneralRe: STL deque container question Pin
YaronNir1-Sep-03 4:21
YaronNir1-Sep-03 4:21 
GeneralRe: STL deque container question Pin
ZoogieZork1-Sep-03 4:24
ZoogieZork1-Sep-03 4:24 
GeneralRe: STL deque container question Pin
YaronNir1-Sep-03 4:29
YaronNir1-Sep-03 4:29 
GeneralWrapping Popup Menus Pin
Neal Stublen1-Sep-03 3:32
Neal Stublen1-Sep-03 3:32 
GeneralRe: Wrapping Popup Menus Pin
Neville Franks1-Sep-03 10:49
Neville Franks1-Sep-03 10:49 
GeneralString pointers (using stl) Pin
RChin1-Sep-03 2:52
RChin1-Sep-03 2:52 

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.