How can i set an transparent image to an ImageAndTextButtonUIElement so only the image is displayed an not the border and the button background. I tried using the Appearance.ImageBackground and set the ThemedElementAlpha to Transparent. But now no Image is displaed at all. When using ImageAndTextButtonUIElement.Image then the image is shown but with border and button background.
Any suggestions?
Thanks and regards
Thorsten Pontow
Hello Thorsten,
I have been investigating into the requirement you are asking for here, but before I make a recommendation, I would just like to get a better idea of what exactly you are trying to achieve in this case. From your description, it sounds like you likely have a CreationFilter going on for one of the Infragistics for Windows Forms controls since you are modifying the ImageAndTextButtonUIElement, but this could be a number of different controls.
Can you please provide some information on the end-goal that you are looking to achieve in this case, just in case a CreationFilter is potentially not necessary?
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew, actually i have a DrawFilter for a ToolbarManager and i place an onto a PopupMenuTool in UIElementDrawFilter.DrawElement() because i like to offer an additional user interaction on every menu item. It all works fine but I just can't get it to show only the image (a png with transparent background) without the border and the background color of the button (like an menu item image is displayed).
I am still a little bit confused as to what you are drawing on your PopupMenuTool’s child tools in this case? From your descriptions in this thread, it sounds like you are drawing a Button with an image inside, but I am not certain on this.
Would it be possible for you to please provide a sample project on this matter that shows what you are drawing, or perhaps just provide the code you are using for your DrawFilter for your PopupMenuTool?
Hello Andrew, hello Mike,
I have adapted Mike's last sample to my project. Now everything works fine for me. Thanks a lot for the support.
Regards
Thank you Mike! I will have a look at your updated sample.
If you are using a Style Library (isl), you're going to have to jump through some hoops to get the button to ignore it. Here's an updated sample.
7411.ToolbarsManagerPopupDrawFilterDemo.zip
StollfussMedienOriginal.zip
The orginal style isl-File from which we started our own isl-File. Even with this one the icon is not transparent while using a CreationFilter.
Without using the style everything is ok!
So i only need a way to prevent AppStyling for the ImageAndTextButtonUIElement. In this forum i found some posts that suggest to implement an own ImageAndTextButtonUIElement subclass and override the DrawTheme() method and return false. Is that the right way to do it?
Hello Andrew,
I used a CreationFilter with your image as a test and it still didn't work. But your example works correctly. I thought about what the difference between our implementations could be and suddenly I came up with the solution! We use a style (.isl file). When I removed the style usage everything was as I wanted it.
But since we have to use the style mandatory, my question is, what inside the style file do I have to change and how to make it work? I will add our style file as an attachment. Can you help me with that?