[Closed] CXTPControlEdit - Numeric |
Post Reply |
Author | |
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
Posted: 11 June 2007 at 1:09pm |
Hi,
How do I make a CXTPControlEdit have the ES_NUMBER style? I've tried many options, got nowhere.
|
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Call pControl->SetEditStyle(ES_NUMBER);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
Just tried this in the CommandBarControls sample:
Doesn't work I can still enter non-numeric.
|
|
Simon HB9DRV
|
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
Also, how can I force the CXTPControlEdit to create the internal edit control so that I can call GetEditCtrl()->SetLimitText(3); ?
|
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Right, sorry forgot that Edit control is actually RichEdit that doesn't support ES_NUMBER flag.
For Limit text you can create custom edit:
class CMyControlEdit : public CXTPControlEdit
{ DECLARE_XTP_CONTROL(CMyControlEdit) void SetRect(CRect rcControl);
}; IMPLEMENT_XTP_CONTROL(CMyControlEdit, CXTPControlEdit)
void CMyControlEdit::SetRect(CRect rcControl)
{ CXTPControlEdit::SetRect(rcControl); if (m_pEdit->GetSafeHwnd()) { m_pEdit->SetLimitText(3); } }
usage:
CXTPControlEdit* pControlEdit = (CXTPControlEdit*)pToolBarEdit->GetControls()->Add(new CMyControlEdit(), ID_FILE_NEW);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
Thanks Oleg,
Shame that Numeric isn't available - I need to protect my users from themselves .
Thanks for the hard work... |
|
Simon HB9DRV
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |