-
October 7th, 2019, 05:18 AM
#11
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
Code:
//----------------------------------------------------------------//
//Below is the code for .cpp file
//----------------------------------------------------------------//
//MyPropertySheet.cpp
#include "stdafx.h"
#include "MyPropertysheet.h"
#include <ts/texttrans.h>
#include <ts/mfc/tsmfcwinstack.h>
IMPLEMENT_DYNAMIC(MyPropertysheet,CPropertySheet)
MyPropertySheet :: MyPropertySheet(UINT nIdCaption, Cwnd * pParentWnd, UINT iSelectPage): CPropertySheet(pszCaption, pParentWnd, iSelectpage)
{
TSMFCWinStack :: winStack.push(this);
AddPage(&mypage);
m_psh.dwFlags = m_psh.dwFlags | PSH_NOAPPLYNOW;
}
MyPropertySheet :: ~MyPropertySheet()
{
TSMFCWinStack :: winStack.pop(this);
}
Void MyPropertySheet:: DoDataExchange(CDataExchange* pDX)
{
CPropertySheet :: DoDataExchange(pDX);
DDX_Control(pDX, IDOK, m_ok);
}
BEGIN_MESSAGE_MAP(MyPropertySheet, CPropertySheet)
END_MESSAGE_MAP()
BOOL MyPropertysheet:: OnInitDialog()
{
BOOL bResult = CPropertySheet:: OnInitDialog();
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
Code:
//----------------------------------------------------------------//
//Below is the code for Header file
//----------------------------------------------------------------//
//MyPropertySheet.h
#include "MyPropertyPage.h"
#include "afxbutton.h"
class MyPropertySheet : public CPropertySheet
{
DECLARE_DYNAMIC(MyPropertySheet)
public:
//Constructors
MyPropertySheet(UINT nIdCaption, CWnd* pParentWnd = NULL ,UINT iSelectPage = 0);
MyPropertySheet(UINT pszCaption, CWnd* pParentWnd = NULL ,UINT iSelectPage = 0);
//Destructors
virtual ~MyPropertySheet();
virtual void DoDataExchange(CDataExchange* pDX);
public:
MyPropertyPage mypage;
CMFCBUTTON m_ok;
public:
virtual BOOL OnInitDialog();
protected:
DECLARE_MESSAGE_MAP()
};
Your code does NOT compile. There is o lot of errors.
Please, fix the errors an post the compilable code!
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|