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.,
Your sample code did not cause the problem on my system but I was able to recreate it by changing some things and adding an AppStylist theme. I have uploaded my final project. I also built the solution at X64. I am not sure that all of tthese steps are necessary. When I pull out the border style setting the problem goes away.
I tried uploading a zip file with m solution but it failed both times so here is what I suspect is he pertinent code that gives me the horizontal scroll bar that I don't want along with a vertical scrollbar that I do want:
Design File: private void InitializeComponent() { this.ultraFormattedLinkLabel1 = new Infragistics.Win.FormattedLinkLabel.UltraFormattedLinkLabel(); this.SuspendLayout(); // // ultraFormattedLinkLabel1 // this.ultraFormattedLinkLabel1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid; this.ultraFormattedLinkLabel1.Location = new System.Drawing.Point(60, 88); this.ultraFormattedLinkLabel1.Name = "ultraFormattedLinkLabel1"; this.ultraFormattedLinkLabel1.ScrollBarDisplayStyle = Infragistics.Win.UltraWinScrollBar.ScrollBarDisplayStyle.Automatic; this.ultraFormattedLinkLabel1.Size = new System.Drawing.Size(385, 66); this.ultraFormattedLinkLabel1.TabIndex = 0; this.ultraFormattedLinkLabel1.TabStop = true; this.ultraFormattedLinkLabel1.Value = ""; // // Form1 // this.ClientSize = new System.Drawing.Size(535, 395); this.Controls.Add(this.ultraFormattedLinkLabel1); this.Name = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false);
} private Infragistics.Win.FormattedLinkLabel.UltraFormattedLinkLabel ultraFormattedLinkLabel1;
Load event in the Form.CS file:
private void Form1_Load(object sender, EventArgs e) { string t = @"Database version checking failed. Please contact your administrator.For database anthony_50,Script 41010_0001_ALTER_TABLE_CNVAUD has not been run.Script 50054_0045_UPDATE_ENROLMEMBERINFO_CUSTOMS has not been run.Script 50054_0046_ALTER_USP_CJ_UPDATE_FNDMST has not been run.Script 50054_0047_ALTER_USPPPSINSERTDETAIL has not been run.Script 50054_0048_ALTER_USPPPSINSERTADJDETAIL has not been run.Script 50061_0005_ALTER_TABLE_U1NADL has not been run.Script 50061_0006_ALTER_TABLE_J8NRAL has not been run.Script 50061_0007_ALTER_TABLE_Z6NEAL has not been run.Script 50061_0008_ALTER_TABLE_S8CIRR has not been run.Script 50061_0009_CREATE_TABLE_GROUPDELETEEVENTTYPE has not been run.Script 50061_0010_CREATE_TABLE_GROUPDELETEAUDIT has not been run.Script 50061_0011_CREATE_USPINS_GROUPDELETEAUDIT has not been run.Script 50061_0012_CREATE_USPPRC_GETPKJOINFORTABLE has not been run.Script 50061_0013_CREATE_USPPRC_ENABLECLUSTERINDEX has not been run.Script 50061_0014_CREATE_USPPRC_GRPDELETE has not been run.Script 50061_0015_CREATE_USPPRC_GRPDELETEBYCLAIM has not been run.Script 50061_0016_CREATE_USPPRC_GRPDELETEBYCLAIMWITHOUTWKS has not been run.Script 50061_0017_CREATE_USPPRC_GRPDELETEBYCLAIMWKSCOMBINED has not been run.Script 50061_0018_CREATE_USPPRC_GRPDELETEBYCLAIMWORKSHEET has not been run.Script 50061_0019_CREATE_USPPRC_GRPDELETEBYCLMHDR has not been run.Script 50061_0020_CREATE_USPPRC_GRPDELETEBYCONTRACT has not been run.Script 50061_0021_CREATE_USPPRC_GRPDELETEBYENROLLEE has not been run.Script 50061_0022_CREATE_USPPRC_GRPDELETEBYGRPANDFUND has not been run.Script 50061_0023_CREATE_USPPRC_GRPDELETEBYUMCASE has not been run.Script 50061_0024_CREATE_USPPRC_GRPDELETEBYVENDORENROLLEE has not been run.Script 50061_0025_CREATE_USPPRC_GRPDELETETBL_CHKADR has not been run.Script 50061_0026_CREATE_USPPRC_GRPDELETETBL_CLMEOB has not been run.Script 50061_0027_CREATE_USPPRC_GRPDELETETBL_CONTRL has not been run.Script 50061_0028_CREATE_USPPRC_GRPDELETETBL_CONTRL_PYP1 has not been run.Script 50061_0029_CREATE_USPPRC_GRPDELETETBL_DNTDET has not been run.Script 50061_0030_CREATE_USPPRC_GRPDELETETBL_DNTEOB has not been run.Script 50061_0031_CREATE_USPPRC_GRPDELETETBL_GRPMST has not been run.Script 50061_0032_CREATE_USPPRC_GRPDELETETBL_HLDAUD has not been run.Script 50061_0033_CREATE_USPPRC_GRPDELETETBL_IDCCMT has not been run.Script 50061_0034_CREATE_USPPRC_GRPDELETETBL_PEGNOT_C has not been run.Script 50061_0035_CREATE_USPPRC_GRPDELETETBL_PEGNOT_D has not been run.Script 50061_0036_CREATE_USPPRC_GRPDELETETBL_PEGNOT_G has not been run.Script 50061_0037_CREATE_USPPRC_GRPDELETETBL_PYXREF has not been run.Script 50061_0038_CREATE_USPPRC_GRPDELETETBL_QICCMT has not been run.Script 50061_0039_CREATE_USPPRC_GRPDELETETBL_RVSSCH has not been run.Script 50061_0040_CREATE_USPPRC_GRPDELETETBL_SRTQCR has not been run.Script 50061_0041_CREATE_USPPRC_GRPDELETETBL_UMLETT has not been run.Script 50061_0042_CREATE_USPPRC_GRPDELETETBL_UMXREF has not been run.Script 50061_0043_CREATE_USPPRC_GDELETE_DRIVER has not been run.Script 50061_0044_1 has not been run.Script 50061_0045_1 has not been run."; ultraFormattedLinkLabel1.Text = t; } }
I hope this is sufficient for you to see my problem If I remove the line defining the border, then the horizontal scrollbar goes away.
I changed the border specification to NONE and then reduced the width of the label to 380 and I got the same problem
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.