how can u change button shape at run time
Answers were Sorted based on User's Feedback
"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 |
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 |
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 |
Why not virtual functions to handle messages?
what is the difference between SDI and MDI
15 Answers CMC, HCL, Siemens,
what is the size of a process
what is the component of CLR ?
Differ GetMessage, PostMessage & PeakMessage?
How to handle command line arguements from simple MFC application ?
How many types of dialog box are their
What MFC base classes provide support for ActiveX controls?
if i modified data in 1 view how does the other view knows
What is the difference between Struts and JSF? Pls list some most suitable differences.
I can i set size of integer variable should be fixed for different operating systems(Ex i want integer size is 2bytes in OS)
1)At run-time, you can change the icon by calling the LoadIcon() function?