| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 999 人关注过本帖
标题:[求助]在OnSize里对sdi的分栏调整不能进行啊
只看楼主 加入收藏
赤冰
Rank: 1
等 级:新手上路
帖 子:397
专家分:0
注 册:2007-1-22
收藏
 问题点数:0 回复次数:2 
[求助]在OnSize里对sdi的分栏调整不能进行啊
为什么我在OnSize里对sdi的分栏调整不能进行啊?
搜索更多相关主题的帖子: sdi OnSize 调整 
2007-02-28 18:56
vbcs
Rank: 1
等 级:新手上路
帖 子:45
专家分:0
注 册:2006-7-24
收藏
得分:0 

给你一段正确的代码你参照看以下把!
/*****************拆分窗口***************************************/
BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{

//产生静态拆分窗口,横列为1纵行为2
m_wndSplitter1.CreateStatic(this,1,2);

m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CTextView),CSize(300,0),pContext);
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE,
m_wndSplitter1.IdFromRowCol(0,1));

//产生第二个拆分窗口的第一个窗口
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CBarView),CSize(0,150),pContext);
m_wndSplitter2.CreateView(1,0,pContext->m_pNewViewClass/*RUNTIME_CLASS(CBarView)*/,CSize(0,0),pContext);
//
SetActiveView((CView*)m_wndSplitter1.GetPane(0,0));
return TRUE;
}
***********************************************
还有MSDN上的着一段解释我感觉很清楚,有时间看一下把:
/*MSDN*/
A pane is usually an application-specific object derived from CView, but it can be any CWnd object that has the appropriate child window ID.

A CSplitterWnd object is usually embedded in a parent CFrameWnd or CMDIChildWnd object. Create a CSplitterWnd object using the following steps:

Embed a CSplitterWnd member variable in the parent frame.

Override the parent frame's CFrameWnd::OnCreateClient member function.

From within the overridden OnCreateClient, call the Create or CreateStatic member function of CSplitterWnd.

Call the Create member function to create a dynamic splitter window. A dynamic splitter window typically is used to create and scroll a number of individual panes, or views, of the same document. The framework automatically creates an initial pane for the splitter; then the framework creates, resizes, and disposes of additional panes as the user operates the splitter window's controls.

When you call Create, you specify a minimum row height and column width that determine when the panes are too small to be fully displayed. After you call Create, you can adjust these minimums by calling the SetColumnInfo and SetRowInfo member functions.

Also use the SetColumnInfo and SetRowInfo member functions to set an "ideal" width for a column and "ideal" height for a row. When the framework displays a splitter window, it first displays the parent frame, then the splitter window. The framework then lays out the panes in columns and rows according to their ideal dimensions, working from the upper-left to the lower-right corner of the splitter window's client area.

All panes in a dynamic splitter window must be of the same class. Familiar applications that support dynamic splitter windows include Microsoft Word and Microsoft Excel.

Use the CreateStatic member function to create a static splitter window. The user can change only the size of the panes in a static splitter window, not their number or order.

You must specifically create all the static splitter's panes when you create the static splitter. Make sure you create all the panes before the parent frame's OnCreateClient member function returns, or the framework will not display the window correctly.

The CreateStatic member function automatically initializes a static splitter with a minimum row height and column width of 0. After you call Create, adjust these minimums by calling the SetColumnInfo and SetRowInfo member functions. Also use SetColumnInfo and SetRowInfo after you call CreateStatic to indicate desired ideal pane dimensions.

The individual panes of a static splitter often belong to different classes. For examples of static splitter windows, see the graphics editor and the Windows File Manager.

A splitter window supports special scroll bars (apart from the scroll bars that panes may have). These scroll bars are children of the CSplitterWnd object and are shared with the panes.

You create these special scroll bars when you create the splitter window. For example, a CSplitterWnd that has one row, two columns, and the WS_VSCROLL style will display a vertical scroll bar that is shared by the two panes. When the user moves the scroll bar, WM_VSCROLL messages are sent to both panes. When the panes set the scroll-bar position, the shared scroll bar is set.

For further information on splitter windows, see:


/*END MSDN*/

2007-02-28 19:27
赤冰
Rank: 1
等 级:新手上路
帖 子:397
专家分:0
注 册:2007-1-22
收藏
得分:0 
分栏我会,我是让各个试图随窗口变化调整大小
2007-02-28 20:03
快速回复:[求助]在OnSize里对sdi的分栏调整不能进行啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015222 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved