Couple question about Dialog in MFC
-
Hi all, Got a couple of easy question for the experts. :) My first question is how do i remove the "x" box to close a modal dialog? My second question is i want to know when using CFileDialog, is there a way to have the default file name to be incremented or have a number added to the end of it if it already exists? If someone could show me how to do this, i would really appreciate it. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
-
Hi all, Got a couple of easy question for the experts. :) My first question is how do i remove the "x" box to close a modal dialog? My second question is i want to know when using CFileDialog, is there a way to have the default file name to be incremented or have a number added to the end of it if it already exists? If someone could show me how to do this, i would really appreciate it. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
You can uncheck the System Menu option to remove the Maximize, Minimize, and close buttons. But if you want to have Max/Min buttons, then what you can probably do is to grey out the close button. For that you, just add this to the end of your InitDialog( ) VERIFY( pSysMenu->DeleteMenu( SC_CLOSE, MF_BYCOMMAND ) ); CFileDialog doesn't have any options like that. You will have implement it in your own way. "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."