Open lorinkundert opened 3 years ago
Can you show an "enlarged" image of what you are seeing please. (Show the document tree as well if you can) I have been able to get the Krypton control(s) right into the edges, so it might be something to with the hierarchy of padding and margins of the parent up the tree to the form.
The Ribbon and Statusbar never touch the edge of the form
I would add the Feature Request
and/or Enhancement
tag(s) to this thread. Seems that a BorderWidth
option needs to be added to the KryptonForm
.
No.. It's the AllowFormChrome
setting:
But: The bug is then that the Title bar is not rendered.
If you do not want a title bar or borders (i.e. to have full control over the layout) then use the following:
FormBorderStyle = FormBorderStyle.None
What we will need is access to 'Border.Padding' it is usually fixed in the registry system wide which mine is so KryptonForm needs it.
If you want padding, then just place a Panel on the form, and setting padding / margins in that.. I'm not following what else is needed if "Border.Padding" is not the drawing of a border ??
We need this kind of window, theme is unimportant
We need this kind of window, theme is unimportant
Hello @all,
I think this looks like a Metro-Framework or WPF? Krypton is not yet a Metro-Control-Set. Perhaps you have a look to a NuGet-Package with Metro-Controls like MetroFramework-Modern-UI: https://github.com/dennismagno/metroframework-modern-ui
@Wagnerp and @Smurf-IV: Perhaps can be a theme bring a solution?
Greetings from Germany, Danny
Interesting.. Even with that framework there is a border:
A solution would be to set AllowFormChrome
to false, and fix the Themed title bar, and the above "LSD Tool" look would be possible without any modifications to Krypton drawing for everything else.
Another Solution is the FormBorderStyle = FormBorderStyle.None
, and use panels and Normal Krypton controls to perform the Drag Drop / Sizing.
The first is a bug, and would then be simple (Once fixed). The 2nd means no Krypton Code changes, but more work on the developer to simulate windows Drag Drop / Sizing.
Quick demo of Option 2:
And with the black theme:
We need this kind of window, theme is unimportant
Hello @ALL,
I think this looks like a Metro-Framework or WPF? Krypton is not yet a Metro-Control-Set. Perhaps you have a look to a NuGet-Package with Metro-Controls like MetroFramework-Modern-UI: https://github.com/dennismagno/metroframework-modern-ui
@Wagnerp and @Smurf-IV: Perhaps can be a theme bring a solution?
Greetings from Germany, Danny
Now that would be interesting, maybe in a future update?
This is from ComponentOne, commercial product, I want to get away from the problems with handling the licenses. I know what the problem is though, the border and border padding at the form level are really window level, it's what gave Windows 7 that ugly fat border, from glancing at your code I t seems you get the default system metrics but we need to get the current metrics. I modifed the registry to eliminate that padding and it works on every window except Krypton, so something is missing, if I can find it, I will let you know.
Themes can change the padding according to Microsoft, so I will start with the chrome code and metrics. This is how ComponentOne did it, through the theme engine.
This is where that property is
[DllImport("user32.dll")] static extern int GetSystemMetrics(92);
CXPADDEDBORDER = 92, // 0x5C
@lorinkundert Does #139, cover this now ? Please close this if it does - Thanks
Note: An active Material Design Winform UI kit: https://github.com/leocb/MaterialSkin
@Smurf-IV Is this best suited for the Extended Toolkit
?
No. When the Fixes related to this are done, then it will just be a Theme (like the Office 365 variants) that will need to be added to the Standard toolkit.
Yes, it's possible to create a sort of "proxy class" to interface the ModernUI framework with Krypton, I've started this week ... here some screen shots:
the form is a modern form, and on change style/theme event will "customize" the krypton palette on the fly.
@AngeloCresta I think the #827 will help with this, as I think the current XML implementation is too complex to understand.
Actually, you don't need to use the xml, you can just set the color values on a custom palette ad assign it back to the krypton manager, like in this snippet:
`
//init base palette
KryptonPalette kryptonPaletteOffice365Black = new KryptonPalette();
KryptonPalette kryptonPaletteOffice365Silver = new KryptonPalette();
kryptonPaletteOffice365Black.BasePaletteMode = PaletteMode.Office365Black;
kryptonPaletteOffice365Silver.BasePaletteMode = PaletteMode.Office365Silver;
//set according to metro style
if (mts == ModernThemeStyle.Dark)
kryptonManager.GlobalPalette = kryptonPaletteOffice365Black;
else
kryptonManager.GlobalPalette = kryptonPaletteOffice365Silver;
//init color management
KryptonPalette kp = new KryptonPalette();
try
{kp.BasePalette = (KryptonPalette)kryptonManager.GlobalPalette;}
catch (Exception ex)
{Debug.WriteLine(ex.Message);}
//round?
int round = 0;
//color proxy for buttons common
kp.ButtonStyles.ButtonCommon.StateNormal.Back.ColorStyle = PaletteColorStyle.Solid;
kp.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = Color.Gray;
kp.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = Color.Gray;
kp.ButtonStyles.ButtonCommon.StateNormal.Border.Color1 = Color.DarkGray;
kp.ButtonStyles.ButtonCommon.StateNormal.Border.Color2 = Color.DarkGray;
kp.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = Color.Black;
kp.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = Color.Black;
kp.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = Color.Black;
kp.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = Color.Black;
kp.ButtonStyles.ButtonCommon.StateNormal.Border.Rounding = round;
kp.ButtonStyles.ButtonCommon.StateTracking.Back.ColorStyle = PaletteColorStyle.Solid;
kp.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = Color.Red;
kp.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = Color.Red;
kp.ButtonStyles.ButtonCommon.StateTracking.Border.Color1 = Color.Pink;
kp.ButtonStyles.ButtonCommon.StateTracking.Border.Color2 = Color.Pink;
kp.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = Color.White;
kp.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color2 = Color.White;
kp.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = Color.White;
kp.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color2 = Color.White;
kp.ButtonStyles.ButtonCommon.StateTracking.Border.Rounding = round;
//.....
//set back the customized palette to krypton manager
kryptonManager.GlobalPalette = kp;
kryptonManager.GlobalPaletteMode = PaletteModeManager.Custom;
` I've used this approach for my proxy class, creating a specific function where the KryptonManager is passed and new values are set according to some events (ModernUI or MetroUI changing theme or style). All the relevant color properties are exposed.
Regards, Angelo (AdvancedComputing - Extended Renderer .... ;) )
Hi @AngeloCresta
Looks good, no what I meant is rather than using XML files, allow the KryptonManager
to 'import' class files, based on PaletteBase
, which I think is similar to what you're attempting to do?
cc @Smurf-IV
based on
PaletteBase
will be IPaletteBase
, so that any implementation of Serialisation by the developer can be used.
IPaletteBase
may (will) be extended to allow up to date functionality, once I get my head round it's usage within the Krypton components (It's big !)
I think that this is "Now possible" via a New theme and either the use of the new setting in
AllowFormChrome
has been removed and replaced with UseThemeFormChromeBorderWidth
to better explain what it is doingvia setting the "Border width" to be 2 in the palette designer..
This needs a revisit and probably a checklist of items to make Krypton "Flat" and "Metro"-able...
Today many tools are focused on an interface that more resembles Win10/Material design, your framework is capable but there is some padded area immediately starting from the inner border of the window to the other controls, this leaves a large gap along the edges, how can that be removed? changes to border width do not affect it.