Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Program that reads from text box 1 one by one the letters and copy it to the text box 2 via text box 3.
I would like that every time that TextBox3 = " " (space) the text box 2 to change the line (press enter key).
Public Class Form1
    Dim ptkati As Integer
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        pb1.Maximum = TextBox1.TextLength + 1
        TextBox3.Clear()
        TextBox2.Clear()
        pb1.Value = 0
 
        For Me.ptkati = 0 To TextBox1.TextLength
            TextBox1.Focus()
            TextBox1.SelectionStart = Me.ptkati
            TextBox1.SelectionLength = TextBox1.SelectionStart - (TextBox1.SelectionStart - 1)
            pb1.Value = pb1.Value + 1
            TextBox3.AppendText(TextBox1.SelectedText)
            TextBox2.Text = TextBox2.Text & TextBox3.Text
            If TextBox3.Text = " " Then
               
'I know that I have to put something right here but I don't what!

            End If
            TextBox3.Clear()
        Next
    End Sub
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = "If you trer ie nearest eollowing code shows examples of roundi trer ie nearest eollowing code shows examples of rounding"
    End Sub
End Class
Posted 26-Feb-13 1:14am
Edited 26-Feb-13 1:25am
v3
Comments
André Kraak at 26-Feb-13 7:25am
   
Please DO NOT SHOUT when asking a question. When you use all capital letters it is seen as shouting on the Internet and considered rude. Next time when posting a question please use proper capitalization.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you just want a newline to be inserted in TextBox2.Text at that point then use
TextBox2.Text += vbCrLf
Remember to make sure that the Multiline property of the text box is set to true.
 
I'm not sure your code will actually do what you appear to want it to do though
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 406
1 Sergey Alexandrovich Kryukov 309
2 CB Sharma 79
3 RyanDev 75
4 PhilLenoir 70
0 Sergey Alexandrovich Kryukov 6,676
1 OriginalGriff 6,056
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100