Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Focus on an edit box

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
Alright...this makes no sense. I'm trying to set the focus to an edit box when my dialog box loads....so, inside the OnInitDialog() function, I'm putting:

Wnd* PreviousFocus;

PreviousFocus = m_report.SetFocus();

m_report is a member variable of my CEdit box. If I am reading the docs correctly, this only sets the focus to the window and not an object? When my dialog box comes up, the OK button has focus and I want to set it to the edit box when it comes up....am I making sense? I've looked and looked but can't seem to find why this is happening! Thanks for any and all help!

Niky Williams
NTS Marketing
 
Figgured out my problem....I was returning true instead of false at the end of my function....amazing how a little word can really change your program.

Niky Williams
NTS Marketing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top