Looking for a Edit box where i can set the font size.
-
Hi, I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control?? Thanks, Willem
Yes, the Edit control is what you want. Just select a different font into its DC.
-
Yes, the Edit control is what you want. Just select a different font into its DC.
-
DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!
Use
SetFont()
, which is a method of the baseCWnd
class. See the documentation ofCFont
before using this function. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com -
DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!
By using SetFont():
BOOL CMyDlg::OnInitDialog() { CDialog::OnInitDialog(); m_font.CreateStockObject(SYSTEM_FIXED_FONT); m_edit1.SetFont(&m_font); return TRUE; }
-
DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!
create a font, and set the edit control to use it. The font object should be a member var in your dlg class. Method 1: --------- OnInitDialog() { ... m_oFont.CreatePointFont(80,"MS Sans serif"); m_oEditControl.SetFont(&m_oFont); ... } Method 2: --------- static LOGFONT BASED_CODE sEditFont = { -10, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_STRING_PRECIS, CLIP_STROKE_PRECIS, DEFAULT_QUALITY, VARIABLE_PITCH|FF_SWISS, "Arial"}; OnInitDialog() { ... m_oFont.CreateFontIndirect(&sEditFont); m_oEditControl.SetFont(&m_oFont); ... }
-
Hi, I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control?? Thanks, Willem