社区
界面
帖子详情
怎样改变工具栏的背景色?
newHung
2006-08-17 10:51:31
怎样改变工具栏的背景色?请各位大侠指点.多谢!
...全文
797
5
打赏
收藏
怎样改变工具栏的背景色?
怎样改变工具栏的背景色?请各位大侠指点.多谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
cleverwyq
2006-08-17
打赏
举报
回复
第一个是头文件,第二个是实现
关键是继承CToolBar,重载OnEraseBkGnd函数
然后把cmainframe里面的Ctoolbar成员类型改成你的新类
cleverwyq
2006-08-17
打赏
举报
回复
// ToolBarEx.cpp : implementation file
//
#include "stdafx.h"
#include "FormV.h"
#include "ToolBarEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CToolBarEx
CToolBarEx::CToolBarEx()
{
}
CToolBarEx::~CToolBarEx()
{
}
BEGIN_MESSAGE_MAP(CToolBarEx, CToolBar)
//{{AFX_MSG_MAP(CToolBarEx)
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CToolBarEx message handlers
BOOL CToolBarEx::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBrush brush(RGB(0,255,0));
CRect r;
GetClientRect(&r);
pDC->FillRect(&r,&brush);
return TRUE;
}
cleverwyq
2006-08-17
打赏
举报
回复
#if !defined(AFX_TOOLBAREX_H__2FAF4DF2_DD0C_4D08_BC3B_81577D01407F__INCLUDED_)
#define AFX_TOOLBAREX_H__2FAF4DF2_DD0C_4D08_BC3B_81577D01407F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ToolBarEx.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CToolBarEx window
class CToolBarEx : public CToolBar
{
// Construction
public:
CToolBarEx();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CToolBarEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CToolBarEx();
// Generated message map functions
protected:
//{{AFX_MSG(CToolBarEx)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TOOLBAREX_H__2FAF4DF2_DD0C_4D08_BC3B_81577D01407F__INCLUDED_)
Featured
2006-08-17
打赏
举报
回复
重载,修改OnEraseBkGnd或者OnPaint、DrawItem之类的函数
VC里面都这样做
newHung
2006-08-17
打赏
举报
回复
谢谢,谢谢
MFC重绘标题栏、菜单栏并更改状态栏
背景色
MFC重绘标题栏、菜单栏并更改状态栏
背景色
。
工具栏
背景色
未修改成功!
vs2010 CMFCToolBar
工具栏
修改背景颜色
vs2010 CMFCToolBar
工具栏
如何修改背景颜色
ToolBarBg(设置vb
工具栏
背景)
vb
工具栏
是不能设置背景的,但该代码演示了如何设置工具条的背景,同时背景图片可以自定义。
MFC对话框如何使用
工具栏
并修改
工具栏
的背景颜色与自绘对话框统一
配套博客:http://blog.csdn.net/panshiqu/article/details/10499805 看上面的那篇文章决定要不要下载
Jquery全文浮动
工具栏
Jquery全文浮动
工具栏
只要定义好容易就可以实现全文内容的 下载 打印 页面关键词高亮
背景色
变换等功能。
界面
15,980
社区成员
115,900
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章