Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1350
UltraTextEditor customized
posted

Hi all,

I derived my own control from UltraTextEditor to show an icon in the top left corner of the control (I overwrote OnPaint). PLs see attached image.

But when I now enter Edit Mode it draws the text box over my Icon. So I need to move the inner text box more to the right. How is this possible?

Or can I achieve this by doing it in a completely diffrent way, maybe DrawFilter ?

Regards

Michael

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Michael,

    Using OnPaint is going to be problematic.

    A CreationFilter would work better, because it would allow you to manipulate the UIElements and moving the text UIElement would also reposition the TextBox when the control enters edit mode.

    But... it seems to me that there is a much simpler solution here. You could simply set the ultraTextEditor.Appearance.Image property to an image. The only problem I see with that approach is that you want the image in the top left instead of center left.


                this.ultraTextEditor1.Appearance.Image = Image.FromFile("image file");
                this.ultraTextEditor1.Appearance.ImageHAlign = Infragistics.Win.HAlign.Left;
                this.ultraTextEditor1.Appearance.ImageVAlign = Infragistics.Win.VAlign.Top;

    This is a much simpler approach, so I can't see any reason why you would want to jump through hoops to use a CreationFilter or OnPaint. Unless the position of the image needs to be more precisely positioned - in which case I could probably whip you up a simple CreationFilter example.

Children