Thanks for reaching out.
The issue occurs because the image attributes are forcing a white background, which doesn’t adapt to theme changes. To fix this:
- Remove the hardcoded
Backgroundvalue. - Add
_ImageAttributesFlags.IAF_Themeto theFlagsso the Image Service applies theme-based rendering.
Here’s an updated code snippet:
Flags = unchecked((uint)(_ImageAttributesFlags.IAF_RequiredFlags | _ImageAttributesFlags.IAF_Theme))
This ensures your ToolStrip buttons display correctly in both light and dark themes. Let me know if you need a full working example or guidance on handling ThemeChanged events.
Let us know if the issue persists after following these steps. I’ll be happy to assist further if needed. If the issue has been resolved, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.