G
Guest
I have a TextBox that I am putting some conditions on, such as restricting
the number of decimal places that the user can enter. I have been using the
KeyPress event, which allow me to examine the current text and prevent
inappropriate keys from being pressed. But I can not figure out how to
determine where in the text the text cursor is. For example, a digit key
might be allowed before the decimal place, but not allowed after, but I can
not determine where the key they pressed is going to be placed, there does
not appear to be a TextBox member that provides this information. Is there
one? Or can it be done another way? Thanks.
the number of decimal places that the user can enter. I have been using the
KeyPress event, which allow me to examine the current text and prevent
inappropriate keys from being pressed. But I can not figure out how to
determine where in the text the text cursor is. For example, a digit key
might be allowed before the decimal place, but not allowed after, but I can
not determine where the key they pressed is going to be placed, there does
not appear to be a TextBox member that provides this information. Is there
one? Or can it be done another way? Thanks.