Home > MFC, Windows API > A round dialog box!

A round dialog box!

Ever wondered how those cute little round dialog boxes are created. I too wondered for some time. But let me tell you it is easy, take a look:

Do this from OnInitDialog!

//Create a region object globally.
CRgn m_EllipticRegion;

//a rect object
CRect crDialogRect;

//get your dialog size

//Now create the elliptic region from the client rect
crDialogRect.Height() /*Height*/

//create a round dialog
this->SetWindowRgn(m_EllipticRegion, TRUE);

See I told you it’s easy 🙂

  1. Aditi
    March 18, 2009 at 5:55 pm

    Hi Nibu,
    I have another request for you. Do you hve a code in VC++ which can make round command buttons? I really can’t find a straight forward and simple code for the same.. It would be of great help if u could post it here.
    Thanx and Regards,

    • March 18, 2009 at 5:57 pm

      That’s a nice idea Aditi, I’ll give it a shot.

      • Aditi
        March 18, 2009 at 5:57 pm

        Thanx a ton 🙂

  2. Aditi
    March 16, 2009 at 3:31 pm

    Thank you for this code. It works in my code perfectly and has been of great help to me :):)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: