handlewithbeer Posted September 14, 2005 Posted September 14, 2005 I have a textbox with several order items in it. To determine the number of lines, I divided the height with the font size. Cool. Now, to get the total number of lines of text, I used a string array, set it to the textbox, and used stringArray.getUpperbound(0). Cooler. now for the question. If the number of total lines of text (ie order items) is greater than the amount of lines the textbox can hold (ie what the user would see) how can I add the remaining lines of text to another array, and print that off. I know it sounds a bit confusing, but any help would be appreciated. thanks, H.W.B. Quote
sgt_pinky Posted September 15, 2005 Posted September 15, 2005 You can use Array.Copy() to copy specific elements from one array to another. Not sure if that answers your question. Quote
handlewithbeer Posted September 16, 2005 Author Posted September 16, 2005 (edited) That is kinda working, but still a bit buggy. Take a look. Dim lineCount As Integer 'number of lines in the textbox lineCount = (txtOrderItems.Height / myFont.Height) - 1 'firstArray initialized to hold the textBox contents Dim firstArray() As String firstArray = txtOrderItems.Lines 'if there are more lines past the bottom of the TextBox, get a cutoff point Dim breakOff As Integer = firstArray.GetUpperBound(0) - lineCount 'Now What? This is where I need assistance. Dim secondArray() As String secondArray = ?? OK, so you see the problem, and I'm just not sure how to copy, in laymens terms, from starting point X all the way to the end Edited September 16, 2005 by handlewithbeer 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.