Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted (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 by handlewithbeer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...