Sunscreen
Sunscreen

Reputation: 3564

MFC Tab order programmatically

I was wondering is there a way to set the tab order at run time instead of design time? This is crucial as at initialisation some fields are being hidden or rearranged in the dialog.

Upvotes: 3

Views: 3254

Answers (1)

dandan78
dandan78

Reputation: 13925

You can use the Win32 API to achieve this:

SetWindowPos(hNewControl, hOldControl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

See this question for more details.

Upvotes: 5

Related Questions