code_junkie

How to SetFocus to a CButton so that the border and focus dotted line are visible?

Nov 13th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. void CbuttonfocusDlg::OnBnClickedButton3()
  2. {
  3. // TODO: Add your control notification handler code here
  4. GetDlgItem(IDC_BUTTON1)->SetFocus();
  5.  
  6. Invalidate();
  7.  
  8. }
  9.  
  10. static_cast<CButton*>(GetDlgItem(IDC_BUTTON1))->SetButtonStyle(BS_DEFPUSHBUTTON);
  11.  
  12. this->m_myButton.SetButtonStyle(BS_DEFPUSHBUTTON);
Add Comment
Please, Sign In to add comment