我现在在窗口界面上有几个edit ,实现了根据鼠标移动到的位置(哪个edit),按钮也移动到相应的位置(鼠标所在的edit上),现在的问题是:
1、按钮显示在edit后,怎么才能让按钮总是显示在最前面?
2、当按钮改变位置时,整个界面要闪烁一下,怎么才能不闪烁?

解决方案 »

  1.   

    1.
    先获得对应edit的rectEdit;
    CRect rectBtn;
    rectBtn.top = rectEdit.top;
    rectBtn.left = rectEdit.left - ...;
    ...CButton* pYourButton = ...;
    pYourButton->MoveWindow(&rectBtn,TRUE);2.
    不让背景重绘
    BOOL  CYourDlg::OnEraseBkgnd(CDC*  pDC)    
    {    
      return  TRUE;    
             
           //把系统原来的这条语句注释掉。    
      //return  CWnd::OnEraseBkgnd(pDC);  
    }    
      

  2.   

    CButton* pYourButton = ...;
    pYourButton->SetWindowPos(&wndTop ,,,)
      

  3.   

    afx_msg BOOL OnEraseBkgnd( CDC* pDC );
      

  4.   

    1。SetWindowPos
    2。OnEraseBkgnd
      

  5.   

    先获得对应edit的rectEdit;
    CRect rectBtn;
    rectBtn.top = rectEdit.top;
    rectBtn.left = rectEdit.left - ...;
    ...CButton* pYourButton = ...;
    pYourButton->MoveWindow(&rectBtn,TRUE);
    能保证按钮在最前面?????