Skip to content

* Small square rendered next to Close button on KryptonForm when usin…#3263

Open
PWagner1 wants to merge 6 commits intoalphafrom
3183-bug-small-square-rendered-next-to-close-button-on-kryptonform-when-using-a-custom-theme
Open

* Small square rendered next to Close button on KryptonForm when usin…#3263
PWagner1 wants to merge 6 commits intoalphafrom
3183-bug-small-square-rendered-next-to-close-button-on-kryptonform-when-using-a-custom-theme

Conversation

@PWagner1
Copy link
Copy Markdown
Contributor

…g a custom theme

PR Description - #3183

Summary

Fix a rendering artifact (a small square) appearing next to the KryptonForm Close (X) button when using a custom XML-based Krypton theme/palette.

Root Cause

When importing a custom palette from XML, palette values that are omitted by the theme XML could remain at placeholder/default C# values instead of being initialized from the palette's BasePalette. This could leave caption/button chrome in an invalid/partial state, producing a small stray visual element.

Changes

In KryptonCustomPaletteBase.ImportFromXmlDocument, the palette is now populated from BasePalette before applying the XML overrides:

  • Call PopulateFromBaseOperation(null) before importing the Properties / Images elements from the XML.

Why this works

The initial populate step ensures missing metrics/draw settings (including caption/button related values used by the form window buttons) are correctly inherited from the base palette. The subsequent XML import can then override only what the theme explicitly defines.

Files Modified

  • Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs

Testing

  • Repro: apply a custom theme (e.g. Microsoft365Pink) to a KryptonForm and verify the small square near the Close button is gone.
  • Sanity: verify built-in palettes are unaffected.

Notes

  • A full dotnet build was not clean in this environment due to pre-existing MSBuild/resource configuration errors unrelated to this palette change.
image

…g a custom theme

# PR Description - #3183

## Summary
Fix a rendering artifact (a small square) appearing next to the `KryptonForm` Close (X) button when using a custom XML-based Krypton theme/palette.

## Root Cause
When importing a custom palette from XML, palette values that are omitted by the theme XML could remain at placeholder/default C# values instead of being initialized from the palette's `BasePalette`. This could leave caption/button chrome in an invalid/partial state, producing a small stray visual element.

## Changes
In `KryptonCustomPaletteBase.ImportFromXmlDocument`, the palette is now populated from `BasePalette` before applying the XML overrides:
- Call `PopulateFromBaseOperation(null)` before importing the `Properties` / `Images` elements from the XML.

## Why this works
The initial populate step ensures missing metrics/draw settings (including caption/button related values used by the form window buttons) are correctly inherited from the base palette. The subsequent XML import can then override only what the theme explicitly defines.

## Files Modified
- `Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs`

## Testing
- Repro: apply a custom theme (e.g. `Microsoft365Pink`) to a `KryptonForm` and verify the small square near the Close button is gone.
- Sanity: verify built-in palettes are unaffected.

## Notes
- A full `dotnet build` was not clean in this environment due to pre-existing MSBuild/resource configuration errors unrelated to this palette change.
@PWagner1 PWagner1 added this to the Version 110 milestone Mar 25, 2026
@PWagner1 PWagner1 requested a review from a team as a code owner March 25, 2026 16:05
@PWagner1 PWagner1 added area:toolkit All issues related to the toolkit components. version:110 All things to do with V110. labels Mar 25, 2026
PWagner1 and others added 2 commits March 27, 2026 07:48
@PWagner1 PWagner1 requested a review from Smurf-IV March 28, 2026 09:19
@mcpbcs
Copy link
Copy Markdown

mcpbcs commented Mar 28, 2026

Hi @PWagner1,

The issue is still present.
I noticed that the color value is coming directly from the XML. I captured the color using ColorPic and obtained the value RGB(185, 162, 171).
This makes me wonder if the problem could be related to the exporting process rather than the importing one. Do you think that could be the case?

image

@PWagner1
Copy link
Copy Markdown
Contributor Author

Hi @PWagner1,

The issue is still present. I noticed that the color value is coming directly from the XML. I captured the color using ColorPic and obtained the value RGB(185, 162, 171). This makes me wonder if the problem could be related to the exporting process rather than the importing one. Do you think that could be the case?

image

Hi @mcpbcs

Thanks for the info, there's only one way to find out and that is to test that theory.

…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:toolkit All issues related to the toolkit components. version:110 All things to do with V110.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Small square rendered next to Close button on KryptonForm when using a custom theme

3 participants