James Candy
James Candy

Reputation: 459

Focus for a custom control

I am creating effectively a custom control. I went about this by simply generating a window class and creating a window with it with WS_CHILD style. Initially the control accepts keyboard input. The problem I am having is that once another control in the same window receives focus, my custom control does not receive keyboard input any more. How can I obtain keyboard input from my custom control again after focus changes?

Upvotes: 0

Views: 398

Answers (1)

Karthik Kalyanasundaram
Karthik Kalyanasundaram

Reputation: 1525

While creating the Window pass WS_TABSTOP also along with other Window Styles. This will enable your custom control to get focus when user presses TAB key. Please check the MSDN link http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx

Upvotes: 1

Related Questions