zoukankan      html  css  js  c++  java
  • CListCtrl 列表选中项非焦点时也是藍色

    注意 要去掉Show Selection Always选项。


    //列表选中项非焦点时也是藍色
    void CZZHCCEditorDlg::OnRclickList3(NMHDR* pNMHDR, LRESULT* pResult) 
    {
    	// TODO: Add your control notification handler code here
    	
    	*pResult = 0;	
    	
    	NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
    	*pResult = CDRF_DODEFAULT;
    	if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
    	{
    		*pResult = CDRF_NOTIFYITEMDRAW;
    	}
    	else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
    	{
    		*pResult = CDRF_NOTIFYSUBITEMDRAW;
    	}
    	else if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )
    	{
    		int nItem = static_cast<int>( pLVCD->nmcd.dwItemSpec );
    		
    		if (m_ccFileTable.GetItemState(nItem, LVIS_SELECTED) == LVIS_SELECTED)
    		{


    pLVCD->clrText = RGB(255,255,255);
    pLVCD->clrTextBk = RGB(49,150,255);


      

    		}
    
    		*pResult = CDRF_DODEFAULT;
    	}
    	
    }
    

      

  • 相关阅读:
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
    第 6 章 Cinder
  • 原文地址:https://www.cnblogs.com/aoyihuashao/p/3083176.html
Copyright © 2011-2022 走看看