Home > Back-end >  Modify text box font
Modify text box font

Time:11-02

C + + Windows programs designed to create a text box, but don't know how to modify the input text font, turn to god

CodePudding user response:

TextBox1 - & gt; The Font - & gt; Style=textBox1 - & gt; The Font - & gt; Style CodePudding user response:

In MFC dialog box, if you want to set the font size of static text box, not directly in the attribute set inside, need to write code set, specific methods are as follows:
1, in the MFC dialog box placed the static text box;
2, add controls associated variables, m_static (value) is control, not under//change first ID can add normal control variable
3, declare global class objects: CFont CFont;
4, in the initial setup dialog, the following code:
Cfont. CreatePointFont (150, _T (" black "), NULL);
GetDlgItem (IDC_STATIC_TITLE) - & gt; The SetFont (& amp; Cfont);
  • Related