In, for instance, samples/dialogs, if you change the button being SetDefault() in any of the example dialogs, such as MyModalDialog from:
Code: Select all
m_btnModal->SetFocus();
m_btnModal->SetDefault();
Code: Select all
m_btnModeless->SetFocus();
m_btnModeless->SetDefault();
It seems to always give focus to the first-added control. If switch the Add() calls around so that the modeless button is added first, it will have the focus. The same seems to apply for any other dialog with a text control added first, etc.: the first-added control gets the focus regardless of SetFocus().