Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI ,
i have an edit control and i want to change the text of edit control font to italic.
i am able to chnage the font color but font attributes not working
could you please suggest me how to change this

What I have tried:

void TestDlg::OnBnClickedDefaultRadio()
{
    // TODO: Add your control notification handler code here
    m_editControl.SetWindowText(_T("50"));// here m_edit control is myedit class object and my edit class is inherited from CEdit
    m_editControl.SetTextColor(BLUE);

    CFont m_Font;
    // m_Font.Detach();)
    if (m_Font.CreateFont(-13, 0, 0, 0, FW_LIGHT, TRUE, TRUE, 0, 0, 0, 0, 0, 0, L"Arial") )
    {
       // GetDlgItem(IDC_EDIT1)->SetFont(&m_Font);
        m_editControl.SetFont(&m_Font);
    }

}
Posted
Updated 23-Oct-17 5:06am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900