|
-
Jul 20th, 2010, 06:33 AM
#1
Thread Starter
Hyperactive Member
listbox / label issues
Instead of making back to back posts, I figured I'll just ask two questions in this post:
1) When displaying text in a label with autosize=false, is it possible to display as much of one word as possible until it gets cutoff. Right now, if one word is longer than where the end of the label is set to, it won't display any of that word.
2) Is it possible to implement a down/up button that when clicked will scroll the listbox either down or up. I'm thinking of having the button change the selected index +/- 1, but will the view of the box scroll with the newly selected items?
-
Jul 20th, 2010, 07:06 AM
#2
Re: listbox / label issues
1) I don't think its possible, at least I don't think there's a default option for that. If the first word you enter in your label is longer than the label itself then it will display as much of that word as possible But if you enter multiple words, and let's say that the third word exceeds the label's length by a couple characters then it seems that the label will only display the first two word and won't even display the first characters of the third word, even if there would be enough space for this.
Alex
.NET developer
"No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)
Things to consider before posting.
Don't forget to rate the posts if they helped and mark thread as resolved when they are.
.Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
My fresh new blog : writingthecode, even if I don't post much.
System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0 
-
Jul 20th, 2010, 07:37 AM
#3
Re: listbox / label issues
With number 1, you could consider adding an ellipses ( ... ) at a certain point.
VB.NET MVP 2008 - Present
-
Jul 20th, 2010, 07:45 AM
#4
Re: listbox / label issues
 Originally Posted by detlion1643
Instead of making back to back posts, I figured I'll just ask two questions in this post:
Wrong option. Keep each thread to a single topic and each topic to a single thread. Your aim is to keep the forum organised and easy to use for everyone. Combining topics in a single thread makes things more confusing for the people posting to a thread and information harder to find for others.
1. The Label control won't do that for you. You can use GDI+ to draw the Text yourself, using one of the overloads of Graphics.DrawString that takes a StringFormat argument. The StringFormat class has a Trimming property that can trim the drawn text in various ways.
2. When you try it for yourself you'll know whether it works or not. Then you only need to ask if it doesn't.
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
|