动态设置MFC picture控件的图标
动态设置MFC picture控件的图标
//首先要将picture属性 TYPE设置为ICO
CStatic *pStatic = (CStatic*)GetDlgItem(IDC_STATIC); //IDC_STATIC picture控件的Id
if (pStatic != NULL)
{
HICON &hIco = AfxGetApp()->LoadIcon(IDR_MAINFRAME); //IDR_MAINFRAME 图标ID
pStatic->SetIcon(hIco);
}
页:
[1]