龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

VC++实现工具栏上添加平面组合框控件(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
三、程序代码 ////////////////////////////////////////////////////////////////////////////// // FlatComboBox.h : header file #if !defined(FLATCOMBOBOX_H_INCLUDED) #define FLATCOMBOBOX_H_INCLUDED

  三、程序代码

//////////////////////////////////////////////////////////////////////////////
// FlatComboBox.h : header file
#if !defined(FLATCOMBOBOX_H_INCLUDED)
#define FLATCOMBOBOX_H_INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define FC_DRAWNORMAL 0x00000001
#define FC_DRAWRAISED 0x00000002
#define FC_DRAWPRESSD 0x00000004

// CFlatComboBox window
class CFlatComboBox : public CComboBox
{
 // Construction
 public:
  CFlatComboBox();
  // Attributes
 public:
  bool m_bLBtnDown;
  COLORREF m_clrHilite;
  COLORREF m_clrShadow;
  COLORREF m_clrDkShad;
  COLORREF m_clrButton;
  // Operations
 public:
  void DrawCombo(DWORD dwStyle, COLORREF clrTopLeft, COLORREF clrBottomRight);
  int Offset();
  // Overrides
  // ClassWizard generated virtual function overrides
  //{{AFX_VIRTUAL(CFlatComboBox)
  //}}AFX_VIRTUAL
  // Implementation
 public:
  virtual ~CFlatComboBox();
  // Generated message map functions
 protected:
  //{{AFX_MSG(CFlatComboBox)
   afx_msg void OnMouseMove(UINT nFlags, CPoint point);
   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
   afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
   afx_msg void OnTimer(UINT nIDEvent);
   afx_msg void OnPaint();
  //}}AFX_MSG
  DECLARE_MESSAGE_MAP()
};
#endif // !defined(FLATCOMBOBOX_H_INCLUDED)

///////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FlatComboBox.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

精彩图集

赞助商链接