MFC - round button

1.7k views Asked by At

I'd like to add round button to my application. It should behave as regular push button. I could not find any existing code. Are there any ready solutions?

There would be no problem for me to prepare it by myself, but I would need a recepie which would exactly define how regular push buttons are being drown (when not activate, active, pressed etc).

1

There are 1 answers

0
SChalice On
BOOL CRoundWindowDlg::OnInitDialog()
{
CDialog::OnInitDialog();

VERIFY( SetWindowPos( NULL, 0, 0, m_nW, m_nH, SWP_NOMOVE | SWP_NOOWNERZORDER ) );
VERIFY( m_WinRgn.CreateEllipticRgn( 0, 0, m_nW, m_nH ) );
VERIFY( SetWindowRgn(m_WinRgn , TRUE ) );

m_ExitBtn.Move();

return TRUE;
}

Here is a link:

http://www.codeguru.com/cpp/w-d/dislog/miscellaneous/article.php/c5003/MFC-Round-Windows-and-Highlight-Buttons.htm