Print Page | Close Window

Handling TCPIP address

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=8257
Printed Date: 28 September 2024 at 7:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Handling TCPIP address
Posted By: yoavm
Subject: Handling TCPIP address
Date Posted: 01 October 2007 at 6:50pm

How should I define TCPIP address field?
Using maskedit (000.000.000.000) for full three digits is not user friendly.



Thanks,

yoavm




Replies:
Posted By: Oleg
Date Posted: 02 October 2007 at 1:08am
Hi,
 
try this custom item:
 
class CCustomItemIPAddress : public CXTPPropertyGridItem
{
 class CInplaceEditIPAddress : public CXTPPropertyGridInplaceEdit
 {
 public:
  BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
  {  
   if (!CWnd::Create(WC_IPADDRESS, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
    return FALSE;
   
   ModifyStyle(WS_BORDER, 0);
   ModifyStyleEx(WS_EX_CLIENTEDGE, 0, SWP_FRAMECHANGED);  
   return TRUE;
  }
 };
public:
 CCustomItemIPAddress::CCustomItemIPAddress(CString strCaption)
  : CXTPPropertyGridItem(strCaption)
 {
 }
protected:
 virtual CXTPPropertyGridInplaceEdit& GetInplaceEdit()
 {
  return m_wndEdit;
 }
private:
 CInplaceEditIPAddress m_wndEdit;
};


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net