谁有关于使用这个公共对话框的例子。。嘿嘿不太会用这个。怎么样把里面对应的选择的项目和相应的字联系起来请不吝赐教
解决方案 »
- 实用连接数据库函数的怪问题 求助
- 如何读取ini中的多行数据
- 如何控制输出字符?急求!
- 在对话框中怎么访问父窗口的对象,急!!!!
- ADO连接SQL Server的连接字符串
- DirectShow 播放MPGE4文件 得到视频MediaSample 我怎么知道哪一桢是I桢,哪一桢是P桢呢!?
- 请教高人!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 再次请教问题
- 哪里有"Windows网络编程技术"的电子书(中文版)可以下载?马上给分!!
- visual c++中如何静态实现控件数组
- 请问,如何使用setup api获得u盘的盘付,或者获取它的serial number
- 大家不要讽刺我,我真的不太会,帮忙…………………………………………………………………………………………
{
// TODO: Add your command handler code here
CFontDialog dlg;
if(IDOK==dlg.DoModal())
{
if(m_font.m_hObject)
m_font.DeleteObject();
m_font.CreateFontIndirect(dlg.m_cf.lpLogFont);
m_strFontName=dlg.m_cf.lpLogFont->lfFaceName;
Invalidate();
}
}
关键是掌握m_cf.lpLogFont这个结构体指针,到msdn查一下,有很多信息的
LOGFONT m_lFont;
COLORREF m_cTextColor; m_cTextColor = RGB(0,0,0); m_lFont.lfHeight = 16;
m_lFont.lfWidth = 0;
m_lFont.lfEscapement = 0;
m_lFont.lfOrientation = 0;
m_lFont.lfWeight = FW_NORMAL;
m_lFont.lfItalic = FALSE;
m_lFont.lfUnderline = FALSE;
m_lFont.lfStrikeOut = FALSE;
m_lFont.lfCharSet = GB2312_CHARSET;
m_lFont.lfOutPrecision = OUT_STROKE_PRECIS;
m_lFont.lfClipPrecision = CLIP_STROKE_PRECIS;
m_lFont.lfQuality = DRAFT_QUALITY;
m_lFont.lfPitchAndFamily = VARIABLE_PITCH|FF_MODERN;
strcpy(m_lFont.lfFaceName,"宋体");
CFontDialog dlg;
dlg.m_cf.lpLogFont = &m_lFont; dlg.m_cf.rgbColors = m_cTextColor;
dlg.m_cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS ; if(dlg.DoModal() == IDOK)
{
dlg.GetCurrentFont(&m_lFont);
}
如果在doc里做的,用成员变量保存起来,然后在view中OnDraw()
pDoc->成员变量就可以了
总之用成员变量保存起来就OK