Hi,
I have a C# application that uses a MFC regular Dll to use legacy code.
During one of the calls to the unmanaged code
I try to bring up a dialog box as follows.
CDescDlg dlg( sWaferName ) ;
if ( dlg.DoModal() != IDOK )
{
return ;
}
This dialog box consists of a text box and other controls. In the
dialog's InitDialog I set focus to the text box as follows:
BOOL CDescDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_sDesc = m_sNewDesc ;
GetDlgItem(IDC_EDIT_DESC)->SetFocus();
UpdateData( FALSE );
return TRUE; // return TRUE unless you set the focus to a
control
// EXCEPTION: OCX Property Pages should return
FALSE
}
Among the text box's properties , its Visible , TabStop, Border and
AutoHScroll are set to true.
Text is left aligned.
The problem is that the focus is not set. The user has to bring the
mouse pointer to the text box and click on it.
Any help will be appreciated.
Thanks
Aman Jain
===================================
This list is hosted by DevelopMentor� http://www.develop.com
Some .NET courses you may be interested in:
NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls
View archives and manage your subscription(s) at http://discuss.develop.com