restricting spaces in textbox

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
restricting the data in textbox

i have one query regarding textbox control.i want to enter the value or a text in the textbox without any space in the beginning of the text i am entering.

any suggestions

kulrom said:
http://www.vbdotnetforums.com/showthread.php?t=3205

your answer has been answered already ... maybe it need to be extended for awhile?

Ok, we can do it ... back to original thread and i'll help you out ...

Cheers ;)
 
query in restrict tbx

y u always have a query on my query.

i think my way of questioning is wrong
ok
my query is
before i enter any text into the textbox,i dont want to have leave one space in the beginning of the control.
i want to restrict that the cursor always point to the starting position of the control without leaving any space in the beginning
hope this time i am clear
any queries welcome
kulrom said:
You want to ban space key ? If user try to enter an empty space before rest of the text? is that what you want to do? Or if user enter that you want to validate the same and remove space if there is ...?
Cheers ;)
 
ban space at begg...

i want to ban space only at the beginning of the textbox,not for the entire textbox.

thk u

kulrom said:
Hi,

I made a demo that doesn't accept white spaces within textBox control ... take a look at the attached project ... Cheers ;)
 
got the solution....

i got solution to my query

all we need to do is use TRIM property

that is to eliminate starting and ending spaces in a textbox
we need to use

textbox.text.trim

thank u

srivalli said:
i want to ban space only at the beginning of the textbox,not for the entire textbox.

thk u
 
Back
Top