PDA

You are currently viewing a search engine-friendly (archive) version of this page.

View Full Version : problem working with PropertySheet..


anish
December 22, 2001, 01:53 am
I've designed the interface to my application in the following manner:
To the left of the application main window are 5 buttons, placed vertically (Button1,Button2 etc). Each button have an associated property sheet.On clicking each button ,it should open its corresponding property sheet within the right hand side of the application window.But the following code displays the property sheet in a new window.

// OnClickButton1 function
// a property sheet is created with two tabbed controls tab1 and tab2

PropertySheet prop1("Option1");
CTab1 Tab1; // CTab1 is derived from PropertyPage
CTab2 Tab2; // CTab2 is derived from PropertyPage
prop1.AddPage(&Tab1);
prop1.AddPage(&Tab2);
prop1.DoModal();

How can i modify the code in such a way that the property sheet opens within the right side of the main window rather than in a new window? ie,the main window should contain the property sheet or the property sheet should not have the titlebar..please help me..
anish

Tonker
December 22, 2001, 11:17 am
Hopefully someone else will peek in and know the answer, Anish. I've never even heard of PropertySheets... :eek: Maybe you could tell us a bit about them?

zcot
March 11, 2002, 03:31 am
I'm thinking about MDI's... You can do it with an MDI. I'd have no idea, or guess, how to "modify the code in such a way that ...etc.", but I just had some conceptual ideas I thought I could put up.

I'm lost in relation to where you're at, but I tend to work with VC++ doing 32-bit cheesers... I've not used PropertyPage issues either but I'm thinking that if you can get the Tab1 and Tab2 objects to get a child window handle of your main app window then you should be right there.

In your post you said it... "the main window should contain the property sheet ...". That's the idea, but also, the main window doesn't have-to necessarily "contain" the other objects per se(as far as code design), but your objects at least need to have the sort of access to "being a part of" the main window.

Main app window(or even right side window) has the MDI, and the Tab1 and 2 can be a child.

I'm just a novice really so I"m just throwin' stuff out... Here's another idea, although probably unothodox, unwieldy, and oh, -I don't know.... -moronic?... sometimes I don't care about that though. Here's what you do: Use your current situation and adjust the Tab1 and Tab2 display area window size to the exact window size of your main window display area and then play with the window properties of the main and sub windows to where that unwanted title bar and window frame is invisible. Guess there's some backwards calculating and round-the-block sort of stuff there and probably not a lot of extensibility for later, but if nothing else, it might be fun. Ahhh, I don't know... maybe you can just kill the DoModal() call and use a different one instead...

When I run into a dead end I usually start over and redesign... <img border="0" title="" alt="[Wink]" src="wink.gif" />