Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. restrict text box

restrict text box

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rjkg
    wrote on last edited by
    #1

    how to restrict textbox so that it takes input only between given numbers i.e. 1-100

    Rajesh

    H R R D 4 Replies Last reply
    0
    • R rjkg

      how to restrict textbox so that it takes input only between given numbers i.e. 1-100

      Rajesh

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Why you dont set Min/Max value for editbox? After set these parameters you will be have this line: DDV_MinMaxInt(pDX, m_Test, 0, 100);

      R 1 Reply Last reply
      0
      • R rjkg

        how to restrict textbox so that it takes input only between given numbers i.e. 1-100

        Rajesh

        R Offline
        R Offline
        ritz1234
        wrote on last edited by
        #3

        see http://msdn.microsoft.com/en-us/library/95zx4bc4(VS.71).aspx[^]

        ritz1234

        1 Reply Last reply
        0
        • H Hamid Taebi

          Why you dont set Min/Max value for editbox? After set these parameters you will be have this line: DDV_MinMaxInt(pDX, m_Test, 0, 100);

          R Offline
          R Offline
          rjkg
          wrote on last edited by
          #4

          how can I do I could not found any funtion or property of edit control to set these value .

          Rajesh

          C H 2 Replies Last reply
          0
          • R rjkg

            how to restrict textbox so that it takes input only between given numbers i.e. 1-100

            Rajesh

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            rajeshgupta1253 wrote:

            how to restrict textbox so that it takes input only between given numbers i.e. 1-100

            Spin button control[^] exists for this purpose.

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            R 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              rajeshgupta1253 wrote:

              how to restrict textbox so that it takes input only between given numbers i.e. 1-100

              Spin button control[^] exists for this purpose.

              Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

              R Offline
              R Offline
              rjkg
              wrote on last edited by
              #6

              my requirement is edit box not spin control

              Rajesh

              R 1 Reply Last reply
              0
              • R rjkg

                my requirement is edit box not spin control

                Rajesh

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                What you want is not what you need. Is there a reason why you would want to use the edit control only?

                Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                1 Reply Last reply
                0
                • R rjkg

                  how can I do I could not found any funtion or property of edit control to set these value .

                  Rajesh

                  C Offline
                  C Offline
                  Chandrasekharan P
                  wrote on last edited by
                  #8

                  check it in DoDataExchange Function

                  DDX_Control(pDX,IDC_EDIT,m_Test);

                  u can find something like this(example). just after this put the below written code.

                  DDV_MinMaxInt(pDX, m_Test, 0, 100);

                  1 Reply Last reply
                  0
                  • R rjkg

                    how can I do I could not found any funtion or property of edit control to set these value .

                    Rajesh

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    You must be right click on the control and select Add variable and then set Category to Value now you can set Min/Max values.

                    1 Reply Last reply
                    0
                    • R rjkg

                      how to restrict textbox so that it takes input only between given numbers i.e. 1-100

                      Rajesh

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #10

                      Are you using MFC? Do you want the numbers validated as they are typed, when the edit control loses focus, or when the OK button is clicked?

                      "Love people and use things, not love things and use people." - Unknown

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups