|
-
June 18th, 1999, 04:57 PM
#1
File Dialog - Why can I change caption on "Open" button but not "Save" button?
I created a subclass of CFileDialog that takes a dialog caption and a caption for the "Open" or "Save" button in addition to the usual parameters to the constructor. This works fine for an open file dialog, but when I use it with a save file dialog, the caption on the "Save" button does not change. Why? The code is as follows:
CMyFileDialog::CMyFileDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt,
LPCTSTR lpszFileName, DWORD dwFlags,
LPCTSTR lpszFilter, CWnd* pParentWnd,
const char* strTitle, const char* strBtnCaption
) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter,
pParentWnd
)
{
m_csTitle = strTitle;
m_ofn.lpstrTitle = m_csTitle;
m_csBtnCaption = strBtnCaption;
}
BOOL CMyFileDialog::OnInitDialog()
{
CFileDialog::OnInitDialog();
GetParent()->SetDlgItemText(IDOK, m_csBtnCaption);
return TRUE;
}
-
June 18th, 1999, 05:40 PM
#2
Re: File Dialog - Why can I change caption on "Open" button but not "Save" button?
Hmm... it should work the same for Save As and for Open, but you could also use the undocumented function SetControlText()... to see how it can be used, check out Example 11 on my web site at
http://home.earthlink.net/~railro/mfc_link.html
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|