我想在状态栏上预览画笔和画刷的状态,可以在状态栏上画图吗?
解决方案 »
- 利用ADO连接数据时,连接失败,大家看看是怎么回事啊
- CPropertyPage 加属性页,所加载的能是同一个页面吗
- User breakpoint called from code at ox7c921230
- 鼠标按下移动怎么响应?
- 如何创建一个FTP目录
- 进程间通讯问题,内存共享的实现
- 急啊!请问怎样在已做的一个应用程序中插入透明背景位图啊!谢谢!
- 请问:lpDllEntryPoint = GetProcAddress(hLib,_T("DllRegisterServer"));中_T是什么意思?
- 关于RICHEDIT里CARET问题
- 想实现效果为 任何程序 调用 C++ 写的 DLL ,然后就可以免注册调用指定的 COM 插件
- 急?请问如何用WinInet送POST命令上传图片,将相应的数据提交服务器,并读取返回结果?
- 对windows编程,如何控制鼠标箭头阿
// MyStatusBar.h: interface for the CMyStatusBar class.
//
//////////////////////////////////////////////////////////////////////#if !defined(AFX_MYSTATUSBAR_H__E77E4765_F456_4A0F_A6AB_82B3652561B5__INCLUDED_)
#define AFX_MYSTATUSBAR_H__E77E4765_F456_4A0F_A6AB_82B3652561B5__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000class CMyStatusBar : public CStatusBar
{
public: CMyStatusBar();
virtual ~CMyStatusBar();protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};#endif // !defined(AFX_MYSTATUSBAR_H__E77E4765_F456_4A0F_A6AB_82B3652561B5__INCLUDED_)
//MyStatusBar.cpp
// MyStatusBar.cpp: implementation of the CMyStatusBar class.
//
//////////////////////////////////////////////////////////////////////#include "stdafx.h"
#include "Statusbar.h"
#include "MyStatusBar.h"#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endifstatic UINT id[] =
{
ID_SEPARATOR,
ID_SEPARATOR
};//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////BEGIN_MESSAGE_MAP(CMyStatusBar, CStatusBar)
ON_WM_CREATE()
ON_WM_PAINT()
END_MESSAGE_MAP()CMyStatusBar::CMyStatusBar()
{}CMyStatusBar::~CMyStatusBar()
{}int CMyStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
SetIndicators(id, 2); return 0;
}void CMyStatusBar::OnPaint()
{
CStatusBar::OnPaint(); CBrush brush(RGB(0, 123, 220));
CDC *pDC = GetDC();
RECT rc;
GetItemRect(1, &rc);
pDC->FillRect(&rc, &brush);
ReleaseDC(pDC);
}我派生了个CStatusBar类CMyStatusBar然后在它的OnPaint()中的第二个面板中画出一个与其相同的矩形,楼主如果想画什么的话在onpaint()中加代码就可以了,这是我能想到的方法,大家还有什么好方法交流一下。
qq:13589137 验证:CSDN (注意不是该字串一律不加)