combo box on the property page
hello,
I have crated one application which has 5 pages(wizard pages- property pages). On one of the pages(say 3rd ) i want to have a combo box and according to the items selection, i want a specific page to be a appear on the
3rd page. may be these pages are like embedded pages. not to sure.
How do I do that?
thanks.
[354 byte] By [
SoulVolt] at [2007-11-19 10:50:56]

# 1 Re: combo box on the property page
If you want to control visibility of the single control, use ShowWindow.
You can also create modeless dialog with set of control as a child of property page and toggle visibility as you need.
JohnCz at 2007-11-11 0:10:27 >

# 2 Re: combo box on the property page
Thanks but i don't get it. Can't u do it like this.
combobox page;
page.Addpage(page1);
page.Addpage(page2);
like we do for the property page and property sheet.
CProperty sheet;//property sheet
sheet.Addpage(Page1); //property page1
sheet.Addpage(page2); //property page2
sheet.DoModal();
# 3 Re: combo box on the property page
Thanks but i don't get it. Can't u do it like this.
combobox page;
page.Addpage(page1);
page.Addpage(page2);
Neither do I. I am not able to draw any conclusion from your previous post.
What is combobox?
Could you just assume that you have to explain in details what are you trying to do to a person that has no faintest idea about it?
Are you trying to show different set of controls depending on settings from other pages?
Are you trying to insert page into alredy created property sheet?
Are you trying to embed property sheet into an existing property sheet?
What is a role of the combo box? CComboBox does nor have AddPage member.
JohnCz at 2007-11-11 0:12:29 >

# 4 Re: combo box on the property page
i am trying to embed property page into the existing property sheets.
But like i said , i want to see different pages (on the same page) upon
combo box itme selection.
thanks.
# 5 Re: combo box on the property page
I see you do not want to see pages on pages but rather different dialogs on one page selected by combo box.
See attached sample, page 2. When you change combo box selection different dialog panes are showing.
Let me know if this is what you were looking for.
JohnCz at 2007-11-11 0:14:29 >

# 6 Re: combo box on the property page
Thank you JohnCz. this is wat i want.
one short question. my application doesn't have tabs but i should still
be able to do it. right? it's a simple like application like <back next> thing.
# 7 Re: combo box on the property page
From your post I was under impression that you use property sheet.
But that is irrelevant. You can embed any dialog (or any window for that matter) as child of any other window it does not have to be property page.
Remember: if you want to keep controls in a child dialog in tabbing order of the parent you must select control style for child dialog.
JohnCz at 2007-11-11 0:16:32 >

# 8 Re: combo box on the property page
void CExperience::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
m_array[m_Currentwin]->ShowWindow(SW_HIDE);
m_Currentwin= m_CComboBox.GetCurSel();
m_array[m_Currentwin]->ShowWindow(SW_SHOW);
}
The code above is for the combo box selection item pages.
I get a message box saying "CExperience MFC Application has encountered an error. Tell
Microsoft about this error" when using the above the code to show different pages(windows) on one of the pages
of my application(property page).
But when i get rid of the first line in the code with SW_HIDE , i don't get any message.
but i see weird behaviour. Page associated with item #1 appears. Page associated with item #2 appear but it stays still
on the screen even if you select the item#1 again in the combo box.
what could be the reason for that?
Thanks.
# 9 Re: combo box on the property page
1. Did you initialize m_Currentwin?
2. I do not know the reason. That problem does not exist in my sample. Did you set WS_CHILD style for your pane dialogs?
Only person with crystal ball would be ale to tell you what is wrong without debugging.
Post your project and we will see what is wrong.
JohnCz at 2007-11-11 0:18:32 >

# 10 Re: combo box on the property page
ok. i didn't initialize the m_Currentwin. it works now.
Thank you so much for your help JohnCz. i really appreciate it to the skylevel.
# 11 Re: combo box on the property page
You are very welcome.
JohnCz at 2007-11-11 0:20:38 >
