首页 > 学院 > 开发设计 > 正文

设计OutLook风格的工具栏

2019-11-17 05:15:17
字体:
来源:转载
供稿:网友

  m_ImageList.Create(32, 32, ILC_COLOR16 ILC_MASK,1, 4);  

  HICON hIcon = ::LoadIcon (AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_LOG));

  m_ImageList.Add(hIcon);

  hIcon = ::LoadIcon (AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ONLINE_USERS));

  m_ImageList.Add(hIcon);

  hIcon = ::LoadIcon (AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_CONFIGURATION));

  m_ImageList.Add(hIcon);

  hIcon = ::LoadIcon (AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_STATISTICS));

  m_ImageList.Add(hIcon);

  hIcon = ::LoadIcon (AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_SECURITY));

  m_ImageList.Add(hIcon);  

   m_OutlookBar.SetImageList(&m_ImageList, LVSIL_NORMAL);  

   CRect rc;

   m_OutlookBar.GetClientRect(rc);  

   // set new icon spacing

   m_OutlookBar.SetIconSpacing(rc.Width(), 64);  

   // change colors

   m_OutlookBar.SetTextColor(RGB(255,255,255));

   m_OutlookBar.SetTextBkColor(RGB(128,128,128));

   m_OutlookBar.SetBkColor(RGB(128,128,128));   

   // insert items

   m_OutlookBar.InsertColumn(0, "OutlookBar");  

   m_OutlookBar.InsertItem(0, "Server Log", 0);

   m_OutlookBar.InsertItem(1, "Online Users", 1);

   m_OutlookBar.InsertItem(2, "Configuration", 2);

   m_OutlookBar.InsertItem(3, "Statistics", 3);

   m_OutlookBar.InsertItem(4, "Security", 4);

原文地址:http://blog.csdn.net/goingup/archive/2006/03/05/615885.aspx

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表