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

Does the application have more than one object? If Yes, Briefly explain.

2 Answers   Soltius Infotech,


What is userdefine Messages in MFC?

1 Answers   HCL,


Can you explaing the relashionship between document,frame and view ?

2 Answers  


1)How to create ToolTip in MFC?

2 Answers  


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,






What is the difference between Extension DLL and Regular DLL?

6 Answers   GE,


What is the base class for MFC

3 Answers   HCL,


Explain Doc/View architecture

6 Answers   Huawei,


Hi All, i am new for VC++ SDK. i want to get the IP Address of all the External device connected with my local machine.please give the code Regards, Praveer

1 Answers   TCS, Tech Mahindra,


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,


What is subclassing?

2 Answers  


1) Enable or disable a Cancel button at run time?

1 Answers   HCL,


Categories