Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
X=0
For i = 0 To TextBoxLength – 1
X=x+1
If ( TextBox1.Text(i) =" " ) then 

TextBox1 = TextBox1.Replace(" ", (20-x))      

Next i

this code use to give size term in text by vb.net2010?????
Posted
Updated 4-Apr-12 2:31am
v2
Comments
Prasad_Kulkarni 4-Apr-12 8:32am    
..and the question is??
Manoj Kumar Choubey 4-Apr-12 8:56am    
What do you want to do ..... ???? explain more "size" what size do you want to calculate .....

1 solution

Following is your code , I am Modified only ....

VB
D
       im X As Integer = 0
      Dim i As Integer
      Dim TextBoxLength As Integer = 0

      TextBoxLength = TextBox1.Text.Length

      For i = 0 To TextBoxLength - 1
          X = X + 1
          If TextBox1.Text.Substring(i) = " " Then
              TextBox1.Text = TextBox1.Text.Replace(" ", (20 - X))
          End If

      Next i

Please explain following things
1. TextBox1.Text.Replace(" ", (20 - X))? and 20 - x ?
2. What do you want to do exactly ?
 
Share this answer
 
Comments
Manoj Kumar Choubey 4-Apr-12 12:43pm    
Ohh do you want to calculate number of space's between (words) terms .....
terms means words
You have a text file and you need to count space's in it and display to text box
Am I wirte ....
explain so I can help you ...... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900