locked
top right corner button RRS feed

  • Question

  •  

    If I code to open a dialog,

    Cdialog dlg;

    dlg.DoModal();

     

    this dialog 's top right corner button is "OK",

    I want it is "X",

     

    user can minimize it but not close it.

     

    How to do ?

     

    Thank you very much.

    Thursday, December 6, 2007 3:56 AM

Answers

  • Hi,

     

    I think John's suggestion was written with the .Net Compact Framework (System.Windows.Forms) APIs in mind.

     

    Within a MFC application try placing a call to SHDoneButton within your OnInitDialog method. This should allow you to toggle between the user of (OK) and (X) icons.

     

    See the following forum thread for further details - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2260252&SiteID=1

     

    Hope this helps,

    Christopher Fairbairn

     

     

    Monday, December 10, 2007 2:14 AM

All replies

  •  

    Code Block

    Cdialog dlg;

    dlg.ShowDialog(); // Gives 'Ok' Button

     

    //

     

    Cdialog dlg;

    dlg.Show(); // Gives 'X' Button

     

     

     

     

     

    Friday, December 7, 2007 11:42 AM
  • I code that, but could not pass build

     

    CMobilePhoneSuiteDlg dlg;

     m_pMainWnd = &dlg;

    dlg.Show();

     

    CMobilePhoneSuiteDlg  is a dialog clase from cdialog

     

    class CMobilePhoneSuiteDlg : public CDialog

     

    the system tell that

    error C2039: 'Show' : is not a member of 'CMobilePhoneSuiteDlg' d:\\MobilePhoneSuite\MobilePhoneSuite\MobilePhoneSuite.cpp 59 

     

    Saturday, December 8, 2007 10:03 AM
  • Hi,

     

    I think John's suggestion was written with the .Net Compact Framework (System.Windows.Forms) APIs in mind.

     

    Within a MFC application try placing a call to SHDoneButton within your OnInitDialog method. This should allow you to toggle between the user of (OK) and (X) icons.

     

    See the following forum thread for further details - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2260252&SiteID=1

     

    Hope this helps,

    Christopher Fairbairn

     

     

    Monday, December 10, 2007 2:14 AM