how can u change button shape at run time

Answers were Sorted based on User's Feedback



how can u change button shape at run time..

Answer / kishore kumar naik p

"Somil Vijay" is wrong here. SetWindowPos is used to resize
the dialog. "San" is right, see example below

CYourDialog::OnInitDialog()
{
....
CRgn oRgn;
oRgn.CreateEllipticRgn(10,10,100,100);

CWnd *pWnd = GetDlgItem(IDC_BUTTON_ID);

if(NULL != pWnd)
{
pWnd->SetWindowRgn(oRgn);
}
....
}

Instead of "CreateEllipticRgn" you can many other methods to
create the shape that is required for you.

Is This Answer Correct ?    9 Yes 0 No

how can u change button shape at run time..

Answer / san

Use SetWindowRgn function of the CWnd class. You could
specify the shape of the region as a parameter of this function.

Is This Answer Correct ?    6 Yes 0 No

how can u change button shape at run time..

Answer / somil vijay

Use Setwindowspos function of Cwnd class .Use this function
on Cbutton object.

BOOL CWnd::SetWindowPos(
const CWnd* pWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags
);

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More MFC Interview Questions

What does mfc stand for?

0 Answers  


What interface must be supported by an ActiveX control?

2 Answers  


What is the base class for MFC

3 Answers   HCL,


What is CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example

6 Answers  


How can i implement the dynamic menus in MFC plz give the code

2 Answers  






How to handle dynamic menus in MFC?

3 Answers   HCL,


what is the use of AFX_MANAGE_STATE ?

4 Answers   HCL,


What is a message map?

1 Answers   Mphasis,


Difference between Cclint DC & Cpaint Dc

6 Answers   E Logic,


List out the basic features of MFC.

4 Answers   Mphasis,


What is the use of message map ?

5 Answers   TCS,


What MFC base classes provide support for ActiveX controls?

2 Answers   Wipro,


Categories