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
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.
Hi Mike,
thanks for your reply. I need to have it exactly positioned and additionally I need to be able to click on that icon and change it during runtime.
I would highly appreciate your example :-)
Thanks