|
-
Oct 16th, 2002, 03:41 AM
#1
Thread Starter
Lively Member
String doesn't fit in label
This is probably very very easy...i think there's some pre-made function in VB for it..but I can't find it...
I have a string...."sgsdgkjdsglkdjglkdjglkdjfglkdgjlkdg"
And a label which can hold up to 8 character and 4 lines (for examle)
When I use
it will only show the first 8 characters....
But I want it to have the first 8 on the first line..and the next 8 on the next line..
So I need a function to split it and enter space between it...(I suppose)
If the string is "sgsdg kjdsglkdjg lkdjglkdjfgl kdgjlkdg" then it will work fine...
Last edited by Chrissie; Oct 16th, 2002 at 03:45 AM.
-
Oct 16th, 2002, 03:46 AM
#2
Lively Member
Just re size your label?
Or maybe use instr to check if word is at the 8th position, make a " & vbcrlf "
An elephant learning VB..
-
Oct 16th, 2002, 04:25 AM
#3
Thread Starter
Lively Member
Resizing the label is no option...
Checking for the 8 position is not an option...
consider the string is "blas bladf" - there is a charachter at the 8 position but I don't want it to be split as there's already a space in the word in front of it...
-
Oct 16th, 2002, 04:37 AM
#4
Frenzied Member
Use Split on spaces.
Step throuugh the array for any item with more than 8 characters.
OR
Step through the string character by character.
When you get to a space, start the special count again.
When you get to 8, add a space and start the special count again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|