How Add dialog and show it?
-
Hi Experts. I'm new in Mfc. In c# I cloud easily add new form to my application and show it. At first step in Mfc I need to add some dialog to my application and then from some menu or button command display it. But I mixed to how do it? Thanks for your kinds.
sepel
-
Hi Experts. I'm new in Mfc. In c# I cloud easily add new form to my application and show it. At first step in Mfc I need to add some dialog to my application and then from some menu or button command display it. But I mixed to how do it? Thanks for your kinds.
sepel
From 'View' Menu Choose to see Resource 'View Panel' in your IDE In the Resource View Panel Expand Items and right click the Dialog Branch and Choose 'Add Resource' and press New Button of add Resource Dialog. After your dialog has created you can see it in Resource Designer when ever you want by Double Clicking on it in Resource View Panel. After You do all these Right Click on your Dialog in Resource Designed and choose 'Add Class' fill the class field with a name (e.g. "CTemp1Dlg")and before Finishing the wizard attention the names of .Cpp File and .h file which is created for you through wizard (here : Temp1Dlg.h and Temp1Dlg.cpp) now include the Temp1Dlg.h File created in previous step in your Code which you want to Modal your Dialog. in the method you want to Modal your Dialog write the below code:
CTemp1Dlg dlgMyDialog(this);
dlgMyDialog.DoModal(); -
From 'View' Menu Choose to see Resource 'View Panel' in your IDE In the Resource View Panel Expand Items and right click the Dialog Branch and Choose 'Add Resource' and press New Button of add Resource Dialog. After your dialog has created you can see it in Resource Designer when ever you want by Double Clicking on it in Resource View Panel. After You do all these Right Click on your Dialog in Resource Designed and choose 'Add Class' fill the class field with a name (e.g. "CTemp1Dlg")and before Finishing the wizard attention the names of .Cpp File and .h file which is created for you through wizard (here : Temp1Dlg.h and Temp1Dlg.cpp) now include the Temp1Dlg.h File created in previous step in your Code which you want to Modal your Dialog. in the method you want to Modal your Dialog write the below code:
CTemp1Dlg dlgMyDialog(this);
dlgMyDialog.DoModal(); -
It works !. Thanks Amir. Dear Amir,I have some expert in C# and now I migrate to mfc for some interesting and some works !. Can I ask you guide me to some books or another resource to help me learn mfc better( and quick)? Best Regards
sepel
Ok Please Don't hesitate to ask any question ,But I could not promise if I could answer them all. Here is a list of update books you may like to use, How ever mostl of MFC guide books found in the net are old ones but they could be useful too because the bases are the same: http://msdn.microsoft.com/en-us/visualc/dd721903.aspx[^] By the way for those who are new to MFC, How Do I? Video Series[^] would be interesting.
-
Ok Please Don't hesitate to ask any question ,But I could not promise if I could answer them all. Here is a list of update books you may like to use, How ever mostl of MFC guide books found in the net are old ones but they could be useful too because the bases are the same: http://msdn.microsoft.com/en-us/visualc/dd721903.aspx[^] By the way for those who are new to MFC, How Do I? Video Series[^] would be interesting.