VC++6.0 Problem with SetFocus()

H

hex

I put function OnInitDialog in child dialog wich made by class CSecond:

BOOL CSecond::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
m_ed.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}


But focus doesn't set. :(

Source located at http://hex.org.ua/SetFocus.zip
 
V

Victor Bazarov

hex said:
I put function OnInitDialog in child dialog wich made by class
CSecond:

BOOL CSecond::OnInitDialog()
{ [..]

Your question is about Windows programming, MFC, and not about C++
_language_. Please consider a different place for your inquiry,
since MFC and Windows are off-topic here. Thanks.

V
 
S

Scott McPhillips [MVP]

hex said:
I put function OnInitDialog in child dialog wich made by class CSecond:

BOOL CSecond::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
m_ed.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}


But focus doesn't set. :(

Did you read the comment in your code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,251
Members
46,851
Latest member
CristineKo

Latest Threads

Top