Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - About Hex value in property grid.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

About Hex value in property grid.

 Post Reply Post Reply
Author
Message
dubaoan View Drop Down
Groupie
Groupie


Joined: 01 December 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote dubaoan Quote  Post ReplyReply Direct Link To This Post Topic: About Hex value in property grid.
    Posted: 05 February 2006 at 1:05am

Hi, all,

    Would you please tell me whether CXTPPropertyGridItemNumber supports display and acceptance of the hex value? And if not, how can I realize that? 

    Is there any ways other than using 'SetMask' ?

    Thanks!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2006 at 4:50am

Hi,

Here custom class:

class CXTPPropertyGridItemHexNumber : public CXTPPropertyGridItemNumber
{
public:
 CXTPPropertyGridItemHexNumber(const CString& strCaption, long nValue = 0)
  : CXTPPropertyGridItemNumber(strCaption, nValue)
 {
  SetNumber(nValue);
 }

 void SetValue(CString strValue)
 {
  int nValue = 0;
  if (_stscanf(strValue, _T("%x"), &nValue) == 1)
  { 
   SetNumber(nValue);
  }
 }
 
 void SetNumber(long nValue)
 {
  m_nValue = nValue;
  
  if (m_pBindNumber)
  {
   *m_pBindNumber = m_nValue;
  }
  
  CString strValue;
  strValue.Format(_T("%x"), nValue);
  CXTPPropertyGridItem::SetValue(strValue);
 }
};

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dubaoan View Drop Down
Groupie
Groupie


Joined: 01 December 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote dubaoan Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2006 at 7:04pm
Thanks!!!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.