高分请教,一个VC的常见问题,up有分

anni 2002-07-24 06:25:06
在MFC中怎样做一个可编辑的工具条,象VC,WORD,EXPLEROR中的,
快快快,明早七点五十给分!!!
...全文
38 20 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
haode 2002-07-24
  • 打赏
  • 举报
回复
关注
cryingboy 2002-07-24
  • 打赏
  • 举报
回复
up@@@@@@@@@@
ciacia 2002-07-24
  • 打赏
  • 举报
回复
up~~~~~~~~~~~~~~~~~~
howtotell 2002-07-24
  • 打赏
  • 举报
回复
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
////////////////////////////////////////////////////////////////////
CImageList img;
if(!img.Create(IDB_MAINFRAME,20,10,RGB(255,0,0)))
{
TRACE0("Failed to load hot images\n");
return -1;
}
m_wndToolBar.GetToolBarCtrl().SetHotImageList(&img);
img.Detach();


m_wndToolBar.ModifyStyle(0,TBSTYLE_FLAT);




if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}


for(int i = 0; i < m_wndToolBar.GetCount(); i++)
{
UINT id = m_wndToolBar.GetItemID(i);
CString s;
if(!s.LoadString(id)) continue;
int j = s.Find(_T('\n'));
if(j < 0) continue;
s = s.Right(s.GetLength() - j - 1);
m_wndToolBar.SetButtonText(i,s);
}// Adjust sizes to include text
CRect rect;
m_wndToolBar.GetItemRect(0,&rect);
m_wndToolBar.SetSizes(rect.Size(),CSize(20,20));


// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);

EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);

//启动时的动画效果
AnimateWindow(GetSafeHwnd(),1000,AW_CENTER);



return 0;
}
我不是大明 2002-07-24
  • 打赏
  • 举报
回复
还是去找别人做好的例子看吧!不一定是MS的东西才有这种功能的,很多小程序也有的!
mowcn 2002-07-24
  • 打赏
  • 举报
回复
up
feahoo 2002-07-24
  • 打赏
  • 举报
回复
up
dxr7712 2002-07-24
  • 打赏
  • 举报
回复
up
jason_sun22 2002-07-24
  • 打赏
  • 举报
回复
网上这种例子很多!去下一个吧!!!
zxjmm 2002-07-24
  • 打赏
  • 举报
回复
先加一个按钮,找到按钮位置,再此位置creat编辑框
cdimp 2002-07-24
  • 打赏
  • 举报
回复
up
dy_paradise 2002-07-24
  • 打赏
  • 举报
回复
codeproject上有源码,你去搜索一下吧
explorer007 2002-07-24
  • 打赏
  • 举报
回复
MSDN Search ->DialogBar
zz321 2002-07-24
  • 打赏
  • 举报
回复
msdn中有一个例子,有关公用控件的。就是基于DIALOG上有很多工具按钮的那个。似乎是一个默认的属性打开就可以了。
zhang_zhibin 2002-07-24
  • 打赏
  • 举报
回复
up
doublesword 2002-07-24
  • 打赏
  • 举报
回复
up
FFXI 2002-07-24
  • 打赏
  • 举报
回复
Up
Wargod2002 2002-07-24
  • 打赏
  • 举报
回复
CToolBarCtrl::Customize
void Customize( );

Remarks

Call this function to display the Customize Toolbar dialog box. This dialog box allows the user to customize the toolbar by adding and deleting buttons.

To support customization, your toolbar’s parent window must handle the customization notification messages as described in CToolBarCtrl: Handling Customization Notifications. Your toolbar must also have been created with the CCS_ADJUSTABLE style, as described in CToolBarCtrl::Create.

直接调用还是不行的,还要处理一些消息如tbn_beginadjust之类的,具体看
下msdn
punpuny 2002-07-24
  • 打赏
  • 举报
回复
自己实现,其实就是重画整个工具条而已。
lbl20020123 2002-07-24
  • 打赏
  • 举报
回复
up

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧