1 duilib 自繪標題 最大化表徵圖顯示bug ----WindowImplBase的bug

來源:互聯網
上載者:User

標籤:class   blog   http   com   set   html   

視窗最大化之後有兩個問題,    1、最大化按鈕的樣式還是沒變,正確的樣式應該是這樣的    2、再次點擊最大化按鈕,不能還原到正常大小。    這個是WindowImplBase的bug,已經提交給官方有一段時間了,但是貌似沒有被合并到SVN上去,所以這裡說明一下,我們需要在WindowImplBase的OnSysCommand函數裡,在if( ::IsZoomed(*this) != bZoomed )裡面加上下面這段代碼:
if( ::IsZoomed(*this) != bZoomed )    {        CControlUI* pbtnMax     = static_cast<CControlUI*>(m_PaintManager.FindControl(_T("maxbtn")));       // 最大化按鈕        CControlUI* pbtnRestore = static_cast<CControlUI*>(m_PaintManager.FindControl(_T("restorebtn")));   // 還原按鈕         // 切換最大化按鈕和還原按鈕的狀態        if (pbtnMax && pbtnRestore)        {            pbtnMax->SetVisible(TRUE == bZoomed);       // 此處用運算式是為了避免編譯器BOOL轉換的警告            pbtnRestore->SetVisible(FALSE == bZoomed);        }    }

  原文:http://www.cnblogs.com/Alberl/p/3344886.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.