共用方式為


CListCtrl::GetColumn

擷取清單檢視控制項的屬性。

BOOL GetColumn( 
   int nCol, 
   LVCOLUMN* pColumn  
) const;

參數

  • nCol
    屬性會擷取資料行的索引。

  • pColumn
    指定訊息擷取 LVCOLUMN 結構的位址和取得有關這個資料行的相關資訊。 遮罩 成員指定哪一個資料行屬性擷取。 如果 遮罩 成員指定 LVCF_TEXT 值, pszText 成員必須包含接收項目文字,並 cchTextMax 成員必須指定緩衝區大小的緩衝區的位址。

傳回值

如果不是零,則成功,則為零。

備註

LVCOLUMN 結構在報表檢視包含了資料行的相關資訊。

範例

       LVCOLUMN col;

        col.mask = LVCF_WIDTH;

        // Double the column width of the first column. 
        if (m_myListCtrl.GetColumn(0, &col))
        {
            col.cx *= 2;
            m_myListCtrl.SetColumn(0, &col);
        }

需求

Header: afxcmn.h

請參閱

參考

CListCtrl 類別

階層架構圖表

CListCtrl::SetColumn

CListCtrl::GetColumnWidth