« November 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
You are not logged in. Log in

Programming Tips
Friday, 18 November 2005
A round dialog box!
Mood:  on fire
Topic: VC++
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.
So you don't trust me eh. Take a look:

//Create a region object globally.
CRgn m_EllipticRegion;

//a rect object
CRect crDialogRect;

//get your dialog size
this->GetClientRect(crDialogRect);

//Now create the elliptic region from the client rect
m_EllipticRegion.CreateEllipticRgn(0/*x*/,
                  0/*y*/,
                  crDialogRect.Width()/*width*/,
                  crDialogRect.Height() /*Height*/
                  );

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

See I told you it's easy :)

Posted by Nibu babu thomas at 5:30 PM

View Latest Entries