I'm not sure if this is the correct place to ask this; but I have an Infragistics.Win.UltraWinEditors.EditorButton that is used to display some text inside of an UltraComboEditor.
I want the editor button to automatically resize based on the text it is given. But I can't seem to find any sort of .AutoSize = True on the EditorButton. I figured I could use the System.Graphics.MeasureString to get the size of the text and set the width of the button accordingly....but MeasureString needs a System.Windows.Font and the EditorButton doesn't seem to have that. I can access the Appearance.FontData.Name and Appearance.FontData.Size but those are "",0 and that doesn't seem to help.
What should I be doing to get my EditorButton to correctly size?
I've tried a few different things I could think of - but without any luck. Does anyone have any suggestions?
Hi Rob,
I'm not sure what you mean. An editor button will automatically size to it's text. You don't have to do anything.
If you really wanted to, you could resolve the appearance using the ResolveButtonAppearance method. But it's actually a little tricky to reolve the font and you have to be very careful because depending on whether the font is returned from the control or the ambient font is being used, you may or may not have to dispose of the font object you get back.