hi
below i'm trying to create a non-rectangular button. becasue CButton is derived from CWnd, i thought that i could assign a region to a CButton and make it elliptical. but below code only works partially. i cannot see the button go elliptic, but when i click on the areas of the button which should be cropped out by the Regioning, correctly the button dosen't function. but why i cannot see the button becomes elliptic?
or, is there a better way to create non-rectangular buttons?
thanxCode:BOOL CMediaPlayerDlg::OnInitDialog() { ...... ...... // TODO: Add extra initialization here RECT rect; m_cbplay.GetWindowRect(&rect); //get the RECT of the m_cbplay button int winh = rect.bottom-rect.top; int winw = rect.right-rect.left; int winx = rect.left; int winy = rect.top; HRGN hRegion1 = CreateEllipticRgn(0,0,winw,winh); //create an elliptical region int err = m_cbplay.SetWindowRgn(hRegion1, true); //set the region to the button DeleteObject(hRegion1); ...... }



LinkBack URL
About LinkBacks


