Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: KryptonForm loses visibility when the form border property is set to None using certain themes #483

Closed
Wagnerp opened this issue Nov 20, 2021 · 2 comments
Labels
bug Something isn't working completed This issue has been completed. fixed This issue has been fixed.
Milestone

Comments

@Wagnerp
Copy link
Contributor

Wagnerp commented Nov 20, 2021

image

Happens with all themes except:
Professional - System
Professional - Office 2003
Office 2013
Office 365 – Black
Office 365 - Black (Dark Mode)
Office 365 - Blue
Office 365 - Blue (Dark Mode)
Office 365 - Blue (Light Mode)
Office 365 - Silver
Office 365 - Silver (Dark Mode)
Office 365 - Silver (Light Mode)
Office 365 - White

To reproduce:
Start the program:

  1. Change the theme multiple times. All should work fine
  2. Select the first theme in the combo-box
  3. Click the “Remove Borders” button.
  4. Change the theme multiple times until the window disappears.

Happens when the From property is changed as on the second statement (code behind the button):

//this works fine
this.StateCommon.Border.Draw = Krypton.Toolkit.InheritBool.False
//this causes the form to disappear
this.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None;
//this works fine
this.StateCommon.Header.Border.Draw = Krypton.Toolkit.InheritBool.False;
this.StateCommon.Header.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None

KryptonTestApp1.zip

@Wagnerp Wagnerp added the bug Something isn't working label Nov 20, 2021
@mbsysde99
Copy link

To resolved this bug, look at KryptonForm.cs

private void UpdateBorderRegion(Region newRegion)
{
       ////////////////////////////////////////////////
        // add this to resolved that problems
	if (newRegion == null) {
	    return;
	}
	if (newRegion.IsEmpty(this.CreateGraphics())) {
	    return;
	}
       ////////////////////////////////////////////////

	// Cache the current region setting
	Region oldRegion = Region;

	// Use the new region
	Region = newRegion;

	// Cleanup old region gracefully
	oldRegion?.Dispose();
}

@Wagnerp Wagnerp self-assigned this Nov 24, 2021
@Wagnerp Wagnerp added the in progress A fix for this issue is in the works. label Nov 24, 2021
@Wagnerp Wagnerp added this to the January 2022 milestone Nov 24, 2021
Wagnerp added a commit that referenced this issue Nov 24, 2021
Smurf-IV added a commit that referenced this issue Nov 24, 2021
@Wagnerp Wagnerp removed their assignment Nov 24, 2021
@Wagnerp Wagnerp added completed This issue has been completed. fixed This issue has been fixed. and removed in progress A fix for this issue is in the works. labels Nov 24, 2021
@Wagnerp
Copy link
Contributor Author

Wagnerp commented Nov 24, 2021

Fixed in build 2201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This issue has been completed. fixed This issue has been fixed.
Projects
None yet
Development

No branches or pull requests

2 participants