|
-
April 8th, 1999, 11:59 PM
#1
How to Change DialogBox Title?
In my program i am invoking the same dialogbox for four different Items. So depending on the
item i want to change the Title . how can i do it?
-
April 9th, 1999, 12:18 AM
#2
Re: How to Change DialogBox Title?
Hi.
this->SetWindowText("Your Title");
Or we can omit this.
So, SetWindowText("Your Title");
Hope for help.
-Masaaki Onishi-
-
April 9th, 1999, 12:39 AM
#3
Re: How to Change DialogBox Title?
the dialogbox is invoked from Mainframe.
so i can't use this->.
void CMainFrame::OnChangeGroup()
{
CSetUpDlg tDlg;
tDlg.DoModal();
}
void CMainFrame::OnChangePhase()
{
CSetUpDlg tDlg;
tDlg.DoModal();
}
tDlg.SetWindowText() gives some assertion failure.
-
April 9th, 1999, 01:02 AM
#4
Re: How to Change DialogBox Title?
i got it.
i can do it on OnInitDialog() ;
thanks for your help.
Viju
-
April 20th, 1999, 05:18 AM
#5
Re: How to Change DialogBox Title?
In that case do the following procedure.
for example, CInvoker is a dialog invoking a InvokedDlg whose title is
supposed to be changed.
CInvoker::Test1()
{
CInvokedDlg InvokedDlg;
// key position before DoModal()
InvokedDlg.GetTitle("Title that I want to change");
if(InvokerDlg.DoModal() == IDOK)
{
...
}
}
-----------------
class CInvokedDlg : public CDialog
{
...
private:
CString m_pTitle;
...
}
CInvokedDlg::CInvokedDlg(Wnd* pParent.....) // constructer
{
// insert the following line.
m_pTitle = _T("");
}
void CInvokedDlg::GetTitle(CString szTitle)
{
m_pTitle = szTitle;
}
BOOL CAlertDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowText(m_pTitle); // insert to change the title
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
P.S.: 4 hours has passed to know this solution. ^)^
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
|