Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConfused with the resource using Pin
bloodwinner18-Sep-06 2:50
bloodwinner18-Sep-06 2:50 
AnswerRe: Confused with the resource using Pin
Hamid_RT18-Sep-06 3:10
Hamid_RT18-Sep-06 3:10 
GeneralRe: Confused with the resource using Pin
bloodwinner18-Sep-06 3:13
bloodwinner18-Sep-06 3:13 
GeneralRe: Confused with the resource using Pin
toxcct18-Sep-06 3:24
toxcct18-Sep-06 3:24 
GeneralRe: Confused with the resource using Pin
Hamid_RT18-Sep-06 3:31
Hamid_RT18-Sep-06 3:31 
QuestionDrawing radio buttons - text positioning Pin
achimschoen18-Sep-06 2:43
professionalachimschoen18-Sep-06 2:43 
AnswerRe: Drawing radio buttons - text positioning Pin
Hamid_RT18-Sep-06 3:13
Hamid_RT18-Sep-06 3:13 
GeneralRe: Drawing radio buttons - text positioning Pin
achimschoen18-Sep-06 3:37
professionalachimschoen18-Sep-06 3:37 
Maybe the easisiest ways is to use some code to show my problem on drawing the radio button.

PaintRadioButton(CDC* pDC, const CRect& rcPos, const CFont& font, const CString& strText)<br />
{<br />
 // draw radio button background<br />
 DWORD dwBackground = GetSysColor(COLOR_BTNFACE);<br />
 CBrush brushBk(dwBackground);<br />
 pDC->FillRect(rcRadioButton, &brushBk);<br />
<br />
 // draw radio button circle<br />
 CRect rcCircle;<br />
 CalcCircleRect(rcPos, rcCirlce);<br />
 pDC->DrawFrameControl(rcCircle, DFC_BUTTON, DFCS_BUTTONRADIO);<br />
<br />
 // draw radio button text<br />
 CalcTextRect(rcPos, rcText, font, strText);<br />
 pDC->DrawText(strText, rcText, DT_LEFT|DT_VCENTER|DT_SINGLELINE);<br />
<br />
}


CalcCircleRect(const CRect& rcPos, CRect& rcCirlce) is easy to implement, just center the box vertically and make an offset of 1 in the horicontal position. The size could be received through GetSystemMetrics(SM_CXMENUCHECK);

CalcTextRect(const CRect& rcPos, CRect& rcTextPos, cont CFont& font, const CString& strText) Is the thing what is missing. Do you know some magic formula how to calculate the exact position for the text depending on font, font size and text content so it looks exactly like the radio button controls?
QuestionYahoo's sign-in seal technology Pin
George_George18-Sep-06 2:29
George_George18-Sep-06 2:29 
QuestionIOCTL Pin
Pratheep Kenny18-Sep-06 2:12
Pratheep Kenny18-Sep-06 2:12 
AnswerRe: IOCTL Pin
James R. Twine19-Sep-06 4:50
James R. Twine19-Sep-06 4:50 
QuestionSetting Color for The button control Pin
Pratheep Kenny18-Sep-06 2:08
Pratheep Kenny18-Sep-06 2:08 
AnswerRe: Setting Color for The button control Pin
Rinu_Raj18-Sep-06 2:16
Rinu_Raj18-Sep-06 2:16 
AnswerRe: Setting Color for The button control Pin
Hamid_RT18-Sep-06 2:28
Hamid_RT18-Sep-06 2:28 
QuestionClient-server program help Pin
eric_tran18-Sep-06 2:07
eric_tran18-Sep-06 2:07 
QuestionRemoving the noise from a recorded .wav file. Pin
Rajiya18-Sep-06 1:19
Rajiya18-Sep-06 1:19 
AnswerRe: Removing the noise from a recorded .wav file. Pin
Waldermort18-Sep-06 1:23
Waldermort18-Sep-06 1:23 
AnswerRe: Removing the noise from a recorded .wav file. Pin
normanS18-Sep-06 20:08
normanS18-Sep-06 20:08 
QuestionDate Operations Pin
mikobi18-Sep-06 1:06
mikobi18-Sep-06 1:06 
AnswerRe: Date Operations Pin
Naveen18-Sep-06 1:10
Naveen18-Sep-06 1:10 
GeneralRe: Date Operations Pin
Naveen18-Sep-06 1:12
Naveen18-Sep-06 1:12 
QuestionMFC /database please help ! Pin
Bravoone_200618-Sep-06 0:57
Bravoone_200618-Sep-06 0:57 
AnswerRe: MFC /database please help ! Pin
Hamid_RT18-Sep-06 1:21
Hamid_RT18-Sep-06 1:21 
GeneralRe: MFC /database please help ! Pin
Bravoone_200618-Sep-06 1:38
Bravoone_200618-Sep-06 1:38 
GeneralRe: MFC /database please help ! Pin
Hamid_RT18-Sep-06 1:58
Hamid_RT18-Sep-06 1:58 

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.