cpp_learner
cpp_learner

Reputation: 382

MFC:Is it possible to customize the CFontDialog box without creating any child class

I am working on a project where I need to create a font dialog box on a button click.

I used below code:

CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
    m_Font = dlg.GetFont();
}

But here problem is..by default it contains various settings like font family, size, style, color and preview. But here I need only Fontfamily and size and preview settings only.

Is there any alternate to create font dialog box only with "font family, size and preview) without creating any child class.

Upvotes: 0

Views: 238

Answers (1)

xMRi
xMRi

Reputation: 15375

Modify the m_cf.flags member in the dlg object, like CF_EFFECTS etc.

See documentation and change the flags accordingly

Upvotes: 1

Related Questions