MFC 单文档拆分窗口问题

zheng8963 2012-03-01 04:47:45
做一个mfc 单文档的书签功能,拆分窗口,左边为书签(程序刚运行书签视图不存在,只有打开后才出现),右边是文本,按下工具栏上的按钮,书签消失;

现在问题是 这个拆分窗口要在哪里拆??
...全文
150 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zheng8963 2012-03-03
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 heksn 的回复:]
引用 4 楼 zheng8963 的回复:

引用 1 楼 jixiang1983 的回复:
CMainFrame类中加分隔条:
CSplitterWnd m_wndSplitter;
CMainFrame类中添加虚函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
……
[/Quote]
设置SetColumnInfo 大小,那个分割条还在1该怎么办??不想这个条存在的
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 zheng8963 的回复:]

引用 1 楼 jixiang1983 的回复:
CMainFrame类中加分隔条:
CSplitterWnd m_wndSplitter;
CMainFrame类中添加虚函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your speci……
[/Quote]
通过SetColumnInfo 设置大小
zheng8963 2012-03-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 jixiang1983 的回复:]
CMainFrame类中加分隔条:
CSplitterWnd m_wndSplitter;
CMainFrame类中添加虚函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or c……
[/Quote]

你这样创建 一开始fiel open 文档未打开就已经有分割了;在file/open打开文档才出现分割该怎么做
jixiang1983 2012-03-01
  • 打赏
  • 举报
回复
可以直接这样写,当然得注意相应的包含文件
yuanquanli12345 2012-03-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 jixiang1983 的回复:]
CMainFrame类中加分隔条:
CSplitterWnd m_wndSplitter;
CMainFrame类中添加虚函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or c……
[/Quote]
请问:直接按您的方式写吗?
还需要其他设置吗?
学习中。
jixiang1983 2012-03-01
  • 打赏
  • 举报
回复
CMainFrame类中加分隔条:
CSplitterWnd m_wndSplitter;
CMainFrame类中添加虚函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE;
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftTreeView), CSize(100, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CSDIRight0301View), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}

return TRUE;
//return CFrameWnd::OnCreateClient(lpcs, pContext);
}
添加左右两个窗口对应的视类,如:CLeftTreeView、CSDIRight0301View

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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