-
October 8th, 2019, 11:35 AM
#46
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
I did exactly the same..
... but we are still not sure and not believe you.
Victor Nijegorodov
-
October 8th, 2019, 11:40 AM
#47
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Post your latest REAL code
-
October 8th, 2019, 11:46 AM
#48
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by GCDEF
Post your latest REAL code
It is what we wait for since September 29th, 2019, 07:21 AM
Victor Nijegorodov
-
October 8th, 2019, 12:09 PM
#49
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
//----------------------------------------------------------------//
//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();
UpdateData(FALSE);
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
//----------------------------------------------------------------//
//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()
};
-
October 8th, 2019, 12:13 PM
#50
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
//----------------------------------------------------------------//
CMFCBUTTON m_ok;
I said REAL code. Also, use CODE tags, not QUOTE. We're trying here, but if you're going to keep posting nonsense, there's not much point.
Last edited by GCDEF; October 8th, 2019 at 12:16 PM.
-
October 8th, 2019, 12:17 PM
#51
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
//----------------------------------------------------------------//
//Below is the code for .cpp file
//----------------------------------------------------------------//
//MyPropertySheet.cpp
Code:
#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();
UpdateData(FALSE);
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
//----------------------------------------------------------------//
//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()
};
Please, post us a compilable code!
Just do copy/paste and remove all the things we cannot refer to.
Victor Nijegorodov
-
October 8th, 2019, 12:19 PM
#52
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Real code in sense? I have pasted exact line to line code.....which else real code?
-
October 8th, 2019, 12:19 PM
#53
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
-
October 8th, 2019, 12:20 PM
#54
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
Real code in sense? I have pasted exact line to line code.....which else real code?
No, you didn't.
That "code" does not compile.
Victor Nijegorodov
-
October 8th, 2019, 12:23 PM
#55
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
Real code in sense? I have pasted exact line to line code.....which else real code?
Same question that has been asked. Keeping in mind that C++ is a case sensitive language, what is CMFCBUTTON?
-
October 8th, 2019, 12:28 PM
#56
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Code tags
What is CMFCBUTTON?
Use the debugger to see if m_ok has a valid m_hWnd.
-
October 8th, 2019, 12:31 PM
#57
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
//----------------------------------------------------------------//
//Below is the code for .cpp file
//----------------------------------------------------------------//
Code:
//MyPropertySheet.cpp
#include "stdafx.h"
#include "MyPropertysheet.h"
IMPLEMENT_DYNAMIC(MyPropertysheet,CPropertySheet)
MyPropertySheet::MyPropertySheet(UINT nIdCaption, Cwnd * pParentWnd, UINT iSelectPage): CPropertySheet(pszCaption, pParentWnd, iSelectpage)
{
m_psh.dwFlags = m_psh.dwFlags | PSH_NOAPPLYNOW;
}
MyPropertySheet::~MyPropertySheet()
{
}
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();
UpdateData(FALSE);
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
//MyPropertySheet.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:
CMFCButton m_ok; //CMFCButton a MFC class
public:
virtual BOOL OnInitDialog();
protected:
DECLARE_MESSAGE_MAP()
};
Last edited by VictorN; October 8th, 2019 at 12:35 PM.
Reason: adding code tags
-
October 8th, 2019, 12:37 PM
#58
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
//----------------------------------------------------------------//
//Below is the code for .cpp file
//----------------------------------------------------------------//
...
May I ask you: are you always writing/using unformatting code?
What IDE are you using?
Victor Nijegorodov
-
October 8th, 2019, 09:18 PM
#59
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Visual Studio 2015.I think code posted above is compilable?
-
October 9th, 2019, 01:35 AM
#60
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
Visual Studio 2015...
Are the tab stops disabled/switched off in your Visual Studio 2015 C++ code editor?
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
|