CColorListBox: A list box with colored strings - 彩色文本列表框


日期: 2000-01-13 14:00 | 联系我
关注我: Telegram, Twitter

本程序 CColorListBox 实现彩色文本列表框(A list box with colored strings),如图:

彩色文本列表框(A list box with colored strings)程序拥有下列特性:

  • The focus rectangle is now drawn only when the control has the input focus.
  • Items in the list are properly colored when the list box is disabled.
  • Items in the list are properly displayed when the LBS_USETABSTOPS style is set.
  • The entire rectangle of the selected item is now colored, instead of just the text background rectangle.
  • When an item is selected, the text color inverts, and the highlight color is the original text color (like the Cyan list item in the above graphic).

    彩色文本列表框(A list box with colored strings) 提供下列公共接口:

    
    int AddString(LPCTSTR lpszItem);
    int AddString(LPCTSTR lpszItem, COLORREF rgb);
    int InsertString(int nIndex, LPCTSTR lpszItem);
    int InsertString(int nIndex, LPCTSTR lpszItem, COLORREF rgb);
    void SetItemColor(int nIndex, COLORREF rgb);
    

    彩色文本列表框(A list box with colored strings) 示例代码:

    
    m_lbColor.AddString("Green", RGB(0, 255, 0));
    m_lbColor.InsertString(0, "Red", RGB(255, 0, 0));
    
    下载彩色文本列表框(A list box with colored strings)源代码及演示程序


  •  文章评论
    目前没有任何评论.

    ↓ 快抢占第1楼,发表你的评论和意见 ↓

    当前页面是本站的 Google AMP 版本。
    欲查看完整版本和发表评论请点击:完整版 »

     

    程序员小辉 建站于 1997
    Copyright © XiaoHui.com; 保留所有权利。