我的程序是对话框程序!谢谢

解决方案 »

  1.   

    对话框的某些参数设错了,所以系统没有给你发出WM_PAINT消息。又或者DC用完没有释放,导致重绘失败。
      

  2.   

    在ONPAINT中改写一下一下代码试试
    CDC memDC ;
    CBitmap memBitmap ;
    CBitmap* oldBitmap ; // bitmap originally found in CMemDC

    // no real plotting work is performed here, 
    // just putting the existing bitmaps on the client

    // to avoid flicker, establish a memory dc, draw to it 
    // and then BitBlt it to the client
    memDC.CreateCompatibleDC(&dc) ;
    memBitmap.CreateCompatibleBitmap(&dc, m_nClientWidth, m_nClientHeight) ;
    oldBitmap = (CBitmap *)memDC.SelectObject(&memBitmap) ;

    if (memDC.GetSafeHdc() != NULL)
    {
    // first drop the grid on the memory dc
    memDC.BitBlt(0, 0, m_nClientWidth, m_nClientHeight, 
    &m_dcGrid, 0, 0, SRCCOPY) ;
    // now add the plot on top as a "pattern" via SRCPAINT.
    // works well with dark background and a light plot
    memDC.BitBlt(0, 0, m_nClientWidth, m_nClientHeight, 
    &m_dcPlot, 0, 0, SRCPAINT) ;  //SRCPAINT
    // finally send the result to the display
    dc.BitBlt(0, 0, m_nClientWidth, m_nClientHeight, 
    &memDC, 0, 0, SRCCOPY) ;
    }

    memDC.SelectObject(oldBitmap) ;
      

  3.   

    如果方便的话,可以考虑用PICTURE控件。
    PICTURE控件有一个属性,可以放图
      

  4.   

    OnPaint()函数是在View窗体大小发生变化或者最小化还原以后调用的,
    你这个程序应在OnDraw中重画。