15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Is it possible to have a CPropertySheet in a CFormView?

Cash GEDNY -- ccoyne@equityny.ml.com
Friday, March 21, 1997

Environment: NT 3.51 Visual C++ 4.0

I'm trying to have a CFormView with various controls AND a CPropertySheet. 
 Can anyone give me some suggestions or point me to some sample code that 
would show me how to do this?

TIA,

C Coyne
ccoyne@gedny.ml.com






Joe Vannucci -- vannuccj@ix.netcom.com
Monday, March 24, 1997

[Mini-digest: 3 responses]

Wrox Press, Visual C++ 4 Master Class covers this.  In short, this is
what they say:
Override CFormView::OnCreate() to create the property sheet, adjust the
view's dimensions accordingly, then override
CFormView::OnInitialUpdate() to resize the main frame to fit the
property sheet.

//The property sheet creation looks like this:

// Add all pages before creating
m_pSheet->AddPage(...);

if (! m_pSheet->Create(this, WS_CHILD | WS_VISIBLE, 0))
	// error


Then inside OnInitialUpdate():
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);
ResizeParentToFit(TRUE);
}

The book also notes that you can of course create multiple property
sheets in the formview, just do this stuff again and resize accordingly.

I just knew where to find this, I haven't compiled this code.
Hope this helps!
-joe vannucci
vannuccj@ix.netcom.com

> 
> Environment: NT 3.51 Visual C++ 4.0
> 
> I'm trying to have a CFormView with various controls AND a CPropertySheet.
>  Can anyone give me some suggestions or point me to some sample code that
> would show me how to do this?
> 
> TIA,
> 
> C Coyne
> ccoyne@gedny.ml.com
-----From: "Christian Studer" 

Pass a pointer to the parent window (the form view) to the property sheet's
constructor. Use Create instead of DoModal to display the prop sheet. Like
this:
if (!m_pPropSheet->Create(this, WS_CHILD | WS_VISIBLE, 0))
{
	delete m_pPropSheet;
	m_pPropSheet = NULL;
}
this refers to a CFormView-derived object.
You can change the size, the position of the property sheet with
MoveWindow.

Hope this helps,
Christian
Visit http://www.access.ch/beautiful_star

>I'm trying to have a CFormView with various controls AND a
>CPropertySheet. 
>Can anyone give me some suggestions or point me to some sample code >that
would show me how to do this?

-----From: "Cunningham Graham, GD-IT347" 

What you need to do is to implement a modeless propertysheet and place
this on the formview. There is quite a lot of docs on this so search for
"modeless property" and that should get you going.

//--------------------------------------------------------------------
Email : Graham.Cunningham@contractor.net
//--------------------------------------------------------------------


>----------
>Von: 	Coyne, Cash ( GEDNY)[SMTP:ccoyne@equityny.ml.com]
>Gesendet: 	Freitag, 21. M=E4rz 1997 22:49
>An: 	'mfc-l@netcom.com'
>Betreff: 	Is it possible to have a CPropertySheet in a CFormView?
>
>Environment: NT 3.51 Visual C++ 4.0
>
>I'm trying to have a CFormView with various controls AND a =
CPropertySheet.=20
> Can anyone give me some suggestions or point me to some sample code =
that=20
>would show me how to do this?
>
>TIA,
>
>C Coyne
>ccoyne@gedny.ml.com
>
>
>
>




Become an MFC-L member | Вернуться в корень Архива |