![](sad.gif)
MFC Questions - bitmaps, file dialog
First off,
How do you replace the boring grey background of an MFC dialog with a bitmap? I tried to use the bitmap control on the VC++ toolbar and fiddled with the transparent flag but it ends up covering the controls until you click on them
Secondly,
How do I add a File Open dialog to my Dialog based app so I can load/save files?
![](sad.gif)
Downloads: ZeroOne Realm
Here''s what I think -
--------------
For the 1st Q
--------------
Firstly,this way is seem that something trouble![](wink.gif)
You can hierarchy a new dialog class with your specific features from the base class CDialog in MFC,in the initialize-related member function of the new class,you just draw the blackground bitmap,and the other common stuff let the base class do for you...
Also,as the other choice,you can create an ActiveX control for this.
--------------
For the 2nd Q
--------------
This Q is actually so simple,just use the CFileDialog class in MFC directly! For more details on it,please see the related title in MSDN,the following is a short section from it -
The CFileDialog class encapsulates the Windows common file dialog box. Common file dialog boxes provide an easy way to implement File Open and File Save As dialog boxes (as well as other file-selection dialog boxes) in a manner consistent with Windows standards
=========================
Hope this helped!
--------------
For the 1st Q
--------------
Firstly,this way is seem that something trouble
![](wink.gif)
You can hierarchy a new dialog class with your specific features from the base class CDialog in MFC,in the initialize-related member function of the new class,you just draw the blackground bitmap,and the other common stuff let the base class do for you...
Also,as the other choice,you can create an ActiveX control for this.
--------------
For the 2nd Q
--------------
This Q is actually so simple,just use the CFileDialog class in MFC directly! For more details on it,please see the related title in MSDN,the following is a short section from it -
The CFileDialog class encapsulates the Windows common file dialog box. Common file dialog boxes provide an easy way to implement File Open and File Save As dialog boxes (as well as other file-selection dialog boxes) in a manner consistent with Windows standards
=========================
Hope this helped!
![](smile.gif)
============================= Hey,I just wanna know WHY! =============================
There''s a code-base on CodeGuru for a bitmap dialog or CWnd (custom background). Check out www.codeguru.com (not as cool a site as it used to be since being swallowed by corporate publishers, but still useful).
zhang_zhou''s right: CFileDialog will do 99% of what developers want with load/save/create dialogs. Lots of nifty flags & switches. If you need specific help with writing the actual menu handler & such, just ask.
zhang_zhou''s right: CFileDialog will do 99% of what developers want with load/save/create dialogs. Lots of nifty flags & switches. If you need specific help with writing the actual menu handler & such, just ask.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement