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. Related to edit boxes

Related to edit boxes

Scheduled Pinned Locked Moved C / C++ / MFC
8 Posts 7 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.
  • T Offline
    T Offline
    Taruni
    wrote on last edited by
    #1

    Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

    A S H D _ 6 Replies Last reply
    0
    • T Taruni

      Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

      A Offline
      A Offline
      Abhi Lahare
      wrote on last edited by
      #2

      SubClass your Edit control. This may help http://www.codeproject.com/dialog/MessageHandling4.asp[^] Regards Abhishake Lahare

      1 Reply Last reply
      0
      • T Taruni

        Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

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

        You can set Min value and Max value for your control(editbox)_**


        **_

        whitesky


        S 1 Reply Last reply
        0
        • T Taruni

          Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

          S Offline
          S Offline
          see me
          wrote on last edited by
          #4

          :) I thing it is better to add control variable for Edit box Instead of using CString as datatype, use CEdit. :) Dream bigger... Do bigger...Expect smaller aji

          1 Reply Last reply
          0
          • H Hamid Taebi

            You can set Min value and Max value for your control(editbox)_**


            **_

            whitesky


            S Offline
            S Offline
            see me
            wrote on last edited by
            #5

            For that i think he need to add Control variable for the edit box instead of CString Dream bigger... Do bigger...Expect smaller aji

            1 Reply Last reply
            0
            • T Taruni

              Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

              D Offline
              D Offline
              Dreamz
              wrote on last edited by
              #6

              Taruni wrote:

              I will enter only numbers and not character type data.

              Then why CString? ;)

              1 Reply Last reply
              0
              • T Taruni

                Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

                _ Offline
                _ Offline
                _AnsHUMAN_
                wrote on last edited by
                #7

                The EN_CHANGE notification message is sent when the user has taken an action that may have altered text in an edit control. Then you override the EN_CHANGE Event and write this code // where m_editbox is a variable associated to the edit window

                char *myValue=new char[m_editbox.GetWindowTextLength ()];
                m_editbox.GetWindowText(myValue,strlen(myValue));
                int i=0;
                i=atoi(myValue);
                if(i>=100 || i<=-100)
                {
                	AfxMessageBox("Invalid value:");
                }
                

                I hope that I understood your query correctly Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                1 Reply Last reply
                0
                • T Taruni

                  Hi, I am working with edit boxes.I have declared a member variable for it with data type as "CString" .Is there any event which rises at the time when the edit box looses the focuses(for eg stating that the range is not between 100 and -100) or alternatively I need some means to set the range for that edit box for which I have declared a variable of type "CString" . I will enter only numbers and not character type data.I will convert the entered data into integers later on.For the entered data I need to find whether it is in the range or not. Thanks in advance Taruni

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

                  Taruni wrote:

                  I have declared a member variable for it with data type as "CString"

                  You should be using CEdit instead. Otherwise, you'll be (incorrectly) using UpdateData(). See here for how/why that method can be avoided.


                  "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

                  "Judge not by the eye but by the heart." - Native American Proverb

                  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