编辑框文字的字体 [英] font to edit box text

查看:99
本文介绍了编辑框文字的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何仅将字体应用于编辑框中的选定文本,而不应用于整个文本?

How to apply font only to the selected text in the edit box but not the whole text??

void CfontyDlg::OnBnClickedFont()
{
	UpdateData(TRUE);
	CFontDialog dlg;
	LOGFONT lf;
	CFont *pFont = GetFont();
	pFont->GetLogFont(&lf);
	if (dlg.DoModal()== IDOK)
	{
	dlg.GetCurrentFont(&lf);
	m_font.DeleteObject();
	m_font.CreateFontIndirect(&lf);
	GetDlgItem(IDC_EDIT1)->SetFont(&m_font);
	}
}


请让我知道如何修改以上功能...
Thankyou


please let me know how can i modify the above function...
Thankyou

推荐答案

您将必须创建一个所有者绘制的控件,然后自己创建此效果...

我建议您访问文章 [
You will have to create an owner drawn control and then create this effect yourself...

I would recommend you to visit the articles[^] here in CP.

Using a normal edit control you won''t be able to do it, Wes is 100% right here.

Good luck.


这篇关于编辑框文字的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆