CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 7 FirstFirst 1234567 LastLast
Results 46 to 60 of 92
  1. #46
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    I did exactly the same..
    ... but we are still not sure and not believe you.
    Victor Nijegorodov

  2. #47
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Post your latest REAL code

  3. #48
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by GCDEF View Post
    Post your latest REAL code
    It is what we wait for since September 29th, 2019, 07:21 AM
    Victor Nijegorodov

  4. #49
    Join Date
    Sep 2019
    Posts
    34

    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()
    };

  5. #50
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    //----------------------------------------------------------------//

    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.

  6. #51
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    //----------------------------------------------------------------//
    //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

  7. #52
    Join Date
    Sep 2019
    Posts
    34

    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?

  8. #53
    Join Date
    Sep 2019
    Posts
    34

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Ok

  9. #54
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    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

  10. #55
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    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?

  11. #56
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    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.

  12. #57
    Join Date
    Sep 2019
    Posts
    34

    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

  13. #58
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    //----------------------------------------------------------------//
    //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

  14. #59
    Join Date
    Sep 2019
    Posts
    34

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Visual Studio 2015.I think code posted above is compilable?

  15. #60
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet

    Quote Originally Posted by Sparsh_21j View Post
    Visual Studio 2015...
    Are the tab stops disabled/switched off in your Visual Studio 2015 C++ code editor?
    Victor Nijegorodov

Page 4 of 7 FirstFirst 1234567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured