没有颜色选项 的 字体对话框


原文:http://blog.csdn.net/joeblackzqq/article/details/7164198,文章条理清晰,尤其代码图片使用恰到好处。

主要思路:

1、重载CFontDialog类。

2、添加OnInitDialog()函数,其中颜色控件的ID号,使用Spy++捕捉。

BOOL CMyFontDialong::OnInitDialog()   
{  
    CFontDialog::OnInitDialog();  
      
    CWnd*   pStatic = GetDlgItem( 0x473);         //  0x473: 静态文本框,"颜色:"  
    CWnd*   pComboBox = GetDlgItem( 0x443);       //  0x443:ComboBox:,"颜色下拉框"  
    pStatic->ShowWindow(SW_HIDE);  
    pComboBox->ShowWindow(SW_HIDE);  
      
     return TRUE;   //  return TRUE unless you set the focus to a control
}     

 

 

你可能感兴趣的:(对话框)