-
May 9th, 2006, 05:27 AM
#1
How to set font in static text dialog box VC++
hi
i had a problem in static text VC++
how to change font in static text (VC++)
i want to modif only one static text. not overall.
thanks.
-
May 9th, 2006, 05:28 AM
#2
Re: How to set font in static text dialog box VC++
Originally Posted by syrhackman
how to change font in static text (VC++)
SetFont() is the function you need.
-
May 9th, 2006, 05:31 AM
#3
Re: How to set font in static text dialog box VC++
sorry,
can u give me an example..
i want to change my static text with ID : ID_STATIC1
thanks.
-
May 9th, 2006, 05:39 AM
#4
Re: How to set font in static text dialog box VC++
Code:
CFont m_Font;
m_Font.Detach();
m_Font.CreateFont(-13, 0, 0, 0, FW_NORMAL, FALSE, FALSE,0,0,0,0,0,0, "Tahoma");
GetDlgItem(IDC_STATIC1)->SetFont(&m_Font);
If this helps . do not forget to Rate This Post. Thx.
-
May 9th, 2006, 05:46 AM
#5
Re: How to set font in static text dialog box VC++
Add a control variable link to your static text. For example, m_Test.
Then you can add in the similar code in your initialisation.
Code:
CFont font;
font.CreateFontW(20, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial")); // lpszFacename
m_Test.SetFont(&font,TRUE);
Perhaps, there might be some easy way to do it.
-
May 9th, 2006, 05:54 AM
#6
Re: How to set font in static text dialog box VC++
Thanks...
It works..
Thanks alot..
-
May 9th, 2006, 06:03 AM
#7
Re: How to set font in static text dialog box VC++
You are welcome .
-
May 9th, 2006, 06:06 AM
#8
Re: How to set font in static text dialog box VC++
To zawther :
how to set ur m_Test to Static Control ????
-
May 9th, 2006, 06:07 AM
#9
Re: How to set font in static text dialog box VC++
-
May 9th, 2006, 06:12 AM
#10
Re: How to set font in static text dialog box VC++
Originally Posted by sunny_sz
how to set ur m_Test to Static Control ????
As zawthet explained: By creating a DDX member variable of type CStatic for the control - you usually do this with ClassWizard.
-
May 9th, 2006, 06:26 AM
#11
Re: How to set font in static text dialog box VC++
Yeah .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|