Hi,
I'm struggling with setting the padding of a WinEditor, e.g. a TextEditor.
I would like to mark a mandatory text field with a colored bar at the left border of the text box. The width of
this bar is 8 pixels. So if I do this by using a background image, the entered text covers the bar.
Therefore, I would like to add an indent to the text. Is there a way to set the padding or the margin
of the embedded editor?
Thanks for the help.
Kind regards, Olivier
Hi Olivier,
Use the Image instead of the ImageBackground and the text will be shifted over.
Hi Mike,
thanks for the answer.
That's not really what I'm looking for though - if I use an image, it's impossible let the colored
shape fill the entire client area (text box top - bottom) on the left. There is always a white border.
And this also looks different when the editor is in edit mode.
So, I'd prefer keeping the background image. Do you know a way to set the padding?
best regards, olivier
There's no way to set padding on an UltraTextEditor.
I still think you can do what you want using an Image. The Image gives you a very easy way to shift the text over. If you want the image to cover the borders of the control, then you could do this with a CreationFilter. All you have to do is trap the AfterCreateChildElements of whatever element contains the ImageUIElement and move the ImageUIElementRect so that it covers the borders of the control.
If you are not familiar with CreationFilters, they take a little time to learn, but they are really worth it if you need to do this sort of detailed UI customization. I recommend checking out the Infragistics Knowledge Base for articles and sample CreationFilters. Also, get the Infragistics UIElementViewer Utility. It's a huge help when dealing with UIElements.
And, of course, if you get stuck, feel free to post again and I will try to help.
Hi Mike
Thanks a lot for this answer!
I'll try to do it this way. This approach may also help with some other issues we're
dealing with at the moment, great.
That's a very useful tool, this should be part of the distribution :-)
Kind regards, olivier