|
-
June 11th, 2012, 09:49 AM
#1
Need help with Property Pages and Edit controls
I have two problems.
1. When a certain property page is shown, I want a particular edit box to have focus. I am not sure how to do this, but I tried:
Code:
BOOL PropPageHello::OnSetActive()
{
EditUserName.SetFocus();
return CPropertyPage::OnSetActive();
}
I put in break points and it definitely executes that each time it is first displayed.
2. When I push enter in one edit box I want the next edit box to get focus and become active. I tried the following on the property page:
Code:
void PropPageHello::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
CPropertyPage::OnKeyDown(nChar, nRepCnt, nFlags);
}
If you put a break point on the only executable line there, it never gets hit. This is how you (or at least one way) to do it in a normal dialog, but it doesn't seem to work for property sheets. How do you do it for property pages and sheets?
-
June 11th, 2012, 09:58 AM
#2
Re: Need help with Property Pages and Edit controls
Just a guess, but try calling the SetFocus after calling the base class OnSetActive.
-
June 11th, 2012, 10:35 AM
#3
Re: Need help with Property Pages and Edit controls
Tried it and it didn't work.
-
June 11th, 2012, 11:47 AM
#4
Re: Need help with Property Pages and Edit controls
 Originally Posted by DeepT
Tried it and it didn't work.
You didn't leave the return statement on the base class call did you?
-
June 11th, 2012, 01:15 PM
#5
Re: Need help with Property Pages and Edit controls
I did :
Code:
BOOL PropPageHello::OnSetActive()
{
BOOL Ret = CPropertyPage::OnSetActive();
EditUserName.SetFocus();
return Ret;
}
Hmm, no responses on question 2
-
June 11th, 2012, 01:30 PM
#6
Re: Need help with Property Pages and Edit controls
 Originally Posted by DeepT
I did :
Code:
BOOL PropPageHello::OnSetActive()
{
BOOL Ret = CPropertyPage::OnSetActive();
EditUserName.SetFocus();
return Ret;
}
Hmm, no responses on question 2 
I'd probably try to intercept it with PreTranslateMessage.
-
June 11th, 2012, 01:56 PM
#7
Re: Need help with Property Pages and Edit controls
I found the answer in this Microsoft article:
http://support.microsoft.com/kb/148388
I got lucky with my google fu. Now to try and find the answer to the 2nd question.
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
|