Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modeless CPropertySheet behavior

Status
Not open for further replies.

base2

Programmer
Apr 18, 2002
7
US
I have created a Doc/View MFC application that Creates and displays a Modeless PropertySheet in response to a toolbar button from within the Document object. The sheet and pages are working correctly. However, when I click on the main view's title bar, the main view gets input focus but the main view window does not pop to the top of the 'Z'-order and overlay the region shared by the property sheet. That is, the Property sheet is still on top of part of the main view and obfuscates some of the controls. I do not have sufficient screen real-estate to contain both windows in sepearate regions of the desktop. I have tried every combination of flags I can think of in both the main frame window and the PropertySheet classes.

Q: Is this just how it is going to work or can I change some of the setting so that the main view will pop 'in front of' the porperty sheet when it receives focus? Is it a matter of writing an additional handler or just changing some settings? Any help will be appreciated.
 

A few things. First, your Doc class should not be taking care of toolbar messages. The Doc class should be used to store your data and save your data.

I don't understand why you want to have the Property sheet Modeless if your going to want it out of the way for the user to acces to Main window. Why not make it Modal?

Anyhow, if you create the CProperty Sheet in CMainFrm::OnInit() and added an OnFocus() event handler to CMainFrm you can call CPropertySheet->ShowWindow(FALSE) to hide the dialog. The tool bar command would call CPropertySheet->ShowWindow(TRUE). You would need to override OK and CANCEL in the CPropertySheets class and call this->ShowWindow(FALSE) so the dialog doesn't get destroyed. Basically your creating the dialog at startup then just showing and hiding it.

Brother C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top