Click here to Skip to main content
16,016,770 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to implement Global Pointers ? Pin
Chris Losinger7-Aug-02 13:14
professionalChris Losinger7-Aug-02 13:14 
AnswerRe: How to implement Global Pointers ? Pin
Todd Smith8-Aug-02 18:35
Todd Smith8-Aug-02 18:35 
GeneralRe: How to implement Global Pointers ? Pin
oRion9-Aug-02 4:43
oRion9-Aug-02 4:43 
GeneralParadox database ... Pin
Hadi Rezaee7-Aug-02 12:55
Hadi Rezaee7-Aug-02 12:55 
GeneralAccess DB Pin
alex.barylski7-Aug-02 12:00
alex.barylski7-Aug-02 12:00 
GeneralRe: Access DB Pin
Tomasz Sowinski7-Aug-02 12:13
Tomasz Sowinski7-Aug-02 12:13 
GeneralRe: Access DB Pin
alex.barylski7-Aug-02 12:30
alex.barylski7-Aug-02 12:30 
GeneralButton size Pin
orcun colak7-Aug-02 11:56
orcun colak7-Aug-02 11:56 
I have a check box button that I create as child of another window at run time. I could not make the checkbox as big as the its window text. it is always bigger that the text. How can I make the check box fit to its text ?
The code I am using is below.

void CParentWindow::PreSubclassWindow()
{
CRect Rect;
GetWindowRect(&Rect);
ScreenToClient(&Rect);

CDC * dc = this->GetDC();
CSize size = dc->GetTextExtent(strCheckBoxCaption);

//Create the check box rectangle
CRect CheckRect (Rect.left + 5, Rect.top , Rect.left + size.cx,
Rect.top + size.cy);
m_Check.Create(strCaption,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_CHECKBOX,
CheckRect,this, 1);
}

Christian Grauss has an article that creates a check box in a static window. But his check box is also bigger than its text.So I could not find an example. How can I fix this ? Confused | :confused:
Thank you



Orcun Colak

GeneralRe: Button size Pin
Christian Graus7-Aug-02 13:15
protectorChristian Graus7-Aug-02 13:15 
GeneralDeskband compilation weirdness Pin
User 66587-Aug-02 10:36
User 66587-Aug-02 10:36 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:39
Anonymous7-Aug-02 10:39 
GeneralRe: Deskband compilation weirdness Pin
User 66587-Aug-02 10:43
User 66587-Aug-02 10:43 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:50
Anonymous7-Aug-02 10:50 
GeneralRe: Deskband compilation weirdness Pin
Anonymous7-Aug-02 10:55
Anonymous7-Aug-02 10:55 
GeneralRe: Deskband compilation weirdness Pin
Atlantys7-Aug-02 10:48
Atlantys7-Aug-02 10:48 
GeneralRe: Deskband compilation weirdness Pin
Chris Richardson7-Aug-02 11:21
Chris Richardson7-Aug-02 11:21 
QuestionRight way or Wrong way ? Pin
CrazySkydiver7-Aug-02 10:25
CrazySkydiver7-Aug-02 10:25 
AnswerRe: Right way or Wrong way ? Pin
Chris Losinger7-Aug-02 10:41
professionalChris Losinger7-Aug-02 10:41 
GeneralCLongBinary and Afx entry Pin
ns7-Aug-02 10:03
ns7-Aug-02 10:03 
GeneralCButtonST - multi line text and ascii chars Pin
jimNLX7-Aug-02 9:40
jimNLX7-Aug-02 9:40 
GeneralRe: CButtonST - multi line text and ascii chars Pin
Chris Losinger7-Aug-02 10:44
professionalChris Losinger7-Aug-02 10:44 
GeneralAlt + F4 Pin
Anonymous7-Aug-02 9:33
Anonymous7-Aug-02 9:33 
GeneralRe: Alt + F4 Pin
Tomasz Sowinski7-Aug-02 10:13
Tomasz Sowinski7-Aug-02 10:13 
GeneralRe: Alt + F4 Pin
Anonymous7-Aug-02 10:20
Anonymous7-Aug-02 10:20 
GeneralRe: Alt + F4 Pin
Tomasz Sowinski7-Aug-02 10:26
Tomasz Sowinski7-Aug-02 10:26 

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.