WEB开发网
开发学院软件开发VC 在类VC的界面实现中加入目录树 阅读

在类VC的界面实现中加入目录树

 2008-01-19 20:24:50 来源:WEB开发网   
核心提示://---2.停靠控制---m_LeftCtrBar.SetBarStyle(m_LeftCtrBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);m_BottomCtrBar.SetBarStyle(m_BottomCtrBar.Ge
//-------------------2.停靠控制-----------------------------------
m_LeftCtrBar.SetBarStyle(m_LeftCtrBar.GetBarStyle() | CBRS_TOOLTIPS
             | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_BottomCtrBar.SetBarStyle(m_BottomCtrBar.GetBarStyle() | CBRS_TOOLTIPS
             | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_LeftCtrBar.EnableDocking(CBRS_ALIGN_ANY);
m_BottomCtrBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
DockControlBar(&m_LeftCtrBar, AFX_IDW_DOCKBAR_LEFT);   //停靠在左边
DockControlBar(&m_BottomCtrBar, AFX_IDW_DOCKBAR_BOTTOM); //停靠在底部   

运行一下,看一下效果图如何。

2.4、添加控件:

这个问题看似有些麻烦其实相当简单:我们只要在创建这些控件时将控制条窗口指针作为父窗口指针赋值给这些控件即可!请看如下例子(需要注意的是以下列举的几种形式,你只能选择其一,同时往一个控制条窗口添加多个子窗口将导致失败!)(作者原话)

2.4.1 添加最下面的Edit控件

在CMainFrame类中添加成员变量:

CEdit m_BottomEdit; //加在最下面的控制栏中的Edit

在创建ControlBar后创建编辑控件:  

//------------3.m_BottomEdi上的EditBox, 一定要加在创建ControlBar之后--------------------
m_BottomEdit.Create(WS_VSCROLL | WS_CHILD | WS_VISIBLE | ES_AUTOVSCROLL
  | ES_MULTILINE | ES_WANTRETURN,  //指定编辑控件的风格,
  CRect(0,0,0,0),   //Specifies the edit control''s size and position
  &m_BottomCtrBar, //Specifies the edit control''s parent window, it must not be null.
  101);       //Specifies the edit control''s ID
m_BottomEdit.ModifyStyleEx(0, WS_EX_CLIENTEDGE);   

再运行,瞧一下!

上一页  1 2 3 4  下一页

Tags:VC 界面 实现

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接