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 Matthew,
Yes I finally checked it and its pointing me in the right direction.
Thanks a lot and thanks to Mike for the example.
Hi Michael,
Did you get a chance to look at the example?
Hi Mike,
sorry for the late reply, but I was already in the weekend.
Yes, I need it accurately positioned. Our designer insists on it :-)
Thanks for the example I will check it today.
Thanks
Here's the sample. It moves the image 3 pixels up and to the left and also shows how to capture a mouse click on it.
I just want to verify 2 things before I create the sample:
1) Using my code, the image is literally about 1 or 2 pixels off from where you have it in your screen shot. So you are saying that's not acceptable for what you need? If not, then I can write you a CreationFilter that moves the image 1-2 pixels, but it seems like a lot overkill for something so tiny.
2) Detecting a click on the image is the same regardless of how you display the image. You do it using the UIElements. You could use MouseDown or MouseUp and I will whip up some sample code for that.
Even if you need to move the image, applying it to the Appearance is still a good idea, since that way the image element is already there and this will save a lot of coding. Otherwise, you have to create an manage your own ImageUIElement.