比如画一条直线,如何实现?谢谢

解决方案 »

  1.   

    有《MFC开发人员指南》吗?在473页有讲。
      

  2.   

    such as this code:
    > > LOGFONT LogFont;
    > > memset((void *)&LogFont,0,sizeof(LogFont));
    > > LogFont.lfHeight = 24;
    > > LogFont.lfWeight = 500;    // use 700 or so for bold
    > > _tcscpy(LogFont.lfFaceName,"MS Sans Serif");
    > > upsFont.CreateFontIndirect(&LogFont);
    > >
    > > CWnd *cwn = GetDlgItem(IDC_LAST_COMMENT);
    > > if(cwn) cwn->SetFont(&upsFont);
      

  3.   

    CDC *pDC=
       CDC::FromHandle(::GetDC(GetDlgItem(IDC_STATIC)->GetSafeHwnd()));
    pDC->MoveTo(0,0);
    pDC->LineTo(100,100);
    ReleaseDC(pDC);这样就可以了
      

  4.   

    OnDrawItem
        (
        int nIDCtl,
        LPDRAWITEMSTRUCT lpDIS
        )    {    if( nIDCtl==IDC_STATIC )
       {
            CWnd *pWnd = GetDlgItem(IDC_STATIC );

    CDC dc;
    dc.Attach(lpDIS->hDC);
    dc.MoveTo(0,0);
             dc.LineTo(20,20);
    dc. Detach();
        }
    }
      

  5.   

    CWnd *pWnd = GetDlgItem(IDC_STATIC );
    这句不要
      

  6.   

    重载CStatic,在OnPain里想干什么都行。