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!
[sourcecode language=’cpp’]//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);[/sourcecode]
See I told you it’s easy π
Thank you for this code. It works in my code perfectly and has been of great help to me :):)
You are welcome Aditi π
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,
Aditi
That’s a nice idea Aditi, I’ll give it a shot.
Thanx a ton π
Welcome.