Hi
I am using an UltraTextEditor in a gridbaglayout panel. its is set to dock so that the UTE expands to fill the space given to it.
I have set multiline on so that it does actually fill the space and have set Text Align to middle and centre, hoping that the text will sit in the middle of the UTE in the same way that it does with a label.
However it doesn't, the text sits in the middle of the horizontal axis, but at the top of the box. Is there anything I can do to make it sit in the middle of the vertical axis in the same way an ultralabel works?
My application resizes the windows based on the screen size, and on big displays it looks a bit rubbish.
I am also looking for a way to get the font to resize based on the size of the UTE control so it propotionally readjusts according to the space it has.
Thanks in advance
I'd updated the base class of my ultraTextEditor and the new base class was forcing the AlwaysInEditMode flag to true.
Thank you for helping me out, the control now works again.
There's not much I can do with a couple of vb files. In order to do anything helpful here, I would need a complete sample project that I could run.
But based on your last post, it sounds like the control is never leaving edit mode.Remember - the code I posted here will not work unless the UltraTextEditor is not in edit mode.
Did you set AlwaysInEditMode to true?
Me.Label.AlwaysInEditMode = True
I can upload my controls source code if this will help with the investigation, you'll have to tell me how though
Hi Mike
Thank you for your help so far
The code you posted was more like the code I had originally (having copied it from the grid example)
what seems to be happening is the drawParams.Element is only ever getting the values
Infragistics.Win.UltraWinEditors.UltraTextEditorUIElement
and
Infragistics.Win.EditorWithTextUIElement
it did use to get EditorWithTextDisplayTextUIElement but this is no longer turning up, so I never get to return DrawPhase.BeforeDrawForeground
I dont know what I did to upset it !
Hi,
Hmm... are you sure this was working before? This doesn't seem right to me.I don't think the UltraTextEditorUIElementis what actually draws the text.
The EditorWithTextDisplayTextUIElement is the element you want.
Also... I doubt this has anything to do with the issue, but it's not good practice to set AppearanceData properties inside the GetPhasesToFilter method. And in this case, it's redundant.
#Region "IUIElementDrawFilter Members" Private Function IUIElementDrawFilter_DrawElement(ByVal drawPhase As DrawPhase, ByRef drawParams As UIElementDrawParams) As Boolean Implements IUIElementDrawFilter.DrawElement drawParams.AppearanceData.TextVAlign = VAlign.Middle Return False End Function Private Function IUIElementDrawFilter_GetPhasesToFilter(ByRef drawParams As UIElementDrawParams) As DrawPhase Implements IUIElementDrawFilter.GetPhasesToFilter If TypeOf drawParams.Element Is EditorWithTextDisplayTextUIElement Then Return DrawPhase.BeforeDrawForeground End If Return DrawPhase.None End Function#End RegionEnd Class