gbzhhu
asked on
I can't display simple dialog on screen - HELP!!
All I want to do is display a simple dialog on screen and add a property page which handles tabs click messages using MFC in CV++ 6.
Here I am after the code as I had enough trying to figure out myself.
I did not realise VC++ was this hard, I mean I am a VB person and it is simply heaven to program it (But of course, you know the limitations)
Thank you all
Hassan
Here I am after the code as I had enough trying to figure out myself.
I did not realise VC++ was this hard, I mean I am a VB person and it is simply heaven to program it (But of course, you know the limitations)
Thank you all
Hassan
ASKER
Chensu
I have been to CodeGuru many times and they don't have code for VC++ 6 and I am having problems with VC++ 5 projects although I can now run them by recreating the project (very tedious). Also their examples are not for the beginner.
I have now changed my design and think of using tab control. i already have a dialog and a tab control on screen (looking good HURRAY!) However, the I can't put controls into the tabs as at design time I can only access tab1.
If you can help me with this I will increase the points to 50
Thanks
I have been to CodeGuru many times and they don't have code for VC++ 6 and I am having problems with VC++ 5 projects although I can now run them by recreating the project (very tedious). Also their examples are not for the beginner.
I have now changed my design and think of using tab control. i already have a dialog and a tab control on screen (looking good HURRAY!) However, the I can't put controls into the tabs as at design time I can only access tab1.
If you can help me with this I will increase the points to 50
Thanks
gbzhhu,
Here's a simple code snippet for getting CPropertySheet to work. Follow these steps and you are done.
a. Create two dialogs (say IDD_BRUSH_PAGE and IDD_CAPTION_PAGE). Add two classes for these dialogs CBrushPage and CCaptionPage, both derived from CPropertyPage.
b. Create a new class CLegendSheet inherited from CPropertySheet
c. Add a menu item to IDR_MAINFRAME, say IDR_VIEW_LEGEND.
d. Using Class Wizard add a message handler for this menu item.
void CMainFrame::OnViewLegend()
{
CLegendSheet ls ("Legend Settings");
CBrushPage BrushPage;
CCaptionPage CaptionPage;
ls.AddPage (&BrushPage);
ls.AddPage (&CaptionPage);
if (ls.DoModal() == IDOK)
{
// Your code here ....
}
Include the required header files in MainFrm.cpp.
Do let me know if this is okay.
Abhijit
Here's a simple code snippet for getting CPropertySheet to work. Follow these steps and you are done.
a. Create two dialogs (say IDD_BRUSH_PAGE and IDD_CAPTION_PAGE). Add two classes for these dialogs CBrushPage and CCaptionPage, both derived from CPropertyPage.
b. Create a new class CLegendSheet inherited from CPropertySheet
c. Add a menu item to IDR_MAINFRAME, say IDR_VIEW_LEGEND.
d. Using Class Wizard add a message handler for this menu item.
void CMainFrame::OnViewLegend()
{
CLegendSheet ls ("Legend Settings");
CBrushPage BrushPage;
CCaptionPage CaptionPage;
ls.AddPage (&BrushPage);
ls.AddPage (&CaptionPage);
if (ls.DoModal() == IDOK)
{
// Your code here ....
}
Include the required header files in MainFrm.cpp.
Do let me know if this is okay.
Abhijit
ASKER
I have already got a working property sheet and your answer came a little late. however, as I can't delete the question I will ask a replacement question.
Now that I have a modal property sheet displayed how do I add a button to the property sheet as it is not a resource and when I add it how do I add handlers to the button click
I will increase points to 50 if I get a working answer
Cheers
Now that I have a modal property sheet displayed how do I add a button to the property sheet as it is not a resource and when I add it how do I add handlers to the button click
I will increase points to 50 if I get a working answer
Cheers
ASKER
Managed to add a button as well so i will give points to abhitlya
Please put a dummy answer so I can give you the points
Please put a dummy answer so I can give you the points
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.codeguru.com/propertysheet/creating_cprop_appl.shtml
Update: Creating a full application using the CPropertySheet
http://www.codeguru.com/propertysheet/upd_creating_cprop_appl.shtml