DayWalker Posted May 3, 2004 Posted May 3, 2004 Hi there I have a VB app that the user enters in data into a textbox then prints it out on a form. The textbox is a multiline now when it is printed onto the form it runs off the edge and doesnt start a new line. Basically i need to split the text into 60 characters and put them in a array then run through the array and print the text.....hope it sounds ok...... I am abit lost here dont really know where to start. Any help to get me started will be appreciated Quote
RobEmDee Posted May 3, 2004 Posted May 3, 2004 Have you thought about using a RichTextBox control instead? Quote
JABE Posted May 3, 2004 Posted May 3, 2004 Try this: Dim s As String = TextBox1.Text Dim ctr As Integer = Math.Floor(s.Length / 60) Dim lines(ctr) As String Dim k As Integer For k = 0 To ctr If k = ctr Then lines(k) = s.Substring(k * 60) Else lines(k) = s.Substring(k * 60, 60) End If Next Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.