multiline txtbox
-
how would i go about retrieving input from a multiline text box? the task i want to do is to get the data on each line of the box, line by line. i want each line entry to be saved into other labels, or variables, or anything. i thought of using a for/next loop to check each individual chr of the box until a ascii(10) or ascii(13) chr is reached. these are, i think, the CR and LF characters which determine a new line and end of line. theres gotta b a better way? Thank you ------------------------ Jordan. III
-
how would i go about retrieving input from a multiline text box? the task i want to do is to get the data on each line of the box, line by line. i want each line entry to be saved into other labels, or variables, or anything. i thought of using a for/next loop to check each individual chr of the box until a ascii(10) or ascii(13) chr is reached. these are, i think, the CR and LF characters which determine a new line and end of line. theres gotta b a better way? Thank you ------------------------ Jordan. III
If your using a single multiline textbox to get input for multiple fields, you really should reconsider your input method. Using a single textbox makes input validation a bit of a chore. On the other hand, why not use the Lines() property of the TextBox? It returns an Array of Strings, one array item per line. RageInTheMachine9532
-
If your using a single multiline textbox to get input for multiple fields, you really should reconsider your input method. Using a single textbox makes input validation a bit of a chore. On the other hand, why not use the Lines() property of the TextBox? It returns an Array of Strings, one array item per line. RageInTheMachine9532
hmm.. i nvr used that line() property before, ill chk it out, thanks. however, since the site was down last nite, i had nothing to do but test my elaborate theory. i got it to work. i had to save each line from the txtbox (up to 4 lines) to 4 different textboxes (singlelined). here is how i did it:
For i = 1 To textLarge.TextLength If Mid(textLarge.Text, i, 1) = Chr(13) Then labelNum += 1 i += 1 Else If labelNum = 1 Then text1.Text &= Mid(textLarge.Text, i, 1) End If If labelNum = 2 Then text2.Text &= Mid(textLarge.Text, i, 1) End If If labelNum = 3 Then text3.Text &= Mid(textLarge.Text, i, 1) End If If labelNum = 4 Then text4.Text &= Mid(textLarge.Text, i, 1) End If End If Next
i could have made it more efficient by using an array of txtboxes instead of 4, so i could reuse the code, but, hey... ------------------------ Jordan. III