BottomEditView.cpp
资源名称:vc_demo.rar [点击查看]
上传用户:zcy791212
上传日期:2013-03-06
资源大小:196k
文件大小:2k
源码类别:
Modem编程
开发平台:
Visual C++
- // BottomEditView.cpp : implementation file
- //
- #include "stdafx.h"
- #include "vc_demo.h"
- #include "BottomEditView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CBottomEditView
- IMPLEMENT_DYNCREATE(CBottomEditView, CEditView)
- CBottomEditView::CBottomEditView()
- : m_brush(RGB(0x02,0x93,0xFD))
- {
- }
- CBottomEditView::~CBottomEditView()
- {
- }
- BEGIN_MESSAGE_MAP(CBottomEditView, CEditView)
- //{{AFX_MSG_MAP(CBottomEditView)
- ON_WM_CTLCOLOR_REFLECT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CBottomEditView diagnostics
- #ifdef _DEBUG
- void CBottomEditView::AssertValid() const
- {
- CEditView::AssertValid();
- }
- void CBottomEditView::Dump(CDumpContext& dc) const
- {
- CEditView::Dump(dc);
- }
- #endif //_DEBUG
- HBRUSH CBottomEditView::CtlColor(CDC* pDC, UINT nCtlColor)
- {
- // TODO: Change any attributes of the DC here
- //i don't know why all nCtlColor is 1(CTLCOLOR_STATIC),
- //so in order to change bkcolr of bottomview editctrl
- //to green ,i can only set all color
- //if (CTLCOLOR_EDIT==nCtlColor)
- {
- pDC->SetBkColor(RGB(0x02,0x93,0xFD));
- pDC->SetTextColor(RGB(0xFF,0xFF,0xFF));
- return m_brush;
- }
- // TODO: Return a non-NULL brush if the parent's handler should not be called
- return NULL;
- }
- BOOL CBottomEditView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Add your specialized code here and/or call the base class
- cs.style = cs.style
- | ES_READONLY
- | ES_MULTILINE
- | ES_WANTRETURN
- | WS_VSCROLL
- | WS_HSCROLL;
- return CEditView::PreCreateWindow(cs);
- }