[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

How to SetFocus on a CEdit box so that the user can just start typing when the dialog loads?

Hello everyone,

I have a dialog that opens when a user opens my application asking them for their username/password. I want to have the focus set on the USERNAME CEdit box when the dialog loads so that the user doesn't have to click on the USERNAME box to type in their text.

The focus should be set on load so they can just type in their name.

How can I do this? Any comments or pointing in the right direction is appreciated.
0
VirtueTech
Asked:
VirtueTech
  • 2
1 Solution
 
jkrCommented:
The easiest way - set that CEdit as the initially focused (default) control for that dialog using the resource editor.
0
 
VirtueTechAuthor Commented:
I don't see a way to set it as the initially focused control.

Is this in the CEdit box's properties?

Sorry for the newb question
0
 
AlexFMCommented:
In dialog editor Select Layout - Tab Order in the menu and click dialog controls in desired order. First should be this edit box.
BTW, setting focus programmatically is done using GotoDlgCtrl function.
0
 
VirtueTechAuthor Commented:
Wow...that was cool..and pretty easy. Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now