资料收集站

SDL

Wednesday
Dec 03rd
Text size
  • Increase font size
  • Default font size
  • Decrease font size

我在处理List控件时碰到了麻烦,我想创建一个ListView,来依据Tree控件的选择同时在ListView和ReportView中显示列表的信息.以下是相关的代码:

 // Set full line select

 ListView_SetExtendedListViewStyle(m_plstCustomers->GetSafeHwnd(),

 LVS_EX_FULLROWSELECT);

按如下方法处理:

// -------------------- begin of snippet --------------------------------

bool CCommCtrlUtil32::ListCtrl_ModifyExtendedStyle(CListCtrl&   p_rListCtrl,

                                   const DWORD  p_dwStyleEx,

                                   const bool   p_bAdd)


    HWND t_hWnd = p_rListCtrl.GetSafeHwnd();

    DWORD t_dwStyleEx = ListView_GetExtendedListViewStyle(t_hWnd);

    if(p_bAdd)

    {

        if(0 == (p_dwStyleEx & t_dwStyleEx))

        {

            // add style

            t_dwStyleEx |= p_dwStyleEx;

        }

    }

    else

    {

        if(0 != (p_dwStyleEx & t_dwStyleEx))

        {

            // remove style

            t_dwStyleEx &= ~p_dwStyleEx;

        }

    }

    ListView_SetExtendedListViewStyle(t_hWnd, t_dwStyleEx);

    return true;

Comments (0)Add Comment

Write comment

busy
 

Google 搜索

在线用户

We have 44 guests online