大侠快来帮忙!是这样的。
我的界面要在很多formview视图间切换,这个功能已经实现了。
现在的问题是其中一个formview视图要使用propertysheet和propertypage
对话框。
那么如何把这些对话框都嵌入在formview视图中呢?我用笨办法,DoModal(),视图叠在一起,界面很难看,要哭。
如果能把它们嵌在formview里,就好象formview中的控件那样就好了。提醒:我切换到别的formview后,再切换回这个formview界面必须也是这种
嵌入的样式。大家教教小弟吧,编译通过马上给分!
我的界面要在很多formview视图间切换,这个功能已经实现了。
现在的问题是其中一个formview视图要使用propertysheet和propertypage
对话框。
那么如何把这些对话框都嵌入在formview视图中呢?我用笨办法,DoModal(),视图叠在一起,界面很难看,要哭。
如果能把它们嵌在formview里,就好象formview中的控件那样就好了。提醒:我切换到别的formview后,再切换回这个formview界面必须也是这种
嵌入的样式。大家教教小弟吧,编译通过马上给分!
解决方案 »
- 谁给个在线的MSDN网址
- vcleaner(我没做大哥已经很久了.......) 在吗?
- 用过 Xtreme Toolkit 中 CXTPDockingPane停靠栏的,停靠栏上的文字怎么是躺的呢?请赐教
- 为什么在成员变量中看不到加入的RadioButton的Control IDs???
- 如何在单文档的窗口中显示控件?
- 请问gethostbyaddr如何使用?
- 保存多条直线 vector
- 请教下关于字体设置的问题
- 请教一个VC中包含DLL的workspace中 Link的设定问题!
- CPropertySheet的问题
- 如何在DIALOG里面添加快捷键?
- 关于ActiveX 控件属性(如何实现象filename这样的属性),100分奉送
class CSnapView : public CFormView
{
protected:
CSnapView();
DECLARE_DYNCREATE(CSnapView)public:
//{{AFX_DATA(CSnapView)
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
public:
CSnapDoc* GetDocument();
public: //{{AFX_VIRTUAL(CSnapView)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
virtual void OnInitialUpdate();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public:
virtual ~CSnapView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifprotected:
// 跟踪父窗口的大小是否适合
BOOL m_bSizedBefore; CPropertySheet* m_pPropSheet; // 在FORMVIEW中使用的三个属性页
// 使用OnInitDialog
CPropertyPage* m_pPageBkfst;
CPropertyPage* m_pPageLunch;
CPropertyPage* m_pPageDinner; afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnDraw(CDC* pDC);// 普通的映射函数
protected:
//{{AFX_MSG(CSnapView)
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};BOOL CSnapView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
ASSERT(pParentWnd != NULL);
ASSERT_KINDOF(CFrameWnd, pParentWnd); if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_CLIPCHILDREN,
rect, pParentWnd, nID, pContext))
{
return FALSE;
} m_pPageBkfst = new CBkfstPage;
m_pPageLunch = new CLunchPage;
m_pPageDinner = new CDinnerPage; m_pPropSheet = new CSnapPropertySheet;
m_pPropSheet->AddPage(m_pPageBkfst);
m_pPropSheet->AddPage(m_pPageLunch);
m_pPropSheet->AddPage(m_pPageDinner); if (!m_pPropSheet->Create(this,
DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE))
{
DestroyWindow();
return FALSE;
} m_pPropSheet->SetWindowPos(NULL, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE); m_pPropSheet->ModifyStyle(WS_BORDER|WS_CAPTION,
dwStyle & (WS_BORDER|WS_CAPTION)); CFrameWnd* pParentFrame = GetParentFrame();
CRect rectSize;
m_pPropSheet->GetWindowRect(rectSize);
pParentFrame->CalcWindowRect(rectSize);
OnSize(SIZE_RESTORED, rectSize.Width(), rectSize.Height()); return TRUE;
}
{
...
m_dlgYourdlg.create(...
m_dlgYourdlg.ShowWindow(SW_SHOW);
...
qrlvls的方法简单,但在切换时就不管用了。
感谢大家。