Hi,
I want to show an UltraDesktopAlert with errors on the bottom left of my application (not the bottom of the screen).To achieve this, I use code like this:
info.ScreenPosition = Infragistics.Win.Misc.ScreenPosition.Manual Dim loc As New System.Drawing.Pointloc.X = Me.Leftloc.Y = Me.Top + Me.Height - UltraDesktopAlert.Height (<- this property doesn't exist) info.ScreenLocation = locThe text in the alert is variable. How can I resolve the exact height of the desktop alert (because this is calculated in internal functions of the control)? I also tried to set the FixedSize but the same issue here: how can I calculate the correct height needed to display the whole text?
Hello,
Calculating string length can be done using the graphics objects and its MeasureString method:
using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(new Bitmap(1, 1))) { SizeF size = graphics.MeasureString("Hello there", new Font("Segoe UI", 11, FontStyle.Regular, GraphicsUnit.Point)); }
Regarding height, you can check Font.Height property, and then based on the number of lines you want to have there, calculate the height needed to display the text.
Should you have any other questions, please let me know.
Sincerely,
Tihomir TonevAssociate Software DeveloperInfragistics