我想写一个static控件,她的背景能和我对话框的背景一样.
我要在那里进行编代码
有没有例子可以给我看看

解决方案 »

  1.   

    徐景周的例子很好的(直接通过ADO操作Access数据库),楼主可以参考,都作成XP风格
      

  2.   

    http://www.codeguru.com/Cpp/controls/staticctrl/datadisplaycontrols/article.php/c8829/
      

  3.   

    楼上的方法在wince的环境下运行就不行了
      

  4.   

    把它设置成透明就行了
    HBRUSH CXXXX::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

    // TODO: Change any attributes of the DC here

    if (nCtlColor==CTLCOLOR_STATIC || nCtlColor==CTLCOLOR_EDIT)
    {
    pDC->SetBkMode(TRANSPARENT);
    return (HBRUSH)::GetStockObject(NULL_BRUSH);
    }
    if (nCtlColor==CTLCOLOR_DLG)
    return (HBRUSH)m_BKBrush.GetSafeHandle();
    // TODO: Return a different brush if the default is not desired
    return hbr;
    }