We display variable length text in an UltraFormattedLinkLabel. Each line is terminated with a new line. We have word wrapped turned on so the lines are wrapping, but sometimes we also get a horizontal scroll bar which we don't want. We do want a vertical scrollbar when the text does not fit into the bounds of the label so we do have the ScrollBarDisplayStyle = Infragistics.Win.UltraWinScrollBar.ScrollBarDisplayStyle.Automatic.
The question is, how do we get the vertical scroll bar when it is needed without ever getting a horizontal scrollbar?
Thanks,
Andy
Hello Andrew,
Thank you for contacting Infragistics!
I followed the steps you suggested and was unable to reproduce the behavior you're describing. I created a sample UltraFormmatedLinkLabel and enabled scroll bars and word wrap. It wrapped without issue and only active vertical scrollbars.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, then the change in behavior is due to differences in your environment from mine and these differences can be anything from operating system version to the specific version of the Infragistics DLL versions used. My test was performed using version 18.1.20181.177 in Infragistics for WinForms 2018 Volume 1. Please provide more details about your machine and version of the assemblies that you are referencing so that I can modify the environment that I am testing in to match yours.
If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. This can be done by either be done by making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.
Please let me know if I can provide any further assistance.
UltraFormattedLinkLabel.zip
I guess I should have mentioned that I was able to eliminate the problem by increasing the width of the UltraFormattedLinkLabel so the problem seems to be related to the width of the control. I will try your project and maybe adjust the width of the Label to see if I can reproduce the situation.
Thanks.,
To be able to disable individual scroll bars on the UltraFormattedLinkLabel would be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at Ideas.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea.
My solution was as you suggested - I increased the width of the control. Perhaps the problem is caused by our "words" being very long. The change worked, but I am a bit concerned that there will be some situation in which the scroll bar will appear since it is being used to display error messages, which can contain all sorts of text.
So for now I simply increase the control width by 5 pixels.
It would be nice to have a programmatic option to select which scrollbars to display.
Thank you for the update. I have done some further looking into this matter and it seems for the UltraFormattedLinkLabel there is not a way to turn off an individual scroll bar without turning off the other. You could try resizing the control to see if you can find a size where the horizontal scroll bar does not activate.
Here is my project zipped without the bin and obj foldersWinFormsTest.NoBins.zip
Thank you for the update. You were likely unable to upload your sample due to size. Before zipping it up please delete the bin and obj folders and then try attaching it again to the thread.