Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Aug 31, 2023
1 parent 1530425 commit 7beb54b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SuperGrate/Controls/Components/SGProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ namespace SuperGrate.Controls.Components
{
public class SGProgressBar : ProgressBar
{
private bool DesignMode = false;
private System.Windows.Controls.ProgressBar ProgressBar = new System.Windows.Controls.ProgressBar();
public SGProgressBar()
{
if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Designtime) return;
if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Designtime)
{
DesignMode = true;
return;
}
ElementHost host = new ElementHost();
host.Dock = DockStyle.Fill;
host.Parent = this;
Expand Down Expand Up @@ -43,7 +48,7 @@ public SGProgressBar()
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
Misc.ApplyStyles(ProgressBar);
if (!DesignMode) Misc.ApplyStyles(ProgressBar);
}
}
}

0 comments on commit 7beb54b

Please sign in to comment.