I put a Picture Control to a Dialog Form.
It (Picture Control) has properties. The question is how I can change these properties in run time? Let's say for instance Modal Frame.
When you say "I put a Picture Control to a Dialog Form" I understand that you have already assigned an ID to this CStatic control , let be it ID_MY_PICTURE and it should be defined in the resource.h and also in the .rc file.
To access the control at run time use :
CStatic * pStatic= (CStatic*)GetDlgItem( ID_MY_PICTURE );
if (pStatic)
{
pStatic->SetBitMap();
pStatic->GetBitmap();
}
Put these statements in the OnInitDialog() or when you cklick on the picture by implementing the BN_CLICKED event:
class CMyDlg : public CDialog
{
public:
//
afx_msg void OnMyPicture();
//
If we look at the Help to find CStatic members or type pStatic-> and look at the list of properties and methods then there will be not above properties.
These properties you are referring to (e.g. Border, Modal Frame, Visible etc) are not specific to Static controls, but apply to all windows in General. Some are extended styles (for example WS_EX_DLGMODALFRAME) and others are just ordinary styles (for example WS_VISIBLE). You set this with SetWindowLong.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.