CEdit Numeric and also * and #
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: CEdit Numeric and also * and #

  1. #1
    Join Date
    May 2002
    Location
    India
    Posts
    215

    CEdit Numeric and also * and #

    Hi I have a CEdit control.i want to allow only numeric values and * and # in that control and nothing else.
    How can i do this.
    Thanks

  2. #2
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,716

    Re: CEdit Numeric and also * and #

    Quote Originally Posted by kirantoday
    Hi I have a CEdit control.i want to allow only numeric values and * and # in that control and nothing else.
    How can i do this.
    Thanks
    Simple Perform subclassing on your edit Control and go ahead.
    Thanx

  3. #3
    Join Date
    May 2002
    Location
    India
    Posts
    215

    Re: CEdit Numeric and also * and #

    how do i deal with Paste option.
    i.e. if text is copied from somewher and pasted in this edit box how can i restrict that.
    thanks

  4. #4
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Thumbs up Re: CEdit Numeric and also * and #

    Quote Originally Posted by kirantoday
    how do i deal with Paste option.
    i.e. if text is copied from somewher and pasted in this edit box how can i restrict that.
    thanks
    u can handle WM_PASTE.
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  5. #5
    Join Date
    Apr 1999
    Posts
    3,585

    Re: CEdit Numeric and also * and #

    You may want to take a look at using 'regular expressions' for your vaildation needs. For more info, see MSDN for the CAltRegExp class .
    Gort...Klaatu, Barada Nikto!

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center