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!

Insert a new view

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a programme that is conected to a database and have two tables. I have two dialog forms and i want to switch one form for another but i don´t know how!!
I use a function called onDestroy(); and another called OnPaint(); This two function destroy the active form and paint, but i must know the function to put the other form active.
I need urgent feedback!!
Thank you!
 
Try to derive Your Dialogs from CPropertyPage MF Class (easy replace CDialog in *.h and *.cpp - files with CPropertyPage). For example, Your changed classes are CFirstDlg and CSecondDlg. Do the next:

CPropertySheet psheet("Database View"); //Database view is a sample name
psheet.m_psh.dwFlags |= PSH_NOAPPLYNOW; //To hide Apply - button
CFirstDlg first; //You can use another constructor to know psheet in Your dialog
CSecondDlg second;
psheet.AddPage(&first);
psheet.AddPage(&second);
psheet.DoModal( );

On this way You can easy activate one Page with a mouse. If You wish to show only one Property Page, hide the second with ShowWindow() - function. If You wish to activate one of Property pages progammatically, use function SetActivePage().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top