CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    3

    Don't want "0" to be displayed in numeric edit box

    Greetings all,

    I have an edit box which is set up as a numeric edit box. I would like to know how to display nothing when the value of the control is 0.

    Thanks in advance,

    Nigel "Twitch" Smith.


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Don't want "0" to be displayed in numeric edit box

    Unfortunately it is the 'numeric edit box' feature which forces the zero in there, since it knows it MUST have at least one digit. I recommend changing to a normal string edit box, deriving from CEdit and subclassing so that you can prevent non-digits, and interpreting the contents as a number yourself. I don't think it is possible to override this behaviour otherwise.



    --
    Jason Teagle
    [email protected]

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