Repository: N-a-r-w-i-n/MetroSet-UI Branch: master Commit: 39c93bd370da Files: 129 Total size: 892.6 KB Directory structure: gitextract_95ymntp2/ ├── .gitattributes ├── .gitignore ├── LICENSE ├── MetroSet Theme.xml ├── MetroSet UI/ │ ├── Actions/ │ │ ├── MetroSetBadgeActionList.cs │ │ ├── MetroSetButtonActionList.cs │ │ ├── MetroSetCheckBoxActionList.cs │ │ ├── MetroSetControlBoxActionList.cs │ │ ├── MetroSetDefaultButtonActionList.cs │ │ ├── MetroSetDividerActionList.cs │ │ ├── MetroSetEllipseActionList.cs │ │ ├── MetroSetLabelActionList.cs │ │ ├── MetroSetLinkActionList.cs │ │ ├── MetroSetListBoxActionList.cs │ │ ├── MetroSetNumericActionList.cs │ │ ├── MetroSetProgressBarActionList.cs │ │ ├── MetroSetRadiobuttonActionList.cs │ │ ├── MetroSetRichTextBoxActionList.cs │ │ ├── MetroSetScrollBarActionList.cs │ │ ├── MetroSetSwitchActionList.cs │ │ ├── MetroSetTextBoxActionList.cs │ │ ├── MetroSetTileActionList.cs │ │ ├── MetroSetToolTipActionList.cs │ │ ├── MetroSetTrackBarActionList.cs │ │ └── StyleManagerActionList.cs │ ├── Animates/ │ │ ├── Animate.cs │ │ ├── ColorAnimate.cs │ │ ├── DoubleAnimat.cs │ │ ├── IntAnimate.cs │ │ ├── Interpolation.cs │ │ ├── PointFAnimate.cs │ │ └── SizeFAnimate.cs │ ├── Child/ │ │ ├── MetroSetItemCollection.cs │ │ ├── MetroSetSetTabPage.cs │ │ ├── MetroSetTabPageCollectionEditor.cs │ │ └── MetroSetToolStripMenuItem.cs │ ├── Components/ │ │ ├── MetroSetSetToolTip.cs │ │ └── StyleManager.cs │ ├── Controls/ │ │ ├── MetroSetBadge.cs │ │ ├── MetroSetButton.cs │ │ ├── MetroSetCheckBox.cs │ │ ├── MetroSetComboBox.cs │ │ ├── MetroSetContextMenuStrip.cs │ │ ├── MetroSetControlBox.cs │ │ ├── MetroSetDefaultButton.cs │ │ ├── MetroSetDivider.cs │ │ ├── MetroSetEllipse.cs │ │ ├── MetroSetLabel.cs │ │ ├── MetroSetLink.cs │ │ ├── MetroSetListBox.cs │ │ ├── MetroSetNumeric.cs │ │ ├── MetroSetPanel.cs │ │ ├── MetroSetProgressBar.cs │ │ ├── MetroSetRadioButton.cs │ │ ├── MetroSetRichTextBox.cs │ │ ├── MetroSetScrollBar.cs │ │ ├── MetroSetSwitch.cs │ │ ├── MetroSetTabControl.cs │ │ ├── MetroSetTextBox.cs │ │ ├── MetroSetTile.cs │ │ └── MetroSetTrackBar.cs │ ├── Design/ │ │ ├── MetroSetBadgeDesigner.cs │ │ ├── MetroSetButtonDesigner.cs │ │ ├── MetroSetCheckBoxDesigner.cs │ │ ├── MetroSetControBoxDesigner.cs │ │ ├── MetroSetDefaultButtonDesigner.cs │ │ ├── MetroSetDividerDesigner.cs │ │ ├── MetroSetEllipseDesigner.cs │ │ ├── MetroSetLabelDesigner.cs │ │ ├── MetroSetLinkDesigner.cs │ │ ├── MetroSetListBoxDesigner.cs │ │ ├── MetroSetNumericDesigner.cs │ │ ├── MetroSetProgressBarDesigner.cs │ │ ├── MetroSetRadioButtonDesigner.cs │ │ ├── MetroSetRichTextBoxDesigner.cs │ │ ├── MetroSetScrollBarDesigner.cs │ │ ├── MetroSetSwitchDesigner.cs │ │ ├── MetroSetTabControlDesigner.cs │ │ ├── MetroSetTabpageDesigner.cs │ │ ├── MetroSetTextBoxDesigner.cs │ │ ├── MetroSetTileDesigner.cs │ │ ├── MetroSetToolTipDesigner.cs │ │ ├── MetroSetTrackBarDesigner.cs │ │ └── StyleManagerDesigner.cs │ ├── Enums/ │ │ ├── BageAlign.cs │ │ ├── CheckState.cs │ │ ├── DividerStyle.cs │ │ ├── EasingType.cs │ │ ├── MouseSates.cs │ │ ├── ProgressOrientation.cs │ │ ├── ScrollOrientation.cs │ │ ├── SignStyle.cs │ │ ├── Style.cs │ │ ├── TabStyle.cs │ │ ├── TextAlign.cs │ │ └── TileAlign.cs │ ├── Extensions/ │ │ ├── Global Font.cs │ │ ├── GraphicsQuality.cs │ │ ├── Methods.cs │ │ ├── MetroSetFonts.cs │ │ └── Utilites.cs │ ├── Forms/ │ │ ├── MetroSetForm.cs │ │ ├── MetroSetForm.resx │ │ └── MetroSetMessageBox.cs │ ├── Interfaces/ │ │ ├── IMetroForm.cs │ │ ├── IMetroSetControl.cs │ │ ├── MetroSetControl.cs │ │ └── MetroSetForm.cs │ ├── MetroSet UI.csproj │ ├── Native/ │ │ └── User32.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ ├── PublishProfiles/ │ │ │ └── FolderProfile.pubxml │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── Resources/ │ └── MetroSet Theme.xml ├── MetroSet UI Example/ │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── MetroSet UI Example.csproj │ ├── Program.cs │ └── Properties/ │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── MetroSet UI.sln └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto ############################################################################### # Set default behavior for command prompt diff. # # This is need for earlier builds of msysgit that does not have it on by # default for csharp files. # Note: This is only used by command line ############################################################################### #*.cs diff=csharp ############################################################################### # Set the merge driver for project and solution files # # Merging from the command prompt will add diff markers to the files if there # are conflicts (Merging from VS is not affected by the settings below, in VS # the diff markers are never inserted). Diff markers may cause the following # file extensions to fail to load in VS. An alternative would be to treat # these files as binary and thus will always conflict and require user # intervention with every merge. To do so, just uncomment the entries below ############################################################################### #*.sln merge=binary #*.csproj merge=binary #*.vbproj merge=binary #*.vcxproj merge=binary #*.vcproj merge=binary #*.dbproj merge=binary #*.fsproj merge=binary #*.lsproj merge=binary #*.wixproj merge=binary #*.modelproj merge=binary #*.sqlproj merge=binary #*.wwaproj merge=binary ############################################################################### # behavior for image files # # image files are treated as binary by default. ############################################################################### #*.jpg binary #*.png binary #*.gif binary ############################################################################### # diff behavior for common document formats # # Convert binary document formats to text before diffing them. This feature # is only available from the command line. Turn it on by uncommenting the # entries below. ############################################################################### #*.doc diff=astextplain #*.DOC diff=astextplain #*.docx diff=astextplain #*.DOCX diff=astextplain #*.dot diff=astextplain #*.DOT diff=astextplain #*.pdf diff=astextplain #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ [Xx]64/ [Xx]86/ [Bb]uild/ bld/ [Bb]in/ [Oo]bj/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # DNX project.lock.json artifacts/ *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db # Visual Studio profiler *.psess *.vsp *.vspx *.sap # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # TODO: Un-comment the next line if you do not want to checkin # your web deploy settings because they may include unencrypted # passwords #*.pubxml *.publishproj # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Microsoft Azure ApplicationInsights config file ApplicationInsights.config # Windows Store app package directory AppPackages/ BundleArtifacts/ # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ [Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.dbproj.schemaview *.pfx *.publishsettings node_modules/ orleans.codegen.cs # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files *.mdf *.ldf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # LightSwitch generated files GeneratedArtifacts/ ModelManifest.xml # Paket dependency manager .paket/paket.exe # FAKE - F# Make .fake/ /MetroSet UI/Controls/MetroSetDataGrid.cs ================================================ FILE: LICENSE ================================================ MIT License MetroSet UI - MetroSet UI Framewrok Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: MetroSet Theme.xml ================================================ Custom Theme Narwin
#293955 #FFFFFF #ffc40d #ffc40d #ffc40d #293955 #ffc40d
#ffc40d #000000 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #EEEEEE #505050 #6D6D6D #ffc40d #ffc40d #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #EEEEEE #505050 #6D6D6D #ffc40d #FFBA03 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #FFE235 #FFE235 #6D6D6D #ffc40d #000000 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #ffc40d #FFFFFF #cb2828 #FFFFFF #a31414 #FFFFFF #FFE235 #FFE235 #6D6D6D #CCCCCC #FFFFFF #6E6E6E #6E6E6E #ffc40d #FFFFFF #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #ffc40d #6E6E6E n #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #ffc40d #6E6E6E #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #6E6E6E #ffc40d #EEEEEE #505050 #6D6D6D #ffc40d #ffc40d #00FFFFFF #ffc40d #999999 Shape #5C5C5C #FFFFFF #9B9B9B #555555 #9B9B9B #ffc40d #CDCDCD #FFE235 #ffc40d #ffc40d #00FFFFFF #ffc40d #999999 Horizontal 1 #ffc40d #ffc40d #00FFFFFF #41b1e1 #55c5f5 #2d9dcd HoverUnderline #FFFFFF #FFFFFF #ffc40d #EEEEEE #EEEEEE #ffc40d #EEEEEE #EEEEEE #FFE235 #EEEEEE #8F8F8F #ffc40d #EEEEEE #8F8F8F #FFE235 #FFFFFF #AAAAAA #808080 #808080 #FFFFFF #ffc40d #C0C0C0 #FFFFFF #ffc40d #808080 #FFFFFF #FFFFFF #ffc40d #505050 #6D6D6D #FFFFFF #808080 #404040 #FFFFFF #ffc40d #000000 #FFE235 #505050 #6D6D6D #FFFFFF #6E6E6E #ffc40d #FFFFFF #808080 #EEEEEE #808080 #808080 #EEEEEE #808080 #808080
================================================ FILE: MetroSet UI/Actions/MetroSetBadgeActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetBadgeActionList : DesignerActionList { private readonly MetroSetBadge _metroSetBadge; public MetroSetBadgeActionList(IComponent component) : base(component) { _metroSetBadge = (MetroSetBadge)component; } public Style Style { get => _metroSetBadge.Style; set => _metroSetBadge.Style = value; } public string ThemeAuthor => _metroSetBadge.ThemeAuthor; public string ThemeName => _metroSetBadge.ThemeName; public StyleManager StyleManager { get => _metroSetBadge.StyleManager; set => _metroSetBadge.StyleManager = value; } public string Text { get => _metroSetBadge.Text; set => _metroSetBadge.Text = value; } public Font Font { get => _metroSetBadge.Font; set => _metroSetBadge.Font = value; } public BadgeAlign BadgeAlignment { get => _metroSetBadge.BadgeAlignment; set => _metroSetBadge.BadgeAlignment = value; } public string BadgeText { get => _metroSetBadge.BadgeText; set => _metroSetBadge.BadgeText = value; } public override DesignerActionItemCollection GetSortedActionItems() { var items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionHeaderItem("Badge"), new DesignerActionPropertyItem("BadgeText", "BadgeText", "Badge", "Gets or sets the badge text associated with the control."), new DesignerActionPropertyItem("BadgeAlignment", "BadgeAlignment", "Badge", "Gets or sets the badge alignment associated with the control.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetButtonActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetButtonActionList : DesignerActionList { private readonly MetroSetButton _metroSetButton; public MetroSetButtonActionList(IComponent component) : base(component) { _metroSetButton = (MetroSetButton)component; } public Style Style { get => _metroSetButton.Style; set => _metroSetButton.Style = value; } public string ThemeAuthor => _metroSetButton.ThemeAuthor; public string ThemeName => _metroSetButton.ThemeName; public StyleManager StyleManager { get => _metroSetButton.StyleManager; set => _metroSetButton.StyleManager = value; } public string Text { get => _metroSetButton.Text; set => _metroSetButton.Text = value; } public Font Font { get => _metroSetButton.Font; set => _metroSetButton.Font = value; } public override DesignerActionItemCollection GetSortedActionItems() { var items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetCheckBoxActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetRadioButtonActionList : DesignerActionList { private readonly MetroSetRadioButton _metroSetRadioButton; public MetroSetRadioButtonActionList(IComponent component) : base(component) { _metroSetRadioButton = (MetroSetRadioButton)component; } public Style Style { get => _metroSetRadioButton.Style; set => _metroSetRadioButton.Style = value; } public string ThemeAuthor => _metroSetRadioButton.ThemeAuthor; public string ThemeName => _metroSetRadioButton.ThemeName; public StyleManager StyleManager { get => _metroSetRadioButton.StyleManager; set => _metroSetRadioButton.StyleManager = value; } public string Text { get => _metroSetRadioButton.Text; set => _metroSetRadioButton.Text = value; } public bool Checked { get => _metroSetRadioButton.Checked; set => _metroSetRadioButton.Checked = value; } public override DesignerActionItemCollection GetSortedActionItems() { var items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Checked", "Checked", "Appearance", "Gets or sets a value indicating whether the control is checked."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetControlBoxActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { internal class MetroSetControlBoxActionList : DesignerActionList { private readonly MetroSetControlBox _metroSetControBox; public MetroSetControlBoxActionList(IComponent component) : base(component) { _metroSetControBox = (MetroSetControlBox)component; } public Style Style { get => _metroSetControBox.Style; set => _metroSetControBox.Style = value; } public string ThemeAuthor => _metroSetControBox.ThemeAuthor; public string ThemeName => _metroSetControBox.ThemeName; public StyleManager StyleManager { get => _metroSetControBox.StyleManager; set => _metroSetControBox.StyleManager = value; } public bool MaximizeBox { get => _metroSetControBox.MaximizeBox; set => _metroSetControBox.MaximizeBox = value; } public bool MinimizeBox { get => _metroSetControBox.MinimizeBox; set => _metroSetControBox.MinimizeBox = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("MaximizeBox", "Enable MaximizeBox", "Appearance", "Gets or sets a value indicating whether the Maximize button is Enabled in the caption bar of the form."), new DesignerActionPropertyItem("MinimizeBox", "Enable MinimizeBox", "Appearance", "Gets or sets a value indicating whether the Minimize button is Enabled in the caption bar of the form.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetDefaultButtonActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetDefaultButtonActionList : DesignerActionList { private readonly MetroSetDefaultButton _metroSetButton; public MetroSetDefaultButtonActionList(IComponent component) : base(component) { _metroSetButton = (MetroSetDefaultButton)component; } public Style Style { get => _metroSetButton.Style; set => _metroSetButton.Style = value; } public string ThemeAuthor => _metroSetButton.ThemeAuthor; public string ThemeName => _metroSetButton.ThemeName; public StyleManager StyleManager { get => _metroSetButton.StyleManager; set => _metroSetButton.StyleManager = value; } public string Text { get => _metroSetButton.Text; set => _metroSetButton.Text = value; } public Font Font { get => _metroSetButton.Font; set => _metroSetButton.Font = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetDividerActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetDividerActionList : DesignerActionList { private readonly MetroSetDivider _metroSetDivider; public MetroSetDividerActionList(IComponent component) : base(component) { _metroSetDivider = (MetroSetDivider)component; } public Style Style { get => _metroSetDivider.Style; set => _metroSetDivider.Style = value; } public string ThemeAuthor => _metroSetDivider.ThemeAuthor; public string ThemeName => _metroSetDivider.ThemeName; public StyleManager StyleManager { get => _metroSetDivider.StyleManager; set => _metroSetDivider.StyleManager = value; } public DividerStyle Orientation { get => _metroSetDivider.Orientation; set => _metroSetDivider.Orientation = value; } public int Thickness { get => _metroSetDivider.Thickness; set => _metroSetDivider.Thickness = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Orientation", "Orientation", "Appearance", "Gets or sets Orientation of the control."), new DesignerActionPropertyItem("Thickness", "Thickness", "Appearance", "Gets or sets the divider thickness."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetEllipseActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetEllipseActionList : DesignerActionList { private readonly MetroSetEllipse _metroSetEllipse; public MetroSetEllipseActionList(IComponent component) : base(component) { _metroSetEllipse = (MetroSetEllipse)component; } public Style Style { get => _metroSetEllipse.Style; set => _metroSetEllipse.Style = value; } public string ThemeAuthor => _metroSetEllipse.ThemeAuthor; public string ThemeName => _metroSetEllipse.ThemeName; public StyleManager StyleManager { get => _metroSetEllipse.StyleManager; set => _metroSetEllipse.StyleManager = value; } public string Text { get => _metroSetEllipse.Text; set => _metroSetEllipse.Text = value; } public Font Font { get => _metroSetEllipse.Font; set => _metroSetEllipse.Font = value; } public int BorderThickness { get => _metroSetEllipse.BorderThickness; set => _metroSetEllipse.BorderThickness = value; } public Size ImageSize { get => _metroSetEllipse.ImageSize; set => _metroSetEllipse.ImageSize = value; } public Image Image { get => _metroSetEllipse.Image; set => _metroSetEllipse.Image = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionPropertyItem("BorderThickness", "BorderThickness", "Appearance", "Gets or sets the border thickness associated with the control."), new DesignerActionPropertyItem("Image", "Image", "Appearance", "Gets or sets the image associated with the control."), new DesignerActionPropertyItem("ImageSize", "ImageSize", "Appearance", "Gets or sets the image size associated with the control."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetLabelActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { class MetroSetLabelActionList : DesignerActionList { private readonly MetroSetLabel _metroSetLabel; public MetroSetLabelActionList(IComponent component) : base(component) { _metroSetLabel = (MetroSetLabel)component; } public Style Style { get => _metroSetLabel.Style; set => _metroSetLabel.Style = value; } public string ThemeAuthor => _metroSetLabel.ThemeAuthor; public string ThemeName => _metroSetLabel.ThemeName; public StyleManager StyleManager { get => _metroSetLabel.StyleManager; set => _metroSetLabel.StyleManager = value; } public string Text { get => _metroSetLabel.Text; set => _metroSetLabel.Text = value; } public Font Font { get => _metroSetLabel.Font; set => _metroSetLabel.Font = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetLinkActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; using static System.Windows.Forms.LinkLabel; namespace MetroSet_UI.Actions { class MetroSetLinkActionList : DesignerActionList { private readonly MetroSetLink _metroSetLink; public MetroSetLinkActionList(IComponent component) : base(component) { _metroSetLink = (MetroSetLink)component; } public Style Style { get => _metroSetLink.Style; set => _metroSetLink.Style = value; } public string ThemeAuthor => _metroSetLink.ThemeAuthor; public string ThemeName => _metroSetLink.ThemeName; public StyleManager StyleManager { get => _metroSetLink.StyleManager; set => _metroSetLink.StyleManager = value; } public string Text { get => _metroSetLink.Text; set => _metroSetLink.Text = value; } public Font Font { get => _metroSetLink.Font; set => _metroSetLink.Font = value; } public LinkBehavior LinkBehaviour { get => _metroSetLink.LinkBehavior; set => _metroSetLink.LinkBehavior = value; } public Color LinkColor { get => _metroSetLink.LinkColor; set => _metroSetLink.LinkColor = value; } public Color ActiveLinkColor { get => _metroSetLink.ActiveLinkColor; set => _metroSetLink.ActiveLinkColor = value; } public Color VisitedLinkColor { get => _metroSetLink.VisitedLinkColor; set => _metroSetLink.VisitedLinkColor = value; } public bool LinkVisited { get => _metroSetLink.LinkVisited; set => _metroSetLink.LinkVisited = value; } public LinkCollection Links => _metroSetLink.Links; public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionPropertyItem("LinkVisited", "LinkVisited", "Appearance", "Gets or sets a value indicating whether a link should be displayed as though it were visited."), new DesignerActionPropertyItem("LinkColor", "LinkColor", "Appearance", "Gets or sets the color used when displaying a normal link."), new DesignerActionPropertyItem("ActiveLinkColor", "ActiveLinkColor", "Appearance", "Gets or sets the color used to display an active link."), new DesignerActionPropertyItem("VisitedLinkColor", "VisitedLinkColor", "Appearance", "Gets or sets the color used when displaying a link that that has been previously visited."), new DesignerActionHeaderItem("Behaviour"), new DesignerActionPropertyItem("LinkBehaviour", "LinkBehaviour", "Behaviour", "Gets or sets a value that represents the behavior of a link."), new DesignerActionPropertyItem("Links", "Links", "Behaviour", "Gets the collection of links contained within the LinkLabel.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetListBoxActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Child; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { internal class MetroSetListBoxActionList : DesignerActionList { private readonly MetroSetListBox _metroSetListBox; public MetroSetListBoxActionList(IComponent component) : base(component) { _metroSetListBox = (MetroSetListBox)component; } public Style Style { get => _metroSetListBox.Style; set => _metroSetListBox.Style = value; } public string ThemeAuthor => _metroSetListBox.ThemeAuthor; public string ThemeName => _metroSetListBox.ThemeName; public StyleManager StyleManager { get => _metroSetListBox.StyleManager; set => _metroSetListBox.StyleManager = value; } [TypeConverter(typeof(CollectionConverter))] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing")] public MetroSetItemCollection Items => _metroSetListBox.Items; public int ItemHeight { get => _metroSetListBox.ItemHeight; set => _metroSetListBox.ItemHeight = value; } public bool MultiSelect { get => _metroSetListBox.MultiSelect; set => _metroSetListBox.MultiSelect = value; } public bool ShowScrollBar { get => _metroSetListBox.ShowScrollBar; set => _metroSetListBox.ShowScrollBar = value; } public bool ShowBorder { get => _metroSetListBox.ShowBorder; set => _metroSetListBox.ShowBorder = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Items", "Items", "Appearance", "Gets the items of the ListBox."), new DesignerActionPropertyItem("ItemHeight", "ItemHeight", "Appearance", "Gets or sets the height of an item in the ListBox."), new DesignerActionPropertyItem("MultiSelect", "MultiSelect", "Appearance", "Gets or sets a value indicating whether the ListBox supports multiple rows."), new DesignerActionPropertyItem("ShowScrollBar", "ShowScrollBar", "Appearance", "Gets or sets a value indicating whether the vertical scroll bar is shown or not."), new DesignerActionPropertyItem("ShowBorder", "ShowBorder", "Appearance", "Gets or sets a value indicating whether the border shown or not."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetNumericActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { internal class MetroSetNumericActionList : DesignerActionList { private readonly MetroSetNumeric _metroSetNumeric; public MetroSetNumericActionList(IComponent component) : base(component) { _metroSetNumeric = (MetroSetNumeric)component; } public Style Style { get => _metroSetNumeric.Style; set => _metroSetNumeric.Style = value; } public string ThemeAuthor => _metroSetNumeric.ThemeAuthor; public string ThemeName => _metroSetNumeric.ThemeName; public StyleManager StyleManager { get => _metroSetNumeric.StyleManager; set => _metroSetNumeric.StyleManager = value; } public int Maximum { get => _metroSetNumeric.Maximum; set => _metroSetNumeric.Maximum = value; } public int Minimum { get => _metroSetNumeric.Minimum; set => _metroSetNumeric.Minimum = value; } public int Value { get => _metroSetNumeric.Value; set => _metroSetNumeric.Value = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Value", "Value", "Appearance", "Gets or sets the current number of the Numeric."), new DesignerActionPropertyItem("Minimum", "Minimum", "Appearance", "Gets or sets the minimum number of the Numeric."), new DesignerActionPropertyItem("Maximum", "Maximum", "Appearance", "Gets or sets the maximum number of the Numeric."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetProgressBarActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetProgressBarActionList : DesignerActionList { private readonly MetroSetProgressBar _metroSetProgressBar; public MetroSetProgressBarActionList(IComponent component) : base(component) { _metroSetProgressBar = (MetroSetProgressBar)component; } public Style Style { get => _metroSetProgressBar.Style; set => _metroSetProgressBar.Style = value; } public string ThemeAuthor => _metroSetProgressBar.ThemeAuthor; public string ThemeName => _metroSetProgressBar.ThemeName; public StyleManager StyleManager { get => _metroSetProgressBar.StyleManager; set => _metroSetProgressBar.StyleManager = value; } public int Value { get => _metroSetProgressBar.Value; set => _metroSetProgressBar.Value = value; } public int Maximum { get => _metroSetProgressBar.Maximum; set => _metroSetProgressBar.Maximum = value; } public int Minimum { get => _metroSetProgressBar.Minimum; set => _metroSetProgressBar.Minimum = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Minimum", "Minimum", "Appearance", "Gets or sets the minimum value of the progressbar."), new DesignerActionPropertyItem("Maximum", "Maximum", "Appearance", "Gets or sets the maximum value of the progressbar."), new DesignerActionPropertyItem("Value", "Value", "Appearance", "Gets or sets the current position of the progressbar."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetRadiobuttonActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetCheckBoxActionList : DesignerActionList { private readonly MetroSetCheckBox _metroSetCheckBox; public MetroSetCheckBoxActionList(IComponent component) : base(component) { _metroSetCheckBox = (MetroSetCheckBox)component; } public Style Style { get => _metroSetCheckBox.Style; set => _metroSetCheckBox.Style = value; } public string ThemeAuthor => _metroSetCheckBox.ThemeAuthor; public string ThemeName => _metroSetCheckBox.ThemeName; public StyleManager StyleManager { get => _metroSetCheckBox.StyleManager; set => _metroSetCheckBox.StyleManager = value; } public string Text { get => _metroSetCheckBox.Text; set => _metroSetCheckBox.Text = value; } public bool Checked { get => _metroSetCheckBox.Checked; set => _metroSetCheckBox.Checked = value; } public SignStyle SignStyle { get => _metroSetCheckBox.SignStyle; set => _metroSetCheckBox.SignStyle = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Checked", "Checked", "Appearance", "Gets or sets a value indicating whether the control is checked."), new DesignerActionPropertyItem("SignStyle", "SignStyle", "Appearance", "Gets or sets the the sign style of check.") }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetRichTextBoxActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetRichTextBoxActionList : DesignerActionList { private readonly MetroSetRichTextBox _metroSetRichTextBox; public MetroSetRichTextBoxActionList(IComponent component) : base(component) { _metroSetRichTextBox = (MetroSetRichTextBox)component; } public Style Style { get => _metroSetRichTextBox.Style; set => _metroSetRichTextBox.Style = value; } public string ThemeAuthor => _metroSetRichTextBox.ThemeAuthor; public string ThemeName => _metroSetRichTextBox.ThemeName; public StyleManager StyleManager { get => _metroSetRichTextBox.StyleManager; set => _metroSetRichTextBox.StyleManager = value; } public string Text { get => _metroSetRichTextBox.Text; set => _metroSetRichTextBox.Text = value; } public Font Font { get => _metroSetRichTextBox.Font; set => _metroSetRichTextBox.Font = value; } public bool ReadOnly { get => _metroSetRichTextBox.ReadOnly; set => _metroSetRichTextBox.ReadOnly = value; } public ContextMenuStrip ContextMenuStrip { get => _metroSetRichTextBox.ContextMenuStrip; set => _metroSetRichTextBox.ContextMenuStrip = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionPropertyItem("ReadOnly", "ReadOnly", "Appearance", "Gets or sets a value indicating whether text in the rich text box is read-only."), new DesignerActionPropertyItem("ContextMenuStrip", "ContextMenuStrip", "Appearance", "Gets or sets the ContextMenuStrip associated with this control."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetScrollBarActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { class MetroSetScrollBarActionList : DesignerActionList { private readonly MetroSetScrollBar _metroSetScrollBar; public MetroSetScrollBarActionList(IComponent component) : base(component) { _metroSetScrollBar = (MetroSetScrollBar)component; } public Style Style { get => _metroSetScrollBar.Style; set => _metroSetScrollBar.Style = value; } public string ThemeAuthor => _metroSetScrollBar.ThemeAuthor; public string ThemeName => _metroSetScrollBar.ThemeName; public StyleManager StyleManager { get => _metroSetScrollBar.StyleManager; set => _metroSetScrollBar.StyleManager = value; } public int Maximum { get => _metroSetScrollBar.Maximum; set => _metroSetScrollBar.Maximum = value; } public int Minimum { get => _metroSetScrollBar.Minimum; set => _metroSetScrollBar.Minimum = value; } public int Value { get => _metroSetScrollBar.Value; set => _metroSetScrollBar.Value = value; } public int SmallChange { get => _metroSetScrollBar.SmallChange; set => _metroSetScrollBar.SmallChange = value; } public int LargeChange { get => _metroSetScrollBar.LargeChange; set => _metroSetScrollBar.LargeChange = value; } public ScrollOrientate Orientation { get => _metroSetScrollBar.Orientation; set => _metroSetScrollBar.Orientation = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Orientation", "Orientation", "Appearance", "Gets or sets the scroll bar orientation."), new DesignerActionHeaderItem("Behavior"), new DesignerActionPropertyItem("Maximum", "Maximum", "Behavior", "Gets or sets the upper limit of the scrollable range."), new DesignerActionPropertyItem("Minimum", "Minimum", "Behavior", "Gets or sets the lower limit of the scrollable range."), new DesignerActionPropertyItem("Value", "Value", "Behavior", "Gets or sets a numeric value that represents the current position of the scroll bar box."), new DesignerActionPropertyItem("LargeChange", "LargeChange", "Behavior", "Gets or sets the distance to move a scroll bar in response to a large scroll command."), new DesignerActionPropertyItem("SmallChange", "SmallChange", "Behavior", "Gets or sets the distance to move a scroll bar in response to a small scroll command."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetSwitchActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetSwitchActionList : DesignerActionList { private readonly MetroSetSwitch _metroSetSwitch; public MetroSetSwitchActionList(IComponent component) : base(component) { _metroSetSwitch = (MetroSetSwitch)component; } public Style Style { get => _metroSetSwitch.Style; set => _metroSetSwitch.Style = value; } public string ThemeAuthor => _metroSetSwitch.ThemeAuthor; public string ThemeName => _metroSetSwitch.ThemeName; public StyleManager StyleManager { get => _metroSetSwitch.StyleManager; set => _metroSetSwitch.StyleManager = value; } public string Text { get => _metroSetSwitch.Text; set => _metroSetSwitch.Text = value; } public bool Switched { get => _metroSetSwitch.Switched; set => _metroSetSwitch.Switched = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Switched", "Switched", "Appearance", "Gets or sets a value indicating whether the control is switched."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetTextBoxActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetTextBoxActionList : DesignerActionList { private readonly MetroSetTextBox _metroSetTextBox; public MetroSetTextBoxActionList(IComponent component) : base(component) { _metroSetTextBox = (MetroSetTextBox)component; } public Style Style { get => _metroSetTextBox.Style; set => _metroSetTextBox.Style = value; } public string ThemeAuthor => _metroSetTextBox.ThemeAuthor; public string ThemeName => _metroSetTextBox.ThemeName; public StyleManager StyleManager { get => _metroSetTextBox.StyleManager; set => _metroSetTextBox.StyleManager = value; } public string Text { get => _metroSetTextBox.Text; set => _metroSetTextBox.Text = value; } public Font Font { get => _metroSetTextBox.Font; set => _metroSetTextBox.Font = value; } public bool ReadOnly { get => _metroSetTextBox.ReadOnly; set => _metroSetTextBox.ReadOnly = value; } public bool UseSystemPasswordChar { get => _metroSetTextBox.UseSystemPasswordChar; set => _metroSetTextBox.UseSystemPasswordChar = value; } public bool Multiline { get => _metroSetTextBox.Multiline; set => _metroSetTextBox.Multiline = value; } public string WatermarkText { get => _metroSetTextBox.WatermarkText; set => _metroSetTextBox.WatermarkText = value; } public ContextMenuStrip ContextMenuStrip { get => _metroSetTextBox.ContextMenuStrip; set => _metroSetTextBox.ContextMenuStrip = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionPropertyItem("ReadOnly", "ReadOnly", "Appearance", "Gets or sets a value indicating whether text in the text box is read-only."), new DesignerActionPropertyItem("UseSystemPasswordChar", "UseSystemPasswordChar", "Appearance", "Gets or sets a value indicating whether the text in the TextBox control should appear as the default password character."), new DesignerActionPropertyItem("Multiline", "Multiline", "Appearance", "Gets or sets a value indicating whether this is a multiline TextBox control."), new DesignerActionPropertyItem("WatermarkText", "WatermarkText", "Appearance", "Gets or sets the text in the TextBox while being empty."), new DesignerActionPropertyItem("ContextMenuStrip", "ContextMenuStrip", "Appearance", "Gets or sets the ContextMenuStrip associated with this control."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetTileActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetTileActionList : DesignerActionList { private readonly MetroSetTile _metroSetTile; public MetroSetTileActionList(IComponent component) : base(component) { _metroSetTile = (MetroSetTile)component; } public Style Style { get => _metroSetTile.Style; set => _metroSetTile.Style = value; } public string ThemeAuthor => _metroSetTile.ThemeAuthor; public string ThemeName => _metroSetTile.ThemeName; public StyleManager StyleManager { get => _metroSetTile.StyleManager; set => _metroSetTile.StyleManager = value; } public string Text { get => _metroSetTile.Text; set => _metroSetTile.Text = value; } public Font Font { get => _metroSetTile.Font; set => _metroSetTile.Font = value; } public Image BackgroundImage { get => _metroSetTile.BackgroundImage; set => _metroSetTile.BackgroundImage = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Text", "Text", "Appearance", "Gets or sets the The text associated with the control."), new DesignerActionPropertyItem("Font", "Font", "Appearance", "Gets or sets the The font associated with the control."), new DesignerActionPropertyItem("BackgroundImage", "BackgroundImage", "Appearance", "Gets or sets the BackgroundImage associated with the control."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetToolTipActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { internal class MetroSetToolTipActionList : DesignerActionList { private readonly MetroSetSetToolTip _metroSetSetToolTip; public MetroSetToolTipActionList(IComponent component) : base(component) { _metroSetSetToolTip = (MetroSetSetToolTip)component; } public Style Style { get => _metroSetSetToolTip.Style; set => _metroSetSetToolTip.Style = value; } public string ThemeAuthor => _metroSetSetToolTip.ThemeAuthor; public string ThemeName => _metroSetSetToolTip.ThemeName; public StyleManager StyleManager { get => _metroSetSetToolTip.StyleManager; set => _metroSetSetToolTip.StyleManager = value; } public bool Active { get => _metroSetSetToolTip.Active; set => _metroSetSetToolTip.Active = value; } public int AutomaticDelay { get => _metroSetSetToolTip.AutomaticDelay; set => _metroSetSetToolTip.AutomaticDelay = value; } public int AutoPopDelay { get => _metroSetSetToolTip.AutoPopDelay; set => _metroSetSetToolTip.AutoPopDelay = value; } public int InitialDelay { get => _metroSetSetToolTip.InitialDelay; set => _metroSetSetToolTip.InitialDelay = value; } public bool StripAmpersands { get => _metroSetSetToolTip.StripAmpersands; set => _metroSetSetToolTip.StripAmpersands = value; } public bool UseAnimation { get => _metroSetSetToolTip.UseAnimation; set => _metroSetSetToolTip.UseAnimation = value; } public bool UseFading { get => _metroSetSetToolTip.UseFading; set => _metroSetSetToolTip.UseFading = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Misc"), new DesignerActionPropertyItem("Active", "Active", "Misc", "Gets or sets a value indicating whether the ToolTip is currently active."), new DesignerActionPropertyItem("AutomaticDelay", "AutomaticDelay", "Misc", "Gets or sets the automatic delay for the ToolTip."), new DesignerActionPropertyItem("AutoPopDelay", "AutoPopDelay", "Misc", "Gets or sets the period of time the ToolTip remains visible if the pointer is stationary on a control with specified ToolTip text."), new DesignerActionPropertyItem("InitialDelay", "InitialDelay", "Misc", "Gets or sets the time that passes before the ToolTip appears."), new DesignerActionPropertyItem("StripAmpersands", "StripAmpersands", "Misc", "Gets or sets a value that determines how ampersand (&) characters are treated."), new DesignerActionPropertyItem("UseAnimation", "UseAnimation", "Misc", "Gets or sets a value determining whether an animation effect should be used when displaying the ToolTip."), new DesignerActionPropertyItem("UseFading", "UseFading", "Appearance", "Gets or sets a value determining whether a fade effect should be used when displaying the ToolTip."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/MetroSetTrackBarActionList.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.ComponentModel.Design; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; namespace MetroSet_UI.Actions { public class MetroSetTrackBarActionList : DesignerActionList { private readonly MetroSetTrackBar _metroSetTrackBar; public MetroSetTrackBarActionList(IComponent component) : base(component) { _metroSetTrackBar = (MetroSetTrackBar)component; } public Style Style { get => _metroSetTrackBar.Style; set => _metroSetTrackBar.Style = value; } public string ThemeAuthor => _metroSetTrackBar.ThemeAuthor; public string ThemeName => _metroSetTrackBar.ThemeName; public StyleManager StyleManager { get => _metroSetTrackBar.StyleManager; set => _metroSetTrackBar.StyleManager = value; } public int Maximum { get => _metroSetTrackBar.Maximum; set => _metroSetTrackBar.Maximum = value; } public int Minimum { get => _metroSetTrackBar.Minimum; set => _metroSetTrackBar.Minimum = value; } public int Value { get => _metroSetTrackBar.Value; set => _metroSetTrackBar.Value = value; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("StyleManager", "StyleManager", "MetroSet Framework", "Gets or sets the stylemanager for the control."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionHeaderItem("Informations"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Informations", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Informations", "Gets or sets the The Author name associated with the theme."), new DesignerActionHeaderItem("Appearance"), new DesignerActionPropertyItem("Maximum", "Maximum", "Appearance", "Gets or sets the upper limit of the range this TrackBar is working with."), new DesignerActionPropertyItem("Minimum", "Minimum", "Appearance", "Gets or sets the lower limit of the range this TrackBar is working with."), new DesignerActionPropertyItem("Value", "Value", "Appearance", "Gets or sets a numeric value that represents the current position of the scroll box on the track bar."), }; return items; } } } ================================================ FILE: MetroSet UI/Actions/StyleManagerActionList.cs ================================================ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing.Design; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Enums; /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Actions { class StyleManagerActionList : DesignerActionList { private readonly StyleManager _styleManger; public StyleManagerActionList(IComponent component) : base(component) { _styleManger = (StyleManager)component; } public Style Style { get => _styleManger.Style; set => _styleManger.Style = value; } public string ThemeAuthor => _styleManger.ThemeAuthor; public string ThemeName => _styleManger.ThemeName; [Editor(typeof(StyleManager.FileNamesEditor), typeof(UITypeEditor)), Category("MetroSet Framework"), Description("Gets or sets the custom theme file.")] public string CustomTheme { get => _styleManger.CustomTheme; set => _styleManger.CustomTheme = value; } public Form OwnerForm { get => _styleManger.MetroForm; set => _styleManger.MetroForm = value; } public override DesignerActionItemCollection GetSortedActionItems() { var items = new DesignerActionItemCollection { new DesignerActionHeaderItem("MetroSet Framework"), new DesignerActionPropertyItem("OwnerForm", "OwnerForm", "MetroSet Framework", "Gets or sets the form (MetroForm) to Apply themes for."), new DesignerActionPropertyItem("Style", "Style", "MetroSet Framework", "Gets or sets the style."), new DesignerActionPropertyItem("CustomTheme", "CustomTheme", "MetroSet Framework", "Gets or sets the custom theme file."), new DesignerActionHeaderItem("Information"), new DesignerActionPropertyItem("ThemeName", "ThemeName", "Information", "Gets or sets the The Theme name associated with the theme."), new DesignerActionPropertyItem("ThemeAuthor", "ThemeAuthor", "Information", "Gets or sets the The Author name associated with the theme."), }; return items; } } } ================================================ FILE: MetroSet UI/Animates/Animate.cs ================================================ using System; using System.Windows.Forms; using MetroSet_UI.Enums; namespace MetroSet_UI.Animates { // interpolation animate public abstract class Animate : IDisposable { /// /// Call when animation update /// public Action Update { get; set; } /// /// Call when animation complate /// public MethodInvoker Complete { get; set; } #region Internal Vars // a bad way to record time... private DateTime _lastUpdateTime; // I use timer instead of thread, so you can modify control without Control.Invoke private Timer _animateTimer; // reverse animate private bool _reverse; #endregion #region Constructors // choose best interval for yourself public Animate(int updateInterval = 16) { _animateTimer = new Timer() { Interval = updateInterval, Enabled = false, }; _animateTimer.Tick += this.OnFrameUpdate; _reverse = false; Alpha = 0.0; } #endregion #region Functions // just set once, and use start, back or reverse to play animate public void Setting(int duration, T initial, T end, EasingType easing = EasingType.Linear) { InitialValue = initial; EndValue = end; EasingType = easing; Duration = duration; } // start animate with default setting public void Start() { _reverse = false; Alpha = 0.0; Play(); } // back animate with default setting public void Back() { _reverse = true; Alpha = 1.0; Play(); } // start animate with default setting public void Start(int duration) { _reverse = false; Alpha = 0.0; Duration = duration; Play(); } // back animate with default setting public void Back(int duration) { _reverse = true; Alpha = 1.0; Duration = duration; Play(); } // reverse animate public void Reverse() { Reverse(!_reverse); } // reverse animate public void Reverse(bool val) { _reverse = val; if (!Active) Play(); } // play animate public void Play() { _lastUpdateTime = DateTime.Now; Active = true; _animateTimer.Enabled = true; _animateTimer.Start(); } public void Pause() { _animateTimer.Stop(); _animateTimer.Enabled = false; Active = false; } public void Stop() { Pause(); Alpha = _reverse ? 1.0 : 0.0; } // start animate with specific setting public void Start(int duration, T initial, T end, EasingType easing = EasingType.Linear) { Setting(duration, initial, end, easing); Start(); } // back animate with specific setting public void Back(int duration, T initial, T end, EasingType easing = EasingType.Linear) { Setting(duration, initial, end, easing); Back(); } #endregion #region Events // process frame private void OnFrameUpdate(object sender, EventArgs e) { DateTime updateTime = DateTime.Now; double elapsed; if (Duration == 0) elapsed = 1.0; else elapsed = (updateTime - _lastUpdateTime).TotalMilliseconds / Duration; _lastUpdateTime = updateTime; Alpha = Math.Max(0.0, Math.Min(Alpha + (_reverse ? -elapsed : elapsed), 1.0)); Update?.Invoke(Value); if (Alpha != 0.0 && Alpha != 1.0) return; Pause(); Complete?.Invoke(); } #endregion #region Properties // progress. value between 0 and 1 public double Alpha { get; set; } // animate duration // recorded for calculating elapsed alpha // if you use reverse animate when animate avtiving // the real duration will different with the duration you set public int Duration { get; set; } // initial state of value public T InitialValue { get; private set; } public abstract T Value { get; } // final state of value public T EndValue { get; private set; } // easing type public EasingType EasingType { get; private set; } // active if the animate is running public bool Active { get; private set; } // store you own variable here public object Tag { get; set; } #endregion #region Dispose public void Dispose() { _animateTimer.Dispose(); } #endregion } } ================================================ FILE: MetroSet UI/Animates/ColorAnimate.cs ================================================ using System.Drawing; namespace MetroSet_UI.Animates { public class ColorAnimate : Animate { public override Color Value => Color.FromArgb( (byte)Interpolation.ValueAt(InitialValue.A, EndValue.A, Alpha, EasingType), (byte)Interpolation.ValueAt(InitialValue.R, EndValue.R, Alpha, EasingType), (byte)Interpolation.ValueAt(InitialValue.G, EndValue.G, Alpha, EasingType), (byte)Interpolation.ValueAt(InitialValue.B, EndValue.B, Alpha, EasingType) ); } } ================================================ FILE: MetroSet UI/Animates/DoubleAnimat.cs ================================================ namespace MetroSet_UI.Animates { public class DoubleAnimate : Animate { public override double Value => Interpolation.ValueAt(InitialValue, EndValue, Alpha, EasingType); } } ================================================ FILE: MetroSet UI/Animates/IntAnimate.cs ================================================ namespace MetroSet_UI.Animates { public class IntAnimate : Animate { public override int Value => (int)Interpolation.ValueAt(InitialValue, EndValue, Alpha, EasingType); } } ================================================ FILE: MetroSet UI/Animates/Interpolation.cs ================================================ using System; using MetroSet_UI.Enums; namespace MetroSet_UI.Animates { // for animate public class Interpolation { public static double ValueAt(double initial, double end, double alpha, EasingType easing) { switch (easing) { default: return (end * alpha) + (initial * (1 - alpha)); case EasingType.QuadIn: { double factor = alpha * alpha; return (end * factor) + (initial * (1 - factor)); } case EasingType.QuadOut: { double factor = (2 - alpha) * alpha; return (end * factor) + (initial * (1 - factor)); } case EasingType.QuadInOut: { double mid = initial + (end - initial) / 2.0; if (alpha <= 0.5) return ValueAt(initial, mid, alpha * 2, EasingType.QuadIn); else return ValueAt(mid, end, (alpha - 0.5) * 2, EasingType.QuadOut); } case EasingType.CubeIn: { double factor = alpha * alpha * alpha; return (end * factor) + (initial * (1 - factor)); } case EasingType.CubeOut: { double factor = -(alpha - 1); factor = -(factor * factor * factor) + 1; return (end * factor) + (initial * (1 - factor)); } case EasingType.CubeInOut: { double mid = initial + (end - initial) / 2.0; if (alpha <= 0.5) return ValueAt(initial, mid, alpha * 2, EasingType.CubeIn); else return ValueAt(mid, end, (alpha - 0.5) * 2, EasingType.CubeOut); } case EasingType.QuartIn: { double factor = alpha * alpha * alpha * alpha; return (end * factor) + (initial * (1 - factor)); } case EasingType.QuartOut: { double factor = -(alpha - 1); factor = 1 - (factor * factor * factor * factor); return (end * factor) + (initial * (1 - factor)); } case EasingType.QuartInOut: { double mid = initial + (end - initial) / 2.0; if (alpha <= 0.5) return ValueAt(initial, mid, alpha * 2, EasingType.QuartIn); else return ValueAt(mid, end, (alpha - 0.5) * 2, EasingType.QuartOut); } case EasingType.QuintIn: { double factor = alpha * alpha * alpha * alpha * alpha; return (end * factor) + (initial * (1 - factor)); } case EasingType.QuintOut: { double factor = -(alpha - 1); factor = 1 - (factor * factor * factor * factor * factor); return (end * factor) + (initial * (1 - factor)); } case EasingType.QuintInOut: { double mid = initial + (end - initial) / 2.0; if (alpha <= 0.5) return ValueAt(initial, mid, alpha / 0.5, EasingType.QuintIn); else return ValueAt(mid, end, (alpha - 0.5) / 0.5, EasingType.QuintOut); } case EasingType.SineIn: { double factor = 1 - Math.Cos(Math.PI / 2 * alpha); return (end * factor) + (initial * (1 - factor)); } case EasingType.SineOut: { double factor = Math.Sin(Math.PI / 2 * alpha); return (end * factor) + (initial * (1 - factor)); } case EasingType.SineInOut: { if (alpha <= 0.5) return ValueAt(initial, (initial + end) / 2.0, alpha * 2, EasingType.SineIn); else return ValueAt((initial + end) / 2.0, end, (alpha - 0.5) * 2, EasingType.SineOut); } } } } } ================================================ FILE: MetroSet UI/Animates/PointFAnimate.cs ================================================ using System.Drawing; namespace MetroSet_UI.Animates { public class PointFAnimate : Animate { public override PointF Value => new PointF( (float)Interpolation.ValueAt(InitialValue.X, EndValue.X, Alpha, EasingType), (float)Interpolation.ValueAt(InitialValue.Y, EndValue.Y, Alpha, EasingType) ); } } ================================================ FILE: MetroSet UI/Animates/SizeFAnimate.cs ================================================ using System.Drawing; namespace MetroSet_UI.Animates { public class SizeFAnimate : Animate { public override SizeF Value => new SizeF( (float)Interpolation.ValueAt(InitialValue.Width, EndValue.Width, Alpha, EasingType), (float)Interpolation.ValueAt(InitialValue.Height, EndValue.Height, Alpha, EasingType) ); } } ================================================ FILE: MetroSet UI/Child/MetroSetItemCollection.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace MetroSet_UI.Child { public class MetroSetItemCollection : Collection { /// /// An event for to determine whether and item or items added or removed. /// public event EventHandler ItemUpdated; public delegate void EventHandler(object sender, EventArgs e); /// /// Adds an array of items to the list of items for a MetroSetListBox. /// /// An IEnumerable of objects to add to the list. public void AddRange(IEnumerable items) { foreach (var item in items) { Add(item); } } /// /// Adds an item to the list of items for a MetroSetListBox. /// /// An object representing the item to add to the collection. protected new void Add(object item) { base.Add(item); ItemUpdated?.Invoke(this, null); } /// /// Inserts an item into the list box at the specified index. /// /// The zero-based index location where the item is inserted. /// An object representing the item to insert. protected override void InsertItem(int index, object item) { base.InsertItem(index, item); ItemUpdated?.Invoke(this, null); } /// /// Removes the specified object from the collection. /// /// An object representing the item to remove from the collection. protected override void RemoveItem(int value) { base.RemoveItem(value); ItemUpdated?.Invoke(this, null); } /// /// Removes all items from the collection. /// protected new void Clear() { base.Clear(); ItemUpdated?.Invoke(this, null); } /// /// Removes all items from the collection. /// protected override void ClearItems() { base.ClearItems(); ItemUpdated?.Invoke(this, null); } } } ================================================ FILE: MetroSet UI/Child/MetroSetSetTabPage.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Child { [Designer(typeof(MetroSetTabPageDesigner))] public class MetroSetSetTabPage : TabPage, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Browsable(false)] [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Browsable(false)] [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Internal Vars private Style _style; private StyleManager _styleManager; #endregion Internal Vars #region Constructors public MetroSetSetTabPage() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); base.Font = MetroSetFonts.Light(10); UpdateStyles(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: BaseColor = Color.White; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: BaseColor = Color.FromArgb(32, 32, 32); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; } } /// /// Updating properties after changing in style. /// public void UpdateProperties() { Invalidate(); } #endregion ApplyTheme #region Properties [Browsable(false)] public new Color BackColor { get; set; } = Color.Transparent; // I don't want to re-create the following properties for specific reason but for helping // the users to find usage properties easily under MetroSet Framework category in property grid. [Category("MetroSet Framework")] public override string Text { get; set; } [Category("MetroSet Framework")] public new Font Font { get; set; } [Category("MetroSet Framework")] public new int ImageIndex { get; set; } [Category("MetroSet Framework")] public new string ImageKey { get; set; } [Category("MetroSet Framework")] public new string ToolTipText { get; set; } [Category("MetroSet Framework")] [Bindable(false)] public Color BaseColor { get; set; } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent form style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region DrawControl protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; using (var bg = new SolidBrush(BaseColor)) { g.FillRectangle(bg, ClientRectangle); } } #endregion } } ================================================ FILE: MetroSet UI/Child/MetroSetTabPageCollectionEditor.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel.Design; using System.Windows.Forms; namespace MetroSet_UI.Child { /// /// I provided this class to make the MetroSetTabControl add or remove MetroSetSetTabPage instead of normal TabPage provided by Microsoft. /// internal class MetroSetTabPageCollectionEditor : CollectionEditor { public MetroSetTabPageCollectionEditor(Type type) : base(type) { } protected override Type[] CreateNewItemTypes() { return new[] { typeof(TabPage), typeof(MetroSetSetTabPage) }; } } } ================================================ FILE: MetroSet UI/Child/MetroSetToolStripMenuItem.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Controls; namespace MetroSet_UI.Child { public sealed class MetroSetToolStripMenuItem : ToolStripMenuItem { #region Constructors public MetroSetToolStripMenuItem() { AutoSize = false; Size = new Size(160, 30); } #endregion Constructors #region Adding DropDowns protected override ToolStripDropDown CreateDefaultDropDown() { if (DesignMode) { return base.CreateDefaultDropDown(); } var dp = new MetroSetContextMenuStrip(); dp.Items.AddRange(base.CreateDefaultDropDown().Items); return dp; } #endregion Adding DropDowns } } ================================================ FILE: MetroSet UI/Components/MetroSetSetToolTip.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Windows.Forms; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Components { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetSetToolTip), "Bitmaps.ToolTip.bmp")] [Designer(typeof(MetroSetToolTipDesigner))] [DefaultEvent("Popup")] public class MetroSetSetToolTip : ToolTip, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set => _styleManager = value; } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private StyleManager _styleManager; private Style _style; #endregion Internal Vars #region Constructors public MetroSetSetToolTip() { OwnerDraw = true; Draw += OnDraw; Popup += ToolTip_Popup; _mth = new Methods(); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region Draw Control private void OnDraw(object sender, DrawToolTipEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; var rect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height - 1); using (var bg = new SolidBrush(BackColor)) using (var stroke = new Pen(BorderColor)) using (var tb = new SolidBrush(ForeColor)) { g.FillRectangle(bg, rect); g.DrawString(e.ToolTipText, MetroSetFonts.Light(11), tb, rect, _mth.SetPosition()); g.DrawRectangle(stroke, rect); } } #endregion #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(170, 170, 170); BackColor = Color.White; BorderColor = Color.FromArgb(204, 204, 204); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: ForeColor = Color.FromArgb(204, 204, 204); BackColor = Color.FromArgb(32, 32, 32); BorderColor = Color.FromArgb(64, 64, 64); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ToolTipDictionary) { switch (varkey.Key) { case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion ApplyTheme #region Properties /// /// Gets or sets a value indicating whether a ToolTip window is displayed, even when its parent control is not active. /// [Browsable(false)] public new bool ShowAlways { get; } = false; /// /// Gets or sets a value indicating whether the ToolTip is drawn by the operating system or by code that you provide. /// [Browsable(false)] public new bool OwnerDraw { get => base.OwnerDraw; set { base.OwnerDraw = true; } } /// /// Gets or sets a value indicating whether the ToolTip should use a balloon window. /// [Browsable(false)] public new bool IsBalloon { get; } = false; /// /// Gets or sets the background color for the ToolTip. /// [Browsable(false)] public new Color BackColor { get; set; } /// /// Gets or sets the foreground color for the ToolTip. /// [Category("MetroSet Framework"), Description("Gets or sets the foreground color for the ToolTip.")] public new Color ForeColor { get; set; } /// /// Gets or sets a title for the ToolTip window. /// [Category("MetroSet Framework"), Description("Gets or sets a title for the ToolTip window.")] public new string ToolTipTitle { get; } = string.Empty; /// /// Defines a set of standardized icons that can be associated with a ToolTip. /// [Browsable(false)] public new ToolTipIcon ToolTipIcon { get; } = ToolTipIcon.None; /// /// Gets or sets the border color for the ToolTip. /// [Category("MetroSet Framework"), Description("Gets or sets the border color for the ToolTip.")] public Color BorderColor { get; set; } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; } } #endregion #region Methods /// /// The ToolTip text to display when the pointer is on the control. /// /// The Control to show the tooltip. /// The Text that appears in tooltip. public new void SetToolTip(Control control, string caption) { //This Method is useful at runtime. base.SetToolTip(control, caption); foreach (Control c in control.Controls) { SetToolTip(c, caption); } } #endregion #region Events /// /// Here we handle popup event and we set the style of controls for tooltip. /// /// /// private void ToolTip_Popup(object sender, PopupEventArgs e) { var control = e.AssociatedControl; if (control is IMetroSetControl iControl) { Style = iControl.Style; ThemeAuthor = iControl.ThemeAuthor; ThemeName = iControl.ThemeName; StyleManager = iControl.StyleManager; } else if (control is IMetroForm) { Style = ((IMetroForm)control).Style; ThemeAuthor = ((IMetroForm)control).ThemeAuthor; ThemeName = ((IMetroForm)control).ThemeName; StyleManager = ((IMetroForm)control).StyleManager; } e.ToolTipSize = new Size(e.ToolTipSize.Width + 30, e.ToolTipSize.Height + 6); } #endregion } } ================================================ FILE: MetroSet UI/Components/StyleManager.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.IO; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Xml; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Components { [DefaultProperty("Style")] [Designer(typeof(StyleManagerDesigner))] [ToolboxItem(true)] [ToolboxBitmap(typeof(StyleManager), "Style.bmp")] public class StyleManager : Component { private readonly Form _ownerForm; #region Constructor public StyleManager() { _style = Style.Light; if (_customTheme == null) { var themeFile = Properties.Settings.Default.ThemeFile; _customTheme = File.Exists(themeFile) ? themeFile : ThemeFilePath(themeFile); } InitializeDictionaries(); } #endregion #region Methods /// /// The Method to update the form with the style manager style and it's controls. /// private void UpdateForm() { switch (MetroForm) { case IMetroForm form: form.Style = Style; form.ThemeAuthor = ThemeAuthor; form.ThemeName = ThemeName; form.StyleManager = this; form.StyleManager.MetroForm = _ownerForm; break; } if (MetroForm.Controls.Count > 0) UpdateControls(MetroForm.Controls); MetroForm.Invalidate(); } /// /// The Method to update controls with the style manager style. /// private void UpdateControls(Control.ControlCollection controls) { foreach (Control ctrl in controls) { var control = ctrl as IMetroSetControl; if (control != null && CustomTheme != null) { control.Style = Style; control.ThemeAuthor = ThemeAuthor; control.ThemeName = ThemeName; control.StyleManager = this; } if (control is TabControl tabControl) { foreach (TabPage c in tabControl.TabPages) { if (c is IMetroSetControl) { control.Style = Style; control.StyleManager = this; control.ThemeAuthor = ThemeAuthor; control.ThemeName = ThemeName; } UpdateControls(c.Controls); } } foreach (Control child in ctrl.Controls) { if (!(child is IMetroSetControl)) continue; ((IMetroSetControl)child).Style = Style; ((IMetroSetControl)child).StyleManager = this; ((IMetroSetControl)child).ThemeAuthor = ThemeAuthor; ((IMetroSetControl)child).ThemeName = ThemeName; } } } /// /// The Method to apply the style manager style to the added controls. /// private void ControlAdded(object sender, ControlEventArgs e) { if (e.Control is IMetroSetControl control) { if (!control.IsDerivedStyle) return; control.Style = Style; control.ThemeAuthor = ThemeAuthor; control.ThemeName = ThemeName; control.StyleManager = this; } else { UpdateForm(); } } #endregion #region Internal Vars private Style _style; private Form _metroForm; private string _customTheme; #endregion Internal Vars #region Properties /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the form (MetroForm) to Apply themes for. /// [Category("MetroSet Framework"), Description("Gets or sets the form (MetroForm) to Apply themes for.")] public Form MetroForm { get => _metroForm; set { if (_metroForm != null) return; _metroForm = value; _metroForm.ControlAdded += ControlAdded; UpdateForm(); } } /// /// Gets or sets the style for the button. /// [Category("MetroSet Framework"), Description("Gets or sets the style.")] public Style Style { get => _style; set { _style = value; switch (value) { case Style.Light: ThemeAuthor = "Narwin"; ThemeName = "MetroLight"; break; case Style.Dark: ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; } UpdateForm(); } } /// /// Gets or sets the custom theme file controls. /// [Editor(typeof(FileNamesEditor), typeof(UITypeEditor)), Category("MetroSet Framework"), Description("Gets or sets the custom theme file.")] public string CustomTheme { get => _customTheme; set { if (Style == Style.Custom) { Properties.Settings.Default.ThemeFile = value; Properties.Settings.Default.Save(); ControlProperties(value); } _customTheme = value; } } #endregion Properties #region Open Theme /// /// The Method to execute the FileNamesEditor and open the dialog of importing the custom theme. /// public void OpenTheme() { Style = Style.Custom; using (var ofd = new OpenFileDialog { Filter = @"Xml File (*.xml)|*.xml" }) { if (ofd.ShowDialog() != DialogResult.OK) { return; } CustomTheme = ofd.FileName; } } /// /// The Method for setting the custom theme up. /// /// The Custom theme file path. public void SetTheme(string path) { Style = Style.Custom; CustomTheme = path; } /// /// The Method to write the them file from resources to templates folder. /// /// the theme content /// The Sorted theme path in templates folder. private string ThemeFilePath(string str) { var path = $"{Environment.GetFolderPath(Environment.SpecialFolder.Templates) + @"\ThemeFile.xml"}"; File.WriteAllText(path, str); return path; } #endregion Open Theme #region Dictionaries #region Declartions /// /// The Button properties from custom theme will be stored into this dictionary. /// public Dictionary ButtonDictionary; /// /// The DefaultButton properties from custom theme will be stored into this dictionary. /// public Dictionary DefaultButtonDictionary; /// /// The Label properties from custom theme will be stored into this dictionary. /// public Dictionary LabelDictionary; /// /// The LinkLabel properties from custom theme will be stored into this dictionary. /// public Dictionary LinkLabelDictionary; /// /// The TextBox properties from custom theme will be stored into this dictionary. /// public Dictionary TextBoxDictionary; /// /// The RichTextBox properties from custom theme will be stored into this dictionary. /// public Dictionary RichTextBoxDictionary; /// /// The ComboBox properties from custom theme will be stored into this dictionary. /// public Dictionary ComboBoxDictionary; /// /// The Form properties from custom theme will be stored into this dictionary. /// public Dictionary FormDictionary; /// /// The Badge properties from custom theme will be stored into this dictionary. /// public Dictionary BadgeDictionary; /// /// The Divider properties from custom theme will be stored into this dictionary. /// public Dictionary DividerDictionary; /// /// The CheckBox properties from custom theme will be stored into this dictionary. /// public Dictionary CheckBoxDictionary; /// /// The RadioButton properties from custom theme will be stored into this dictionary. /// public Dictionary RadioButtonDictionary; /// /// The Switch properties from custom theme will be stored into this dictionary. /// public Dictionary SwitchBoxDictionary; /// /// The ToolTip properties from custom theme will be stored into this dictionary. /// public Dictionary ToolTipDictionary; /// /// The ToolTip properties from custom theme will be stored into this dictionary. /// public Dictionary NumericDictionary; /// /// The ToolTip properties from custom theme will be stored into this dictionary. /// public Dictionary EllipseDictionary; /// /// The Tile properties from custom theme will be stored into this dictionary. /// public Dictionary TileDictionary; /// /// The Tile properties from custom theme will be stored into this dictionary. /// public Dictionary ProgressDictionary; /// /// The ControlBox properties from custom theme will be stored into this dictionary. /// public Dictionary ControlBoxDictionary; /// /// The TabControl properties from custom theme will be stored into this dictionary. /// public Dictionary TabControlDictionary; /// /// The ScrollBar properties from custom theme will be stored into this dictionary. /// public Dictionary ScrollBarDictionary; /// /// The Panel properties from custom theme will be stored into this dictionary. /// public Dictionary PanelDictionary; /// /// The TrackBar properties from custom theme will be stored into this dictionary. /// public Dictionary TrackBarDictionary; /// /// The ContextMenuStrip properties from custom theme will be stored into this dictionary. /// public Dictionary ContextMenuDictionary; /// /// The ListBox properties from custom theme will be stored into this dictionary. /// public Dictionary ListBoxDictionary; /// /// The ListBox properties from custom theme will be stored into this dictionary. /// public Dictionary DataGridDictionary; #endregion #region Methods private void Clear() { ButtonDictionary.Clear(); DefaultButtonDictionary.Clear(); FormDictionary.Clear(); LabelDictionary.Clear(); TextBoxDictionary.Clear(); LabelDictionary.Clear(); LinkLabelDictionary.Clear(); BadgeDictionary.Clear(); DividerDictionary.Clear(); CheckBoxDictionary.Clear(); RadioButtonDictionary.Clear(); SwitchBoxDictionary.Clear(); ToolTipDictionary.Clear(); RichTextBoxDictionary.Clear(); ComboBoxDictionary.Clear(); NumericDictionary.Clear(); EllipseDictionary.Clear(); TileDictionary.Clear(); ProgressDictionary.Clear(); ControlBoxDictionary.Clear(); TabControlDictionary.Clear(); ScrollBarDictionary.Clear(); PanelDictionary.Clear(); TrackBarDictionary.Clear(); ContextMenuDictionary.Clear(); ListBoxDictionary.Clear(); DataGridDictionary.Clear(); } #endregion #region Evaluate private void InitializeDictionaries() { ButtonDictionary = new Dictionary(); DefaultButtonDictionary = new Dictionary(); LabelDictionary = new Dictionary(); LinkLabelDictionary = new Dictionary(); TextBoxDictionary = new Dictionary(); RichTextBoxDictionary = new Dictionary(); FormDictionary = new Dictionary(); BadgeDictionary = new Dictionary(); DividerDictionary = new Dictionary(); CheckBoxDictionary = new Dictionary(); RadioButtonDictionary = new Dictionary(); SwitchBoxDictionary = new Dictionary(); ToolTipDictionary = new Dictionary(); ComboBoxDictionary = new Dictionary(); NumericDictionary = new Dictionary(); EllipseDictionary = new Dictionary(); TileDictionary = new Dictionary(); ProgressDictionary = new Dictionary(); ControlBoxDictionary = new Dictionary(); TabControlDictionary = new Dictionary(); ScrollBarDictionary = new Dictionary(); PanelDictionary = new Dictionary(); TrackBarDictionary = new Dictionary(); ContextMenuDictionary = new Dictionary(); ListBoxDictionary = new Dictionary(); DataGridDictionary = new Dictionary(); } #endregion #endregion #region Reader /// /// Reads the theme file and put elements properties to dictionaries. /// /// The File path. private void ControlProperties(string path) { // We clear every dictionary for avoid the "the key is already exist in dictionary" exception. Clear(); // Here we refill the dictionaries with information we get in custom theme. FormDictionary = GetValues(path, "Form"); ButtonDictionary = GetValues(path, "Button"); DefaultButtonDictionary = GetValues(path, "DefaultButton"); LabelDictionary = GetValues(path, "Label"); LinkLabelDictionary = GetValues(path, "LinkLabel"); BadgeDictionary = GetValues(path, "Badge"); DividerDictionary = GetValues(path, "Divider"); CheckBoxDictionary = GetValues(path, "CheckBox"); RadioButtonDictionary = GetValues(path, "RadioButton"); SwitchBoxDictionary = GetValues(path, "SwitchBox"); ToolTipDictionary = GetValues(path, "ToolTip"); TextBoxDictionary = GetValues(path, "TextBox"); RichTextBoxDictionary = GetValues(path, "RichTextBox"); ComboBoxDictionary = GetValues(path, "ComboBox"); NumericDictionary = GetValues(path, "Numeric"); EllipseDictionary = GetValues(path, "Ellipse"); TileDictionary = GetValues(path, "Tile"); ProgressDictionary = GetValues(path, "Progress"); ControlBoxDictionary = GetValues(path, "ControlBox"); TabControlDictionary = GetValues(path, "TabControl"); ScrollBarDictionary = GetValues(path, "ScrollBar"); PanelDictionary = GetValues(path, "Panel"); TrackBarDictionary = GetValues(path, "TrackBar"); ContextMenuDictionary = GetValues(path, "ContextMenu"); ListBoxDictionary = GetValues(path, "ListBox"); DataGridDictionary = GetValues(path, "DataGrid"); ThemeDetailsReader(path); UpdateForm(); } /// /// The Method get the custom theme name and author. /// /// The Path of the custom theme file. private void ThemeDetailsReader(string path) { foreach (var item in GetValues(path, "Theme")) { switch (item.Key) { case "Name": ThemeName = item.Value.ToString(); break; case "Author": ThemeAuthor = item.Value.ToString(); break; } } } /// /// The Method to load the custom xml theme file and add a childnodes from a specific node into a dectionary. /// /// The Path of custom theme file (XML file). /// The Node name to get the childnodes from. /// The Dictionary of childnodes names and values of a specific node. private Dictionary GetValues(string path, string nodename) { try { var dict = new Dictionary(); var doc = new XmlDocument(); if (File.Exists(path)) doc.Load(path); if (doc.DocumentElement == null) { return null; } var xmlNode = doc.SelectSingleNode($"/MetroSetTheme/{nodename}"); if (xmlNode == null) return dict; foreach (XmlNode node in xmlNode.ChildNodes) dict.Add(node.Name, node.InnerText); return dict; } catch { return null; } } #endregion Reader #region UITypeEditor /// /// Dialog Type For Opening the theme. /// public class FileNamesEditor : UITypeEditor { private OpenFileDialog _ofd; public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.Modal; } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context == null || provider == null) return base.EditValue(context, provider, value); var editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService == null) return base.EditValue(context, provider, value); _ofd = new OpenFileDialog { Filter = @"Xml File (*.xml)|*.xml", }; return _ofd.ShowDialog() == DialogResult.OK ? _ofd.FileName : base.EditValue(context, provider, value); } } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetBadge.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetBadge), "Bitmaps.Button.bmp")] [Designer(typeof(MetroSetBadgeDesigner))] [DefaultEvent("Click")] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetBadge : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private MouseMode _state; private Style _style; private StyleManager _styleManager; private BadgeAlign _badgeAlignment; private string _badgeText; private Color _normalColor; private Color _normalBorderColor; private Color _normalTextColor; private Color _hoverColor; private Color _hoverBorderColor; private Color _hoverTextColor; private Color _pressColor; private Color _pressBorderColor; private Color _pressTextColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; private Color _normalBadgeColor; private Color _normalBadgeTextColor; private Color _hoverBadgeColor; private Color _hoverBadgeTextColor; private Color _pressBadgeColor; private Color _pressBadgeTextColor; #endregion Internal Vars #region Constructors public MetroSetBadge() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); base.BackColor = Color.Transparent; _badgeAlignment = BadgeAlign.TopRight; _badgeText = "3"; _utl = new Utilites(); _mth = new Methods(); ApplyTheme(); } #endregion Constructors #region Properties /// /// Gets or sets the badge alignment associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the badge alignment associated with the control.")] public BadgeAlign BadgeAlignment { get { return _badgeAlignment; } set { _badgeAlignment = value; Refresh(); } } /// /// Gets or sets the badge text associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the badge text associated with the control.")] public string BadgeText { get { return _badgeText; } set { _badgeText = value; Refresh(); } } /// /// Handling Control Enable state to detect the disability state. /// [Category("MetroSet Framework")] public new bool Enabled { get => base.Enabled; set { base.Enabled = value; if (value == false) { _state = MouseMode.Disabled; } Invalidate(); } } /// /// Gets or sets the control background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in normal mouse sate.")] public Color NormalColor { get { return _normalColor; } set { _normalColor = value; Refresh(); } } /// /// Gets or sets the control border color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in normal mouse sate.")] public Color NormalBorderColor { get { return _normalBorderColor; } set { _normalBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in normal mouse sate.")] public Color NormalTextColor { get { return _normalTextColor; } set { _normalTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in hover mouse sate.")] public Color HoverColor { get { return _hoverColor; } set { _hoverColor = value; Refresh(); } } /// /// Gets or sets the control border color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in hover mouse sate.")] public Color HoverBorderColor { get { return _hoverBorderColor; } set { _hoverBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in hover mouse sate.")] public Color HoverTextColor { get { return _hoverTextColor; } set { _hoverTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in pushed mouse sate.")] public Color PressColor { get { return _pressColor; } set { _pressColor = value; Refresh(); } } /// /// Gets or sets the control border color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in pushed mouse sate.")] public Color PressBorderColor { get { return _pressBorderColor; } set { _pressBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in pushed mouse sate.")] public Color PressTextColor { get { return _pressTextColor; } set { _pressTextColor = value; Refresh(); } } /// /// Gets or sets backcolor used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets backcolor used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the forecolor of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the Badge background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge background color in normal mouse sate.")] public Color NormalBadgeColor { get { return _normalBadgeColor; } set { _normalBadgeColor = value; Refresh(); } } /// /// Gets or sets the Badge Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge Text color in normal mouse sate.")] public Color NormalBadgeTextColor { get { return _normalBadgeTextColor; } set { _normalBadgeTextColor = value; Refresh(); } } /// /// Gets or sets the Badge background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge background color in hover mouse sate.")] public Color HoverBadgeColor { get { return _hoverBadgeColor; } set { _hoverBadgeColor = value; Refresh(); } } /// /// Gets or sets the Badge Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge Text color in hover mouse sate.")] public Color HoverBadgeTextColor { get { return _hoverBadgeTextColor; } set { _hoverBadgeTextColor = value; Refresh(); } } /// /// Gets or sets the Badge background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge background color in pushed mouse sate.")] public Color PressBadgeColor { get { return _pressBadgeColor; } set { _pressBadgeColor = value; Refresh(); } } /// /// Gets or sets the Badge Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the Badge Text color in pushed mouse sate.")] public Color PressBadgeTextColor { get { return _pressBadgeTextColor; } set { _pressBadgeTextColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; Rectangle r; Rectangle badge; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; switch (BadgeAlignment) { case BadgeAlign.Topleft: r = new Rectangle(18, 18, Width - 21, Height - 21); badge = new Rectangle(5, 5, 29, 29); break; case BadgeAlign.TopRight: r = new Rectangle(0, 18, Width - 18, Height - 21); badge = new Rectangle(Width - 35, 1, 29, 29); break; case BadgeAlign.BottmLeft: r = new Rectangle(18, 0, Width - 19, Height - 18); badge = new Rectangle(1, Height - 35, 29, 29); break; case BadgeAlign.BottomRight: r = new Rectangle(0, 0, Width - 19, Height - 18); badge = new Rectangle(Width - 35, Height - 35, 29, 29); break; default: throw new ArgumentOutOfRangeException(); } switch (_state) { case MouseMode.Normal: using (var bg = new SolidBrush(NormalColor)) using (var p = new Pen(NormalBorderColor)) using (var tb = new SolidBrush(NormalTextColor)) using (var bdgBrush = new SolidBrush(NormalBadgeColor)) using (var bdgtxtBrush = new SolidBrush(NormalBadgeTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); SmoothingType(g); g.FillEllipse(bdgBrush, badge); g.DrawString(BadgeText, Font, bdgtxtBrush, badge, _mth.SetPosition()); } break; case MouseMode.Hovered: Cursor = Cursors.Hand; using (var bg = new SolidBrush(HoverColor)) using (var p = new Pen(HoverBorderColor)) using (var tb = new SolidBrush(HoverTextColor)) using (var bdgBrush = new SolidBrush(HoverBadgeColor)) using (var bdgtxtBrush = new SolidBrush(HoverBadgeTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); SmoothingType(g); g.FillEllipse(bdgBrush, badge); g.DrawString(BadgeText, Font, bdgtxtBrush, badge, _mth.SetPosition()); } break; case MouseMode.Pushed: using (var bg = new SolidBrush(PressColor)) using (var p = new Pen(PressBorderColor)) using (var tb = new SolidBrush(PressTextColor)) using (var bdgBrush = new SolidBrush(PressBadgeColor)) using (var bdgtxtBrush = new SolidBrush(PressBadgeTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); SmoothingType(g); g.FillEllipse(bdgBrush, badge); g.DrawString(BadgeText, Font, bdgtxtBrush, badge, _mth.SetPosition()); } break; case MouseMode.Disabled: using (var bg = new SolidBrush(DisabledBackColor)) using (var p = new Pen(DisabledBorderColor)) using (var tb = new SolidBrush(DisabledForeColor)) using (var bdgBrush = new SolidBrush(PressBadgeColor)) using (var bdgtxtBrush = new SolidBrush(PressBadgeTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); SmoothingType(g); g.FillEllipse(bdgBrush, badge); g.DrawString(BadgeText, Font, bdgtxtBrush, badge, _mth.SetPosition()); } break; } } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: NormalColor = Color.FromArgb(238, 238, 238); NormalBorderColor = Color.FromArgb(204, 204, 204); NormalTextColor = Color.Black; HoverColor = Color.FromArgb(102, 102, 102); HoverBorderColor = Color.FromArgb(102, 102, 102); HoverTextColor = Color.White; PressColor = Color.FromArgb(51, 51, 51); PressBorderColor = Color.FromArgb(51, 51, 51); PressTextColor = Color.White; NormalBadgeColor = Color.FromArgb(65, 177, 225); NormalBadgeTextColor = Color.White; HoverBadgeColor = Color.FromArgb(85, 187, 245); HoverBadgeTextColor = Color.White; PressBadgeColor = Color.FromArgb(45, 147, 205); PressBadgeTextColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: NormalColor = Color.FromArgb(32, 32, 32); NormalBorderColor = Color.FromArgb(64, 64, 64); NormalTextColor = Color.FromArgb(204, 204, 204); HoverColor = Color.FromArgb(170, 170, 170); HoverBorderColor = Color.FromArgb(170, 170, 170); HoverTextColor = Color.White; PressColor = Color.FromArgb(240, 240, 240); PressBorderColor = Color.FromArgb(240, 240, 240); PressTextColor = Color.White; NormalBadgeColor = Color.FromArgb(65, 177, 225); NormalBadgeTextColor = Color.White; HoverBadgeColor = Color.FromArgb(85, 187, 245); HoverBadgeTextColor = Color.White; PressBadgeColor = Color.FromArgb(45, 147, 205); PressBadgeTextColor = Color.White; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.BadgeDictionary) { if (varkey.Key == null) { return; } switch (varkey.Key) { case "NormalColor": NormalColor = _utl.HexColor((string)varkey.Value); break; case "NormalBorderColor": NormalBorderColor = _utl.HexColor((string)varkey.Value); break; case "NormalTextColor": NormalTextColor = _utl.HexColor((string)varkey.Value); break; case "HoverColor": HoverColor = _utl.HexColor((string)varkey.Value); break; case "HoverBorderColor": HoverBorderColor = _utl.HexColor((string)varkey.Value); break; case "HoverTextColor": HoverTextColor = _utl.HexColor((string)varkey.Value); break; case "PressColor": PressColor = _utl.HexColor((string)varkey.Value); break; case "PressBorderColor": PressBorderColor = _utl.HexColor((string)varkey.Value); break; case "PressTextColor": PressTextColor = _utl.HexColor((string)varkey.Value); break; case "NormalBadgeColor": NormalBadgeColor = _utl.HexColor((string)varkey.Value); break; case "NormalBadgeTextColor": NormalBadgeTextColor = _utl.HexColor((string)varkey.Value); break; case "HoverBadgeColor": HoverBadgeColor = _utl.HexColor((string)varkey.Value); break; case "HoverBadgeTextColor": HoverBadgeTextColor = _utl.HexColor((string)varkey.Value); break; case "PressBadgeColor": PressBadgeColor = _utl.HexColor((string)varkey.Value); break; case "PressBadgeTextColor": PressBadgeTextColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; } } Invalidate(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion Theme Changing #region Events /// /// Handling mouse up event of the control. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// MouseEventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Normal; Invalidate(); } #endregion Events #region Methods /// /// Sets the smoothingmode the the specific graphics. /// /// Graphics to Set the effect. /// state of smoothingmode. private void SmoothingType(Graphics e, SmoothingMode state = SmoothingMode.AntiAlias) { e.SmoothingMode = state; } #endregion Methods } } ================================================ FILE: MetroSet UI/Controls/MetroSetButton.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetButton), "Bitmaps.Button.bmp")] [Designer(typeof(MetroSetButtonDesigner))] [DefaultEvent("Click")] [DefaultProperty("Text")] public class MetroSetButton : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private MouseMode _state; private Style _style; private StyleManager _styleManager; private Color _normalColor; private Color _normalBorderColor; private Color _normalTextColor; private Color _hoverColor; private Color _hoverBorderColor; private Color _hoverTextColor; private Color _pressColor; private Color _pressBorderColor; private Color _pressTextColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetButton() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); _utl = new Utilites(); _mth = new Methods(); ApplyTheme(); } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(0, 0, Width - 1, Height - 1); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; switch (_state) { case MouseMode.Normal: using (var bg = new SolidBrush(NormalColor)) using (var p = new Pen(NormalBorderColor)) using (var tb = new SolidBrush(NormalTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); } break; case MouseMode.Hovered: Cursor = Cursors.Hand; using (var bg = new SolidBrush(HoverColor)) using (var p = new Pen(HoverBorderColor)) using (var tb = new SolidBrush(HoverTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); } break; case MouseMode.Pushed: using (var bg = new SolidBrush(PressColor)) using (var p = new Pen(PressBorderColor)) using (var tb = new SolidBrush(PressTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); } break; case MouseMode.Disabled: using (var bg = new SolidBrush(DisabledBackColor)) using (var p = new Pen(DisabledBorderColor)) using (var tb = new SolidBrush(DisabledForeColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, r, _mth.SetPosition()); } break; default: throw new ArgumentOutOfRangeException(); } } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: NormalColor = Color.FromArgb(65, 177, 225); NormalBorderColor = Color.FromArgb(65, 177, 225); NormalTextColor = Color.White; HoverColor = Color.FromArgb(95, 207, 255); HoverBorderColor = Color.FromArgb(95, 207, 255); HoverTextColor = Color.White; PressColor = Color.FromArgb(35, 147, 195); PressBorderColor = Color.FromArgb(35, 147, 195); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(120, 65, 177, 225); DisabledBorderColor = Color.FromArgb(120, 65, 177, 225); DisabledForeColor = Color.Gray; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: NormalColor = Color.FromArgb(65, 177, 225); NormalBorderColor = Color.FromArgb(65, 177, 225); NormalTextColor = Color.White; HoverColor = Color.FromArgb(95, 207, 255); HoverBorderColor = Color.FromArgb(95, 207, 255); HoverTextColor = Color.White; PressColor = Color.FromArgb(35, 147, 195); PressBorderColor = Color.FromArgb(35, 147, 195); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(120, 65, 177, 225); DisabledBorderColor = Color.FromArgb(120, 65, 177, 225); DisabledForeColor = Color.Gray; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ButtonDictionary) { if ((varkey.Key == null) || varkey.Key == null) { return; } switch (varkey.Key) { case "NormalColor": NormalColor = _utl.HexColor((string)varkey.Value); break; case "NormalBorderColor": NormalBorderColor = _utl.HexColor((string)varkey.Value); break; case "NormalTextColor": NormalTextColor = _utl.HexColor((string)varkey.Value); break; case "HoverColor": HoverColor = _utl.HexColor((string)varkey.Value); break; case "HoverBorderColor": HoverBorderColor = _utl.HexColor((string)varkey.Value); break; case "HoverTextColor": HoverTextColor = _utl.HexColor((string)varkey.Value); break; case "PressColor": PressColor = _utl.HexColor((string)varkey.Value); break; case "PressBorderColor": PressBorderColor = _utl.HexColor((string)varkey.Value); break; case "PressTextColor": PressTextColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; } } Invalidate(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion Theme Changing #region Properties /// /// I make BackColor inaccessible cause we have not use of it. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Handling Control Enable state to detect the disability state. /// [Category("MetroSet Framework")] public new bool Enabled { get => base.Enabled; set { base.Enabled = value; _state = value ? MouseMode.Normal : MouseMode.Disabled; Invalidate(); } } /// /// Gets or sets the button background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in normal mouse sate.")] public Color NormalColor { get { return _normalColor; } set { _normalColor = value; Refresh(); } } /// /// Gets or sets the button border color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in normal mouse sate.")] public Color NormalBorderColor { get { return _normalBorderColor; } set { _normalBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in normal mouse sate.")] public Color NormalTextColor { get { return _normalTextColor; } set { _normalTextColor = value; Refresh(); } } /// /// Gets or sets the button background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in hover mouse sate.")] public Color HoverColor { get { return _hoverColor; } set { _hoverColor = value; Refresh(); } } /// /// Gets or sets the button border color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in hover mouse sate.")] public Color HoverBorderColor { get { return _hoverBorderColor; } set { _hoverBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in hover mouse sate.")] public Color HoverTextColor { get { return _hoverTextColor; } set { _hoverTextColor = value; Refresh(); } } /// /// Gets or sets the button background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in pushed mouse sate.")] public Color PressColor { get { return _pressColor; } set { _pressColor = value; Refresh(); } } /// /// Gets or sets the button border color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in pushed mouse sate.")] public Color PressBorderColor { get { return _pressBorderColor; } set { _pressBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in pushed mouse sate.")] public Color PressTextColor { get { return _pressTextColor; } set { _pressTextColor = value; Refresh(); } } /// /// Gets or sets BackColor used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets backcolor used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the ForeColor of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events /// /// Handling mouse up event of the control. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// EventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse leave event of the control. /// /// MouseEventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Normal; Invalidate(); } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetCheckBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Windows.Forms; using MetroSet_UI.Animates; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetCheckBox), "Bitmaps.CheckBox.bmp")] [Designer(typeof(MetroSetCheckBoxDesigner))] [DefaultEvent("CheckedChanged")] [DefaultProperty("Checked")] public class MetroSetCheckBox : Control, IMetroSetControl, IDisposable { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private bool _checked; private IntAnimate _animator; private SignStyle _signStyle = SignStyle.Sign; private Enums.CheckState _checkState; private Color _backgroundColor; private Color _borderColor; private Color _disabledBorderColor; private Color _checkSignColor; #endregion Internal Vars #region Constructors public MetroSetCheckBox() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); base.Cursor = Cursors.Hand; base.BackColor = Color.Transparent; _utl = new Utilites(); _animator = new IntAnimate(); _animator.Setting(100, 0, 255); _animator.Update = (alpha) => Invalidate(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackgroundColor = Color.White; BorderColor = Color.FromArgb(155, 155, 155); DisabledBorderColor = Color.FromArgb(205, 205, 205); CheckSignColor = Color.FromArgb(65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackgroundColor = Color.FromArgb(30, 30, 30); BorderColor = Color.FromArgb(155, 155, 155); DisabledBorderColor = Color.FromArgb(85, 85, 85); CheckSignColor = Color.FromArgb(65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.CheckBoxDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "CheckColor": CheckSignColor = _utl.HexColor((string)varkey.Value); break; case "CheckedStyle": if ((string)varkey.Value == "Sign") SignStyle = SignStyle.Sign; else if ((string)varkey.Value == "Shape") { SignStyle = SignStyle.Shape; } break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; var rect = new Rectangle(0, 0, 16, 15); var alpha = _animator.Value; using (var backBrush = new SolidBrush(Enabled ? BackgroundColor : Color.FromArgb(238, 238, 238))) { using (var checkMarkPen = new Pen(Enabled ? Checked || _animator.Active ? Color.FromArgb(alpha, CheckSignColor) : BackgroundColor : Color.FromArgb(alpha, DisabledBorderColor), 2)) { using (var checkMarkBrush = new SolidBrush(Enabled ? Checked || _animator.Active ? Color.FromArgb(alpha, CheckSignColor) : BackgroundColor : DisabledBorderColor)) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor)) { using (var sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }) { using (var tb = new SolidBrush(ForeColor)) { g.FillRectangle(backBrush, rect); g.DrawRectangle(Enabled ? p : checkMarkPen, rect); DrawSymbol(g, checkMarkPen, checkMarkBrush); g.DrawString(Text, Font, tb, new Rectangle(19, 2, Width, Height - 4), sf); } } } } } } } private void DrawSymbol(Graphics g, Pen pen, SolidBrush solidBrush) { if (solidBrush == null) throw new ArgumentNullException(nameof(solidBrush)); if (SignStyle == SignStyle.Sign) { g.SmoothingMode = SmoothingMode.AntiAlias; g.DrawLines(pen, new[] { new Point(3, 7), new Point(7, 10), new Point(13, 3) }); g.SmoothingMode = SmoothingMode.None; } else { g.FillRectangle(solidBrush, new Rectangle(3, 3, 11, 10)); } } #endregion Draw Control #region Events public event CheckedChangedEventHandler CheckedChanged; public delegate void CheckedChangedEventHandler(object sender); /// /// Here we will handle the checking state in runtime. /// /// EventArgs protected override void OnClick(EventArgs e) { base.OnClick(e); Checked = !Checked; Invalidate(); } /// /// Here we will set the limited height for the control to avoid high and low of the text drawing. /// /// EventArgs protected override void OnResize(EventArgs e) { base.OnResize(e); Height = 16; Invalidate(); } /// /// Here we set the mouse hand smooth. /// /// protected override void WndProc(ref Message m) { if (m.Msg == User32.WM_SETCURSOR) { User32.SetCursor(User32.LoadCursor(IntPtr.Zero, User32.IDC_HAND)); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); } #endregion Events #region Properties /// /// Gets or sets a value indicating whether the control is checked. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the control is checked.")] public bool Checked { get => _checked; set { _checked = value; CheckedChanged?.Invoke(this); _animator.Reverse(!value); CheckState = value ? Enums.CheckState.Checked : Enums.CheckState.Unchecked; Invalidate(); } } /// /// Gets or sets the the sign style of check. /// [Category("MetroSet Framework"), Description("Gets or sets the the sign style of check.")] public SignStyle SignStyle { get { return _signStyle; } set { _signStyle = value; Refresh(); } } /// /// Specifies the state of a control, such as a check box, that can be checked, unchecked. /// [Browsable(false)] public Enums.CheckState CheckState { get { return _checkState; } set { _checkState = value; Refresh(); } } /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } /// /// I make BackColor inaccessible cause I want it to be just transparent and I used another property for the same job in following properties. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the form BackColor. /// [Category("MetroSet Framework"), Description("Gets or sets the form backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the border color. /// [Category("MetroSet Framework"), Description("Gets or sets the border color.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the color of the check symbol. /// [Category("MetroSet Framework"), Description("Gets or sets the color of the check symbol.")] public Color CheckSignColor { get { return _checkSignColor; } set { _checkSignColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Disposing /// /// Disposing Methods. /// public new void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetComboBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetComboBox), "Bitmaps.ComoBox.bmp")] [DefaultEvent("SelectedIndexChanged")] [DefaultProperty("Items")] [ComVisible(true)] public class MetroSetComboBox : ComboBox, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Refresh(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private int _startIndex; private Color _backgroundColor; private Color _borderColor; private Color _arrowColor; private Color _selectedItemForeColor; private Color _selectedItemBackColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetComboBox() { SetStyle ( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Regular(11); base.BackColor = Color.Transparent; base.AllowDrop = true; DrawMode = DrawMode.OwnerDrawFixed; ItemHeight = 20; _startIndex = 0; CausesValidation = false; DropDownStyle = ComboBoxStyle.DropDownList; _mth = new Methods(); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region Properties /// /// Gets or sets the index specifying the currently selected item. /// [Category("MetroSet Framework")] [Description("Gets or sets the index specifying the currently selected item.")] private int StartIndex { get => _startIndex; set { _startIndex = value; try { SelectedIndex = value; } catch { // } Invalidate(); } } /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } /// /// I make BackColor inaccessible cause I want it to be just transparent and I used another property for the same job in following properties. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the form backcolor. /// [Category("MetroSet Framework"), Description("Gets or sets the form backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets border color used by the control /// [Category("MetroSet Framework")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets arrow color used by the control /// [Category("MetroSet Framework")] public Color ArrowColor { get { return _arrowColor; } set { _arrowColor = value; Refresh(); } } /// /// Gets or sets ForeColor of the selected item used by the control /// [Category("MetroSet Framework")] public Color SelectedItemForeColor { get { return _selectedItemForeColor; } set { _selectedItemForeColor = value; Refresh(); } } /// /// Gets or sets BackColor of the selected item used by the control /// [Category("MetroSet Framework")] public Color SelectedItemBackColor { get { return _selectedItemBackColor; } set { _selectedItemBackColor = value; Refresh(); } } /// /// Gets or sets BackColor used by the control while disabled. /// [Category("MetroSet Framework")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the ForeColor of the control whenever while disabled. /// [Category("MetroSet Framework")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Draw Control /// /// Here we draw the items. /// /// protected override void OnDrawItem(DrawItemEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; if (e.Index == -1) { return; } var itemState = (e.State & DrawItemState.Selected) == DrawItemState.Selected; using (var bg = new SolidBrush(itemState ? SelectedItemBackColor : BackgroundColor)) using (var tc = new SolidBrush(itemState ? SelectedItemForeColor : ForeColor)) { using (var f = new Font(Font.Name, 9)) { g.FillRectangle(bg, e.Bounds); g.DrawString(GetItemText(Items[e.Index]), f, tc, e.Bounds, _mth.SetPosition(StringAlignment.Near)); } } } /// /// Here we draw the container. /// /// PaintEventArgs protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var rect = new Rectangle(0, 0, Width - 1, Height - 1); var downArrow = '▼'; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; using (var bg = new SolidBrush(Enabled ? BackgroundColor : DisabledBackColor)) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor)) { using (var s = new SolidBrush(Enabled ? ArrowColor : DisabledForeColor)) { using (var tb = new SolidBrush(Enabled ? ForeColor : DisabledForeColor)) { using (var f = MetroSetFonts.SemiBold(8)) { g.FillRectangle(bg, rect); g.TextRenderingHint = TextRenderingHint.AntiAlias; g.DrawString(downArrow.ToString(), f, s, new Point(Width - 22, 8)); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.DrawString(Text, f, tb, new Rectangle(7, 0, Width - 1, Height - 1), _mth.SetPosition(StringAlignment.Near)); g.DrawRectangle(p, rect); } } } } } } #endregion #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(20, 20, 20); BackgroundColor = Color.FromArgb(238, 238, 238); BorderColor = Color.FromArgb(150, 150, 150); ArrowColor = Color.FromArgb(150, 150, 150); SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemForeColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(204, 204, 204); BackgroundColor = Color.FromArgb(34, 34, 34); BorderColor = Color.FromArgb(110, 110, 110); ArrowColor = Color.FromArgb(110, 110, 110); SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemForeColor = Color.White; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ComboBoxDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "ArrowColor": ArrowColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemBackColor": SelectedItemBackColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemForeColor": SelectedItemForeColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing } } ================================================ FILE: MetroSet UI/Controls/MetroSetContextMenuStrip.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetContextMenuStrip), "Bitmaps.ContextMenu.bmp")] [DefaultEvent("Opening")] [ComVisible(true)] public class MetroSetContextMenuStrip : ContextMenuStrip, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private ToolStripItemClickedEventArgs _clickedEventArgs; #endregion Internal Vars #region Constructors public MetroSetContextMenuStrip() { _utl = new Utilites(); ApplyTheme(); Renderer = new MetroSetToolStripRender(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForegroundColor = Color.FromArgb(170, 170, 170); BackgroundColor = Color.White; ArrowColor = Color.Gray; SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemColor = Color.White; SeparatorColor = Color.LightGray; DisabledForeColor = Color.Silver; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForegroundColor = Color.FromArgb(170, 170, 170); BackgroundColor = Color.FromArgb(30, 30, 30); ArrowColor = Color.Gray; SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemColor = Color.White; SeparatorColor = Color.Gray; DisabledForeColor = Color.Silver; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ContextMenuDictionary) { switch (varkey.Key) { case "ForeColor": ForegroundColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "ArrowColor": ArrowColor = _utl.HexColor((string)varkey.Value); break; case "SeparatorColor": SeparatorColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemColor": SelectedItemColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemBackColor": SelectedItemBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Properties /// /// Gets or sets ForegroundColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets forecolor used by the control.")] [DisplayName("ForeColor")] public static Color ForegroundColor { get; set; } /// /// Gets or sets BackgroundColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets backcolor used by the control.")] [DisplayName("BackColor")] public static Color BackgroundColor { get; set; } /// /// Gets or sets separator color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets separator color used by the control.")] public static Color SeparatorColor { get; set; } /// /// Gets or sets Arrow color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets arrowcolor used by the control.")] public static Color ArrowColor { get; set; } /// /// Gets or sets SelectedItem color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets selecteditem color used by the control.")] public static Color SelectedItemColor { get; set; } /// /// Gets or sets SelectedItem BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets selecteditem backcolor used by the control.")] public static Color SelectedItemBackColor { get; set; } /// /// Gets or sets disabled forecolor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled forecolor used by the control.")] public static Color DisabledForeColor { get; set; } public static new Font Font => MetroSetFonts.UIRegular(10); private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events public event ClickedEventHandler Clicked; public delegate void ClickedEventHandler(object sender); /// /// Here we handle whenever and item clicked. /// /// protected override void OnItemClicked(ToolStripItemClickedEventArgs e) { if ((e.ClickedItem == null) || e.ClickedItem is ToolStripSeparator) return; if (ReferenceEquals(e, _clickedEventArgs)) OnItemClicked(e); else { _clickedEventArgs = e; Clicked?.Invoke(this); } } /// /// Here we handle mouse hover event. /// /// EventArgs protected override void OnMouseHover(EventArgs e) { base.OnMouseHover(e); Cursor = Cursors.Hand; Invalidate(); } /// /// Here we handle mouse up event /// /// protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); Cursor = Cursors.Hand; Invalidate(); } #endregion #region Child private sealed class MetroSetToolStripRender : ToolStripProfessionalRenderer { #region Drawing Text /// /// Here we draw item text. /// /// protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) { e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; var textRect = new Rectangle(25, e.Item.ContentRectangle.Y, e.Item.ContentRectangle.Width - (24 + 16), e.Item.ContentRectangle.Height - 4); using (var b = new SolidBrush(e.Item.Enabled ? e.Item.Selected ? SelectedItemColor : ForegroundColor : DisabledForeColor)) { e.Graphics.DrawString(e.Text, Font, b, textRect); } } #endregion Drawing Text #region Drawing Backgrounds /// /// Here we draw toolstrip background. /// /// protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) { base.OnRenderToolStripBackground(e); e.Graphics.Clear(BackgroundColor); } /// /// Here we draw toolstrip menu item background. /// /// protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) { e.Graphics.InterpolationMode = InterpolationMode.High; e.Graphics.Clear(BackgroundColor); var r = new Rectangle(0, e.Item.ContentRectangle.Y - 2, e.Item.ContentRectangle.Width + 4, e.Item.ContentRectangle.Height + 3); using (var b = new SolidBrush(e.Item.Selected && e.Item.Enabled ? SelectedItemBackColor : BackgroundColor)) { e.Graphics.FillRectangle(b, r); } } #endregion Drawing Backgrounds #region Set Image Margin protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) { //MyBase.OnRenderImageMargin(e) //I Make above line comment which makes users to be able to add images to ToolStrips } #endregion Set Image Margin #region Drawing Seperators & Borders /// /// Here we draw toolstrip separators. /// /// protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) { using (var p = new Pen(SeparatorColor)) { e.Graphics.DrawLine(p, new Point(e.Item.Bounds.Left, e.Item.Bounds.Height / 2), new Point(e.Item.Bounds.Right - 5, e.Item.Bounds.Height / 2)); } } #endregion Drawing Seperators & Borders #region Drawing DropDown Arrows /// /// Here we draw the toolstrip arrows. /// /// ToolStripArrowRenderEventArgs protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) { var arrowX = e.ArrowRectangle.X + e.ArrowRectangle.Width / 2; var arrowY = e.ArrowRectangle.Y + e.ArrowRectangle.Height / 2; var arrowPoints = new[] { new Point(arrowX - 5, arrowY - 5), new Point(arrowX, arrowY), new Point(arrowX - 5, arrowY + 5) }; using (var arrowBrush = new SolidBrush(e.Item.Enabled ? ArrowColor : DisabledForeColor)) { e.Graphics.FillPolygon(arrowBrush, arrowPoints); } } #endregion Drawing DropDown Arrows } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetControlBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetControlBox), "Bitmaps.ControlButton.bmp")] [Designer(typeof(MetroSetControBoxDesigner))] [DefaultProperty("Click")] [ComVisible(true)] public class MetroSetControlBox : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private bool _maximizeBox = true; private Color _closeNormalForeColor; private Color _closeHoverForeColor; private Color _closeHoverBackColor; private Color _maximizeHoverForeColor; private Color _maximizeHoverBackColor; private Color _maximizeNormalForeColor; private Color _minimizeHoverForeColor; private Color _minimizeHoverBackColor; private Color _minimizeNormalForeColor; private Color _disabledForeColor; #endregion Internal Vars #region Constructors public MetroSetControlBox() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _utl = new Utilites(); base.Anchor = AnchorStyles.Top | AnchorStyles.Right; ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: CloseHoverBackColor = Color.FromArgb(183, 40, 40); CloseHoverForeColor = Color.White; CloseNormalForeColor = Color.Gray; MaximizeHoverBackColor = Color.FromArgb(238, 238, 238); MaximizeHoverForeColor = Color.Gray; MaximizeNormalForeColor = Color.Gray; MinimizeHoverBackColor = Color.FromArgb(238, 238, 238); MinimizeHoverForeColor = Color.Gray; MinimizeNormalForeColor = Color.Gray; DisabledForeColor = Color.DimGray; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: CloseHoverBackColor = Color.FromArgb(183, 40, 40); CloseHoverForeColor = Color.White; CloseNormalForeColor = Color.Gray; MaximizeHoverBackColor = Color.FromArgb(238, 238, 238); MaximizeHoverForeColor = Color.Gray; MaximizeNormalForeColor = Color.Gray; MinimizeHoverBackColor = Color.FromArgb(238, 238, 238); MinimizeHoverForeColor = Color.Gray; MinimizeNormalForeColor = Color.Gray; DisabledForeColor = Color.Silver; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ControlBoxDictionary) { switch (varkey.Key) { case "CloseHoverBackColor": CloseHoverBackColor = _utl.HexColor((string)varkey.Value); break; case "CloseHoverForeColor": CloseHoverForeColor = _utl.HexColor((string)varkey.Value); break; case "CloseNormalForeColor": CloseNormalForeColor = _utl.HexColor((string)varkey.Value); break; case "MaximizeHoverBackColor": MaximizeHoverBackColor = _utl.HexColor((string)varkey.Value); break; case "MaximizeHoverForeColor": MaximizeHoverForeColor = _utl.HexColor((string)varkey.Value); break; case "MaximizeNormalForeColor": MaximizeNormalForeColor = _utl.HexColor((string)varkey.Value); break; case "MinimizeHoverBackColor": MinimizeHoverBackColor = _utl.HexColor((string)varkey.Value); break; case "MinimizeHoverForeColor": MinimizeHoverForeColor = _utl.HexColor((string)varkey.Value); break; case "MinimizeNormalForeColor": MinimizeNormalForeColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } Invalidate(); } #endregion Theme Changing #region Properties #region Public private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } /// /// Gets or sets a value indicating whether the Maximize button is Enabled in the caption bar of the form. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the Maximize button is Enabled in the caption bar of the form.")] public bool MaximizeBox { get { return _maximizeBox; } set { _maximizeBox = value; Refresh(); } } /// /// Gets or sets a value indicating whether the Minimize button is Enabled in the caption bar of the form. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the Minimize button is Enabled in the caption bar of the form.")] private bool _minimizeBox = true; public bool MinimizeBox { get { return _minimizeBox; } set { _minimizeBox = value; Refresh(); } } /// /// Gets or sets Close ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Close forecolor used by the control.")] public Color CloseNormalForeColor { get { return _closeNormalForeColor; } set { _closeNormalForeColor = value; Refresh(); } } /// /// Gets or sets Close ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Close forecolor used by the control.")] public Color CloseHoverForeColor { get { return _closeHoverForeColor; } set { _closeHoverForeColor = value; Refresh(); } } /// /// Gets or sets Close BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Close backcolor used by the control.")] public Color CloseHoverBackColor { get { return _closeHoverBackColor; } set { _closeHoverBackColor = value; Refresh(); } } /// /// Gets or sets Maximize ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Maximize forecolor used by the control.")] public Color MaximizeHoverForeColor { get { return _maximizeHoverForeColor; } set { _maximizeHoverForeColor = value; Refresh(); } } /// /// Gets or sets Maximize BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Maximize backcolor used by the control.")] public Color MaximizeHoverBackColor { get { return _maximizeHoverBackColor; } set { _maximizeHoverBackColor = value; Refresh(); } } /// /// Gets or sets Maximize ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Maximize forecolor used by the control.")] public Color MaximizeNormalForeColor { get { return _maximizeNormalForeColor; } set { _maximizeNormalForeColor = value; Refresh(); } } /// /// Gets or sets Minimize ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Minimize forecolor used by the control.")] public Color MinimizeHoverForeColor { get { return _minimizeHoverForeColor; } set { _minimizeHoverForeColor = value; Refresh(); } } /// /// Gets or sets Minimize BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Minimize backcolor used by the control.")] public Color MinimizeHoverBackColor { get { return _minimizeHoverBackColor; } set { _minimizeHoverBackColor = value; Refresh(); } } /// /// Gets or sets Minimize ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets Minimize forecolor used by the control.")] public Color MinimizeNormalForeColor { get { return _minimizeNormalForeColor; } set { _minimizeNormalForeColor = value; Refresh(); } } /// /// Gets or sets disabled ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled forecolor used by the control.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// I make BackColor inaccessible cause we have not use of it. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; #endregion #region Private private bool MinimizeHovered { get; set; } private bool MaximizeHovered { get; set; } private bool CloseHovered { get; set; } #endregion #endregion #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; using (var closeBoxState = new SolidBrush(CloseHovered ? CloseHoverBackColor : Color.Transparent)) { using (var f = new Font(@"Marlett", 12)) { using (var tb = new SolidBrush(CloseHovered ? CloseHoverForeColor : CloseNormalForeColor)) { using (var sf = new StringFormat { Alignment = StringAlignment.Center }) { g.FillRectangle(closeBoxState, new Rectangle(70, 5, 27, Height)); g.DrawString("r", f, CloseHovered ? tb : Brushes.Gray, new Point(Width - 16, 8), sf); } } } } using (var maximizeBoxState = new SolidBrush(MaximizeBox ? MaximizeHovered ? MaximizeHoverBackColor : Color.Transparent : Color.Transparent)) { using (var f = new Font(@"Marlett", 12)) { using (var tb = new SolidBrush(MaximizeBox ? MaximizeHovered ? MaximizeHoverForeColor : MaximizeNormalForeColor : DisabledForeColor)) { var maxSymbol = Parent.FindForm()?.WindowState == FormWindowState.Maximized ? "2" : "1"; using (var sf = new StringFormat { Alignment = StringAlignment.Center }) { g.FillRectangle(maximizeBoxState, new Rectangle(38, 5, 24, Height)); g.DrawString(maxSymbol, f, tb, new Point(51, 7), sf); } } } } using (var minimizeBoxState = new SolidBrush(MinimizeBox ? MinimizeHovered ? MinimizeHoverBackColor : Color.Transparent : Color.Transparent)) { using (var f = new Font(@"Marlett", 12)) { using (var tb = new SolidBrush(MinimizeBox ? MinimizeHovered ? MinimizeHoverForeColor : MinimizeNormalForeColor : DisabledForeColor)) { using (var sf = new StringFormat { Alignment = StringAlignment.Center }) { g.FillRectangle(minimizeBoxState, new Rectangle(5, 5, 27, Height)); g.DrawString("0", f, tb, new Point(20, 7), sf); } } } } } #endregion #region Events /// /// Here we provide the fixed size while resizing. /// /// protected override void OnResize(EventArgs e) { base.OnResize(e); Size = new Size(100, 25); } /// /// Handling mouse up event of the control so that we detect if cursor located in our need area. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (e.Location.Y > 0 && e.Location.Y < (Height - 2)) { if (e.Location.X > 0 && e.Location.X < 34) { Cursor = Cursors.Hand; MinimizeHovered = true; MaximizeHovered = false; CloseHovered = false; } else if (e.Location.X > 33 && e.Location.X < 65) { Cursor = Cursors.Hand; MinimizeHovered = false; MaximizeHovered = true; CloseHovered = false; } else if (e.Location.X > 64 && e.Location.X < Width) { Cursor = Cursors.Hand; MinimizeHovered = false; MaximizeHovered = false; CloseHovered = true; } else { Cursor = Cursors.Arrow; MinimizeHovered = false; MaximizeHovered = false; CloseHovered = false; } } Invalidate(); } /// /// Handling mouse up event of the control so that we can perform action commands. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseDown(e); if (CloseHovered) { Parent.FindForm()?.Close(); } else if (MinimizeHovered) { if (!MinimizeBox) return; Parent.FindForm().WindowState = FormWindowState.Minimized; } else if (MaximizeHovered) { if (MaximizeBox) { Parent.FindForm().WindowState = Parent.FindForm()?.WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal; } } } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); Cursor = Cursors.Default; MinimizeHovered = false; MaximizeHovered = false; CloseHovered = false; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); Focus(); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetDefaultButton.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetDefaultButton), "Bitmaps.Button.bmp")] [Designer(typeof(MetroSetDefaultButtonDesigner))] [DefaultEvent("Click")] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetDefaultButton : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private MouseMode _state; private Style _style; private StyleManager _styleManager; private Color _normalColor; private Color _normalBorderColor; private Color _normalTextColor; private Color _hoverColor; private Color _hoverBorderColor; private Color _hoverTextColor; private Color _pressColor; private Color _pressBorderColor; private Color _pressTextColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetDefaultButton() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); _utl = new Utilites(); _mth = new Methods(); ApplyTheme(); } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(0, 0, Width - 1, Height - 1); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; switch (_state) { case MouseMode.Normal: using (var bg = new SolidBrush(NormalColor)) using (var p = new Pen(NormalBorderColor)) using (var tb = new SolidBrush(NormalTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Hovered: Cursor = Cursors.Hand; using (var bg = new SolidBrush(HoverColor)) using (var p = new Pen(HoverBorderColor)) using (var tb = new SolidBrush(HoverTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Pushed: using (var bg = new SolidBrush(PressColor)) using (var p = new Pen(PressBorderColor)) using (var tb = new SolidBrush(PressTextColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Disabled: using (var bg = new SolidBrush(DisabledBackColor)) using (var p = new Pen(DisabledBorderColor)) using (var tb = new SolidBrush(DisabledForeColor)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; } } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: NormalColor = Color.FromArgb(238, 238, 238); NormalBorderColor = Color.FromArgb(204, 204, 204); NormalTextColor = Color.Black; HoverColor = Color.FromArgb(102, 102, 102); HoverBorderColor = Color.FromArgb(102, 102, 102); HoverTextColor = Color.White; PressColor = Color.FromArgb(51, 51, 51); PressBorderColor = Color.FromArgb(51, 51, 51); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: NormalColor = Color.FromArgb(32, 32, 32); NormalBorderColor = Color.FromArgb(64, 64, 64); NormalTextColor = Color.FromArgb(204, 204, 204); HoverColor = Color.FromArgb(170, 170, 170); HoverBorderColor = Color.FromArgb(170, 170, 170); HoverTextColor = Color.White; PressColor = Color.FromArgb(240, 240, 240); PressBorderColor = Color.FromArgb(240, 240, 240); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.DefaultButtonDictionary) { if (varkey.Key == null) { return; } switch (varkey.Key) { case "NormalColor": NormalColor = _utl.HexColor((string)varkey.Value); break; case "NormalBorderColor": NormalBorderColor = _utl.HexColor((string)varkey.Value); break; case "NormalTextColor": NormalTextColor = _utl.HexColor((string)varkey.Value); break; case "HoverColor": HoverColor = _utl.HexColor((string)varkey.Value); break; case "HoverBorderColor": HoverBorderColor = _utl.HexColor((string)varkey.Value); break; case "HoverTextColor": HoverTextColor = _utl.HexColor((string)varkey.Value); break; case "PressColor": PressColor = _utl.HexColor((string)varkey.Value); break; case "PressBorderColor": PressBorderColor = _utl.HexColor((string)varkey.Value); break; case "PressTextColor": PressTextColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; } } Refresh(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion Theme Changing #region Properties /// /// I make BackColor inaccessible cause we have not use of it. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Handling Control Enable state to detect the disability state. /// [Category("MetroSet Framework")] public new bool Enabled { get => base.Enabled; set { base.Enabled = value; if (value == false) { _state = MouseMode.Disabled; } Invalidate(); } } /// /// Gets or sets the button background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in normal mouse sate.")] public Color NormalColor { get { return _normalColor; } set { _normalColor = value; Refresh(); } } /// /// Gets or sets the button border color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in normal mouse sate.")] public Color NormalBorderColor { get { return _normalBorderColor; } set { _normalBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in normal mouse sate.")] public Color NormalTextColor { get { return _normalTextColor; } set { _normalTextColor = value; Refresh(); } } /// /// Gets or sets the button background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in hover mouse sate.")] public Color HoverColor { get { return _hoverColor; } set { _hoverColor = value; Refresh(); } } /// /// Gets or sets the button border color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in hover mouse sate.")] public Color HoverBorderColor { get { return _hoverBorderColor; } set { _hoverBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in hover mouse sate.")] public Color HoverTextColor { get { return _hoverTextColor; } set { _hoverTextColor = value; Refresh(); } } /// /// Gets or sets the button background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button background color in pushed mouse sate.")] public Color PressColor { get { return _pressColor; } set { _pressColor = value; Refresh(); } } /// /// Gets or sets the button border color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button border color in pushed mouse sate.")] public Color PressBorderColor { get { return _pressBorderColor; } set { _pressBorderColor = value; Refresh(); } } /// /// Gets or sets the button Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the button Text color in pushed mouse sate.")] public Color PressTextColor { get { return _pressTextColor; } set { _pressTextColor = value; Refresh(); } } /// /// Gets or sets BackColor used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets backcolor used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the ForeColor of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events /// /// Handling mouse up event of the control. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// MouseEventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Normal; Invalidate(); } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetDivider.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetDivider), "Bitmaps.Divider.bmp")] [Designer(typeof(MetroSetDividerDesigner))] [DefaultProperty("Orientation")] [ComVisible(true)] public class MetroSetDivider : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private DividerStyle _orientation; private int _thickness; #endregion Internal Vars #region Constructors public MetroSetDivider() { SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _utl = new Utilites(); ApplyTheme(); Orientation = DividerStyle.Horizontal; } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: Thickness = 1; ForeColor = Color.Black; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: Thickness = 1; ForeColor = Color.FromArgb(170, 170, 170); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.DividerDictionary) { switch (varkey.Key) { case "Orientation": if ((string)varkey.Value == "Horizontal") { Orientation = DividerStyle.Horizontal; } else if ((string)varkey.Value == "Vertical") { Orientation = DividerStyle.Vertical; } break; case "Thickness": Thickness = ((int)varkey.Value); break; case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion ApplyTheme #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; using (var p = new Pen(ForeColor, Thickness)) { if (Orientation == DividerStyle.Horizontal) g.DrawLine(p, 0, Thickness, Width, Thickness); else g.DrawLine(p, Thickness, 0, Thickness, Height); } } #endregion Draw Control #region Properties /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets Orientation of the control.")] public DividerStyle Orientation { get { return _orientation; } set { _orientation = value; Refresh(); } } /// /// Gets or sets the divider thickness. /// [Category("MetroSet Framework"), Description("Gets or sets the divider thickness.")] public int Thickness { get { return _thickness; } set { _thickness = value; Refresh(); } } /// /// I make BackColor inaccessible cause I want it to be just transparent and I used another property for the same job in following properties. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Events /// /// Here we handle the width and height while resizing. /// /// protected override void OnResize(EventArgs e) { base.OnResize(e); if (Orientation == DividerStyle.Horizontal) { Height = Thickness + 3; } else { Width = Thickness + 3; } } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetEllipse.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetEllipse), "Bitmaps.Ellipse.bmp")] [Designer(typeof(MetroSetEllipseDesigner))] [DefaultEvent("Click")] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetEllipse : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private MouseMode _state; private Style _style; private StyleManager _styleManager; private int _borderThickness = 7; private Image _image; private Size _imageSize = new Size(64, 64); private Color _normalColor; private Color _normalBorderColor; private Color _normalTextColor; private Color _hoverColor; private Color _hoverBorderColor; private Color _hoverTextColor; private Color _pressColor; private Color _pressBorderColor; private Color _pressTextColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetEllipse() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); _utl = new Utilites(); _mth = new Methods(); ApplyTheme(); } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(BorderThickness, BorderThickness, Width - ((BorderThickness * 2) + 1), Height - ((BorderThickness * 2) + 1)); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; switch (_state) { case MouseMode.Normal: using (var bg = new SolidBrush(NormalColor)) using (var p = new Pen(NormalBorderColor, BorderThickness)) using (var tb = new SolidBrush(NormalTextColor)) { g.FillEllipse(bg, r); g.DrawEllipse(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Hovered: Cursor = Cursors.Hand; using (var bg = new SolidBrush(HoverColor)) using (var p = new Pen(HoverBorderColor, BorderThickness)) using (var tb = new SolidBrush(HoverTextColor)) { g.FillEllipse(bg, r); g.DrawEllipse(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Pushed: using (var bg = new SolidBrush(PressColor)) using (var p = new Pen(PressBorderColor, BorderThickness)) using (var tb = new SolidBrush(PressTextColor)) { g.FillEllipse(bg, r); g.DrawEllipse(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; case MouseMode.Disabled: using (var bg = new SolidBrush(DisabledBackColor)) using (var p = new Pen(DisabledBorderColor, BorderThickness)) using (var tb = new SolidBrush(DisabledForeColor)) { g.FillEllipse(bg, r); g.DrawEllipse(p, r); g.DrawString(Text, Font, tb, new Rectangle(0, 0, Width, Height), _mth.SetPosition()); } break; default: throw new ArgumentOutOfRangeException(); } if (Image == null) return; var imgRect = new Rectangle(new Point((Width - ImageSize.Width) / 2, (Height - ImageSize.Height) / 2), ImageSize); g.DrawImage(Image, imgRect); } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: NormalColor = Color.FromArgb(238, 238, 238); NormalBorderColor = Color.FromArgb(204, 204, 204); NormalTextColor = Color.Black; HoverColor = Color.FromArgb(102, 102, 102); HoverBorderColor = Color.FromArgb(102, 102, 102); HoverTextColor = Color.White; PressColor = Color.FromArgb(51, 51, 51); PressBorderColor = Color.FromArgb(51, 51, 51); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: NormalColor = Color.FromArgb(32, 32, 32); NormalBorderColor = Color.FromArgb(64, 64, 64); NormalTextColor = Color.FromArgb(204, 204, 204); HoverColor = Color.FromArgb(170, 170, 170); HoverBorderColor = Color.FromArgb(170, 170, 170); HoverTextColor = Color.White; PressColor = Color.FromArgb(240, 240, 240); PressBorderColor = Color.FromArgb(240, 240, 240); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.EllipseDictionary) { if ((varkey.Key == null) || varkey.Key == null) { return; } if (varkey.Key == "NormalColor") { NormalColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "NormalBorderColor") { NormalBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "NormalTextColor") { NormalTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverColor") { HoverColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverBorderColor") { HoverBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverTextColor") { HoverTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressColor") { PressColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressBorderColor") { PressBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressTextColor") { PressTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledBackColor") { DisabledBackColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledBorderColor") { DisabledBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledForeColor") { DisabledForeColor = _utl.HexColor((string)varkey.Value); } } Refresh(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion Theme Changing #region Properties /// /// I make BackColor inaccessible cause we have not use of it. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the border thickness with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the border thickness associated with the control.")] public int BorderThickness { get { return _borderThickness; } set { _borderThickness = value; Refresh(); } } /// /// Handling Control Enable state to detect the disability state. /// [Category("MetroSet Framework")] public new bool Enabled { get => base.Enabled; set { base.Enabled = value; if (value == false) { _state = MouseMode.Disabled; } Invalidate(); } } /// /// Gets or sets the image associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the image associated with the control.")] public Image Image { get { return _image; } set { _image = value; Refresh(); } } /// /// Gets or sets the image size associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the image size associated with the control.")] public Size ImageSize { get { return _imageSize; } set { _imageSize = value; Refresh(); } } /// /// Gets or sets the control background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in normal mouse sate.")] public Color NormalColor { get { return _normalColor; } set { _normalColor = value; Refresh(); } } /// /// Gets or sets the control border color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in normal mouse sate.")] public Color NormalBorderColor { get { return _normalBorderColor; } set { _normalBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in normal mouse sate.")] public Color NormalTextColor { get { return _normalTextColor; } set { _normalTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in hover mouse sate.")] public Color HoverColor { get { return _hoverColor; } set { _hoverColor = value; Refresh(); } } /// /// Gets or sets the control border color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in hover mouse sate.")] public Color HoverBorderColor { get { return _hoverBorderColor; } set { _hoverBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in hover mouse sate.")] public Color HoverTextColor { get { return _hoverTextColor; } set { _hoverTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in pushed mouse sate.")] public Color PressColor { get { return _pressColor; } set { _pressColor = value; Refresh(); } } /// /// Gets or sets the control border color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in pushed mouse sate.")] public Color PressBorderColor { get { return _pressBorderColor; } set { _pressBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in pushed mouse sate.")] public Color PressTextColor { get { return _pressTextColor; } set { _pressTextColor = value; Refresh(); } } /// /// Gets or sets BackColor used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets backcolor used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the ForeColor of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events /// /// Handling mouse up event of the control. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// MouseEventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Normal; Invalidate(); } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetLabel.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetLabel), "Bitmaps.Label.bmp")] [Designer(typeof(MetroSetLabelDesigner))] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetLabel : Label, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private Methods mth; private Utilites utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; #endregion Internal Vars #region Constructors public MetroSetLabel() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); mth = new Methods(); utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackColor = Color.Transparent; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackColor = Color.Transparent; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.LabelDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Properties /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } /// /// Gets or sets the form BackColor. /// [Category("MetroSet Framework"), Description("Gets or sets the form backcolor.")] public override Color BackColor { get; set; } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties } } ================================================ FILE: MetroSet UI/Controls/MetroSetLink.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetLink), "Bitmaps.LinkLabel.bmp")] [Designer(typeof(MetroSetLinkDesigner))] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetLink : LinkLabel, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; #endregion Internal Vars #region Constructors public MetroSetLink() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true ); UpdateStyles(); base.Font = MetroSetFonts.Light(10); base.Cursor = Cursors.Hand; _utl = new Utilites(); _style = Style.Dark; ApplyTheme(); LinkBehavior = LinkBehavior.HoverUnderline; } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackColor = Color.Transparent; ActiveLinkColor = Color.FromArgb(85, 197, 245); LinkColor = Color.FromArgb(65, 177, 225); VisitedLinkColor = Color.FromArgb(45, 157, 205); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackColor = Color.Transparent; ActiveLinkColor = Color.FromArgb(85, 197, 245); LinkColor = Color.FromArgb(65, 177, 225); VisitedLinkColor = Color.FromArgb(45, 157, 205); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.LinkLabelDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "LinkColor": LinkColor = _utl.HexColor((string)varkey.Value); break; case "ActiveLinkColor": ActiveLinkColor = _utl.HexColor((string)varkey.Value); break; case "VisitedLinkColor": VisitedLinkColor = _utl.HexColor((string)varkey.Value); break; case "LinkBehavior": switch ((string)varkey.Value) { case "HoverUnderline": LinkBehavior = LinkBehavior.HoverUnderline; break; case "AlwaysUnderline": LinkBehavior = LinkBehavior.AlwaysUnderline; break; case "NeverUnderline": LinkBehavior = LinkBehavior.NeverUnderline; break; case "SystemDefault": LinkBehavior = LinkBehavior.SystemDefault; break; } break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion ApplyTheme #region Events /// /// Here we set the smooth mouse hand. /// /// protected override void WndProc(ref Message m) { _utl.SmoothCursor(ref m); base.WndProc(ref m); } #endregion #region Properties /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } = Color.Black; /// /// Gets or sets the form BackColor. /// [Category("MetroSet Framework"), Description("Gets or sets the form backcolor.")] public override Color BackColor { get; set; } = Color.Transparent; /// /// Gets or sets LinkColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets LinkColor used by the control.")] public new Color LinkColor { get; set; } = Color.FromArgb(65, 177, 225); /// /// Gets or sets ActiveLinkColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets ActiveLinkColor used by the control.")] public new Color ActiveLinkColor { get; set; } = Color.FromArgb(85, 197, 245); /// /// Gets or sets VisitedLinkColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets VisitedLinkColor used by the control.")] public new Color VisitedLinkColor { get; set; } = Color.FromArgb(45, 157, 205); /// /// Gets or sets LinkBehavior used by the control /// [Category("MetroSet Framework"), Description("Gets or sets LinkBehavior used by the control.")] public new LinkBehavior LinkBehavior { get; set; } /// /// Gets or sets DisabledLinkColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets DisabledLinkColor used by the control.")] public new Color DisabledLinkColor { get; set; } = Color.FromArgb(133, 133, 133); private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties } } ================================================ FILE: MetroSet UI/Controls/MetroSetListBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Child; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetListBox), "Bitmaps.ListBox.bmp")] [Designer(typeof(MetroSetListBoxDesigner))] [DefaultProperty("Items")] [DefaultEvent("SelectedIndexChanged")] [ComVisible(true)] public class MetroSetListBox : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } _svs.Style = value; Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private MetroSetItemCollection _items; private List _selectedItems; private List _indicates; private bool _multiSelect; private int _selectedIndex; private object _selectedItem; private string _selectedText; private bool _showScrollBar; private bool _multiKeyDown; private int _hoveredItem; private MetroSetScrollBar _svs; private object _selectedValue; private int _itemHeight; private bool _showBorder; private Color _selectedItemColor; private Color _selectedItemBackColor; private Color _hoveredItemColor; private Color _hoveredItemBackColor; private Color _disabledForeColor; private Color _disabledBackColor; private Color _borderColor; #endregion Internal Vars #region Constructors public MetroSetListBox() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Selectable | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.BackColor = Color.Transparent; base.Font = MetroSetFonts.Light(10); _utl = new Utilites(); ApplyTheme(); SetDefaults(); } private void SetDefaults() { SelectedIndex = -1; _hoveredItem = -1; _showScrollBar = false; _items = new MetroSetItemCollection(); _items.ItemUpdated += InvalidateScroll; _selectedItems = new List(); _indicates = new List(); ItemHeight = 30; _multiKeyDown = false; _svs = new MetroSetScrollBar() { Orientation = ScrollOrientate.Vertical, Size = new Size(12, Height), Maximum = _items.Count * ItemHeight, SmallChange = 1, LargeChange = 5 }; _svs.Scroll += HandleScroll; _svs.MouseDown += VS_MouseDown; _svs.BackColor = Color.Transparent; if (!Controls.Contains(_svs)) { Controls.Add(_svs); } } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackColor = Color.White; SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemColor = Color.White; HoveredItemColor = Color.DimGray; HoveredItemBackColor = Color.LightGray; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledForeColor = Color.FromArgb(136, 136, 136); BorderColor = Color.LightGray; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackColor = Color.FromArgb(30, 30, 30); SelectedItemBackColor = Color.FromArgb(65, 177, 225); SelectedItemColor = Color.White; HoveredItemColor = Color.DimGray; HoveredItemBackColor = Color.LightGray; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledForeColor = Color.FromArgb(109, 109, 109); BorderColor = Color.FromArgb(64, 64, 64); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ListBoxDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; case "HoveredItemBackColor": HoveredItemBackColor = _utl.HexColor((string)varkey.Value); break; case "HoveredItemColor": HoveredItemColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemBackColor": SelectedItemBackColor = _utl.HexColor((string)varkey.Value); break; case "SelectedItemColor": SelectedItemColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion ApplyTheme #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; var mainRect = new Rectangle(0, 0, Width - (ShowBorder ? 1 : 0), Height - (ShowBorder ? 1 : 0)); using (var bg = new SolidBrush(Enabled ? BackColor : DisabledBackColor)) { using (var usic = new SolidBrush(Enabled ? ForeColor : DisabledForeColor)) { using (var sic = new SolidBrush(SelectedItemColor)) { using (var sibc = new SolidBrush(SelectedItemBackColor)) { using (var hic = new SolidBrush(HoveredItemColor)) { using (var hibc = new SolidBrush(HoveredItemBackColor)) { using (var sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }) { var firstItem = _svs.Value / ItemHeight < 0 ? 0 : _svs.Value / ItemHeight; var lastItem = _svs.Value / ItemHeight + Height / ItemHeight + 1 > Items.Count ? Items.Count : _svs.Value / ItemHeight + Height / ItemHeight + 1; g.FillRectangle(bg, mainRect); for (var i = firstItem; i < lastItem; i++) { var itemText = (string)Items[i]; var rect = new Rectangle(5, (i - firstItem) * ItemHeight, Width - 1, ItemHeight); g.DrawString(itemText, Font, usic, rect, sf); if (MultiSelect && _indicates.Count != 0) { if (i == _hoveredItem && !_indicates.Contains(i)) { g.FillRectangle(hibc, rect); g.DrawString(itemText, Font, hic, rect, sf); } else if (_indicates.Contains(i)) { g.FillRectangle(sibc, rect); g.DrawString(itemText, Font, sic, rect, sf); } } else { if (i == _hoveredItem && i != SelectedIndex) { g.FillRectangle(hibc, rect); g.DrawString(itemText, Font, hic, rect, sf); } else if (i == SelectedIndex) { g.FillRectangle(sibc, rect); g.DrawString(itemText, Font, sic, rect, sf); } } } if (ShowBorder) g.DrawRectangle(Pens.LightGray, mainRect); } } } } } } } } #endregion Draw Control #region Properties /// /// Gets the items of the ListBox. /// [TypeConverter(typeof(CollectionConverter))] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing")] [Category("MetroSet Framework"), Description("Gets the items of the ListBox.")] public MetroSetItemCollection Items => _items; /// /// Gets a collection containing the currently selected items in the ListBox. /// [Browsable(false)] [Category("MetroSet Framework"), Description("Gets a collection containing the currently selected items in the ListBox.")] public List SelectedItems => _selectedItems; /// /// Gets or sets the height of an item in the ListBox. /// [Category("MetroSet Framework"), Description("Gets or sets the height of an item in the ListBox.")] public int ItemHeight { get { return _itemHeight; } set { _itemHeight = value; Refresh(); } } /// /// Gets or sets the currently selected item in the ListBox. /// [Browsable(false), Category("MetroSet Framework"), Description("Gets or sets the currently selected item in the ListBox.")] public object SelectedItem { get => _selectedItem; set { _selectedItem = value; Invalidate(); } } /// /// Gets or sets the currently selected item in the ListBox. /// [Browsable(false), Category("MetroSet Framework"), Description("Gets or sets the currently selected Text in the ListBox.")] public string SelectedText { get => _selectedText; set { _selectedText = value; Invalidate(); } } /// /// Gets or sets the zero-based index of the currently selected item in a ListBox. /// [Browsable(false), Category("MetroSet Framework"), Description("Gets or sets the zero-based index of the currently selected item in a ListBox.")] public int SelectedIndex { get => _selectedIndex; set { _selectedIndex = value; Invalidate(); } } /// /// Gets or sets the value of the member property specified by the ValueMember propert. /// [Browsable(true), Category("MetroSet Framework"), Description("Gets or sets the value of the member property specified by the ValueMember property.")] public object SelectedValue { get => _selectedValue; set { _selectedValue = value; Invalidate(); } } /// /// Gets or sets a value indicating whether the ListBox supports multiple rows. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the ListBox supports multiple rows.")] public bool MultiSelect { get => _multiSelect; set { _multiSelect = value; if (_selectedItems.Count > 1) _selectedItems.RemoveRange(1, _selectedItems.Count - 1); Invalidate(); } } /// /// Gets the the number of items stored in items collection. /// [Browsable(false)] public int Count => _items.Count; /// /// Gets or sets a value indicating whether the vertical scroll bar is shown or not. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the vertical scroll bar be shown or not.")] public bool ShowScrollBar { get => _showScrollBar; set { _showScrollBar = value; _svs.Visible = value; Invalidate(); } } /// /// Gets or sets a value indicating whether the border shown or not. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the border shown or not.")] public bool ShowBorder { get { return _showBorder; } set { _showBorder = value; Refresh(); } } /// /// Gets or sets BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets backcolor used by the control.")] public override Color BackColor { get; set; } /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets forecolor used by the control.")] public override Color ForeColor { get; set; } [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public override string Text { get => base.Text; set => base.Text = value; } /// /// Gets or sets selected item used by the control /// [Category("MetroSet Framework"), Description("Gets or sets selected item used by the control.")] public Color SelectedItemColor { get { return _selectedItemColor; } set { _selectedItemColor = value; Refresh(); } } /// /// Gets or sets selected item backcolor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets selected item backcolor used by the control.")] public Color SelectedItemBackColor { get { return _selectedItemBackColor; } set { _selectedItemBackColor = value; Refresh(); } } /// /// Gets or sets hovered item used by the control /// [Category("MetroSet Framework"), Description("Gets or sets hovered item used by the control.")] public Color HoveredItemColor { get { return _hoveredItemColor; } set { _hoveredItemColor = value; Refresh(); } } /// /// Gets or sets hovered item BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets hovered item backcolor used by the control.")] public Color HoveredItemBackColor { get { return _hoveredItemBackColor; } set { _hoveredItemBackColor = value; Refresh(); } } /// /// Gets or sets disabled ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled forecolor used by the control.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets disabled BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets border color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets border color used by the control.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Methods /// /// Adds an item to collection. /// /// The Item to be added into the collection. public void AddItem(string newItem) { _items.Add(newItem); InvalidateScroll(this, null); } /// /// Adds the multiply items to collection. /// /// Items to be added into the collection. public void AddItems(string[] newItems) { foreach (var str in newItems) { AddItem(str); } InvalidateScroll(this, null); } /// /// Removes the element at the specified index of the collection. /// /// The Index as the start point of removing. public void RemoveItemAt(int index) { _items.RemoveAt(index); InvalidateScroll(this, null); } /// /// Removes an item from collection. /// /// The Item to remove in collection. public void RemoveItem(string item) { _items.Remove(item); InvalidateScroll(this, null); } /// /// Gets the index of the item. /// /// The Item. /// index of the item. public int IndexOf(string value) { return _items.IndexOf(value); } /// /// Gets whether the collection contains a specific item. /// /// The Item to check whether exist in collection. /// Whether the collection contains a specific item. public bool Contains(object item) { return _items.Contains(item.ToString()); } /// /// Removes multiply items in collection. /// /// Items to be removed in collection. public void RemoveItems(string[] itemsToRemove) { foreach (var item in itemsToRemove) { _items.Remove(item); } InvalidateScroll(this, null); } /// /// Clears the collection. /// public void Clear() { for (var i = _items.Count - 1; i >= 0; i += -1) { _items.RemoveAt(i); } InvalidateScroll(this, null); } #endregion Methods #region Events public event SelectedIndexChangedEventHandler SelectedIndexChanged; public delegate void SelectedIndexChangedEventHandler(object sender); public event SelectedValueEventHandler SelectedValueChanged; public delegate void SelectedValueEventHandler(object sender); /// /// Here we update the scrollbar and it's properties while user resizes the ListBox. /// /// protected override void OnSizeChanged(EventArgs e) { InvalidateScroll(this, e); InvalidateLayout(); base.OnSizeChanged(e); } /// /// Here we will handle the selection item(s). /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { Focus(); if (e.Button == MouseButtons.Left) { var index = _svs.Value / ItemHeight + e.Location.Y / ItemHeight; if (index >= 0 && index < _items.Count) { if (MultiSelect && _multiKeyDown) { _indicates.Add(index); _selectedItems.Add(Items[index]); } else { _indicates.Clear(); _selectedItems.Clear(); _selectedItem = Items[index]; _selectedIndex = index; _selectedValue = Items[index]; _selectedText = Items[index].ToString(); SelectedIndexChanged?.Invoke(this); SelectedValueChanged?.Invoke(this); } } Invalidate(); } base.OnMouseDown(e); } /// /// The Method to update the scrollbar. /// /// object private void HandleScroll(object sender) { Invalidate(); } /// /// The Method to update the Scrollbar maximum property. /// /// /// EventArgs private void InvalidateScroll(object sender, EventArgs e) { _svs.Maximum = _items.Count * ItemHeight; Invalidate(); } /// /// Here here we put scrollbar on focus while mouse clicked. /// /// object /// MouseEventArgs private void VS_MouseDown(object sender, MouseEventArgs e) { Focus(); } /// /// The Method to update the size and location of the scrollbar. /// private void InvalidateLayout() { _svs.Size = new Size(12, Height - (ShowBorder ? 2 : 0)); _svs.Location = new Point(Width - (_svs.Width + (ShowBorder ? 2 : 0)), ShowBorder ? 1 : 0); Invalidate(); } /// /// Here we handle the mouse wheel. /// /// protected override void OnMouseWheel(MouseEventArgs e) { _svs.Value -= e.Delta / 4; base.OnMouseWheel(e); } /// /// Gets the Key that has been pressed by the user. /// /// /// The Key that has been pressed. protected override bool IsInputKey(Keys keyData) { switch (keyData) { case Keys.Down: try { _selectedItems.Remove(_items[SelectedIndex]); SelectedIndex += 1; _selectedItems.Add(_items[SelectedIndex]); } catch { // } break; case Keys.Up: try { _selectedItems.Remove(_items[SelectedIndex]); SelectedIndex -= 1; _selectedItems.Add(_items[SelectedIndex]); } catch { // } break; } Invalidate(); return base.IsInputKey(keyData); } /// /// Here we set the handle the hovering. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); Cursor = Cursors.Hand; var index = _svs.Value / ItemHeight + e.Location.Y / ItemHeight; if (index >= Items.Count) index = -1; if (index >= 0 && index < Items.Count) { _hoveredItem = index; } Invalidate(); } /// /// Here we release the mouse state and hovering item to avoid filckering. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { _hoveredItem = -1; Cursor = Cursors.Default; Invalidate(); base.OnMouseLeave(e); } /// /// Here we put the scrollbar on right of the list box and also update the the thumb size of the scrollbar. /// /// Events protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); _svs.Location = new Point(Width - (_svs.Width + (ShowBorder ? 2 : 0)), ShowBorder ? 1 : 0); InvalidateScroll(this, e); } /// /// Here we set the smooth mouse hand. /// /// protected override void WndProc(ref Message m) { if (m.Msg == User32.WM_SETCURSOR) { User32.SetCursor(User32.LoadCursor(IntPtr.Zero, User32.IDC_HAND)); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetNumeric.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; using Timer = System.Timers.Timer; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetNumeric), "Bitmaps.Numeric.bmp")] [Designer(typeof(MetroSetNumericDesigner))] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetNumeric : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private Point _point; private int _value; private readonly Timer _holdTimer; private int _maximum = 100; private int _minimum; private Color _backgroundColor; private Color _disabledForeColor; private Color _disabledBackColor; private Color _disabledBorderColor; private Color _borderColor; private Color _symbolsColor; #endregion Internal Vars #region Constructors public MetroSetNumeric() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.SemiLight(10); BackColor = Color.Transparent; _mth = new Methods(); _utl = new Utilites(); ApplyTheme(); _point = new Point(0, 0); _holdTimer = new Timer() { Interval = 10, AutoReset = true, Enabled = false }; _holdTimer.Elapsed += HoldTimer_Tick; } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; var rect = new Rectangle(0, 0, Width - 1, Height - 1); const char plus = '+'; const char minus = '-'; using (var bg = new SolidBrush(Enabled ? BackColor : DisabledBackColor)) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor)) { using (var s = new SolidBrush(Enabled ? SymbolsColor : DisabledForeColor)) { using (var tb = new SolidBrush(Enabled ? ForeColor : DisabledForeColor)) { using (var f2 = MetroSetFonts.SemiBold(18)) { using (var sf = new StringFormat { LineAlignment = StringAlignment.Center }) { g.FillRectangle(bg, rect); g.DrawString(plus.ToString(), f2, s, new Rectangle(Width - 45, 1, 25, Height - 1), sf); g.DrawString(minus.ToString(), f2, s, new Rectangle(Width - 25, -1, 20, Height - 1), sf); g.DrawString(Value.ToString(), Font, tb, new Rectangle(0, 0, Width - 50, Height - 1), _mth.SetPosition(StringAlignment.Far)); g.DrawRectangle(p, rect); } } } } } } } #endregion #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(20, 20, 20); BackColor = Color.White; BorderColor = Color.FromArgb(150, 150, 150); SymbolsColor = Color.FromArgb(128, 128, 128); DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(204, 204, 204); BackColor = Color.FromArgb(34, 34, 34); BorderColor = Color.FromArgb(110, 110, 110); SymbolsColor = Color.FromArgb(110, 110, 110); DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.NumericDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "SymbolsColor": SymbolsColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Properties /// /// Gets or sets the maximum number of the Numeric. /// [Category("MetroSet Framework"), Description("Gets or sets the maximum number of the Numeric.")] public int Maximum { get { return _maximum; } set { _maximum = value; Refresh(); } } /// /// Gets or sets the minimum number of the Numeric. /// [Category("MetroSet Framework"), Description("Gets or sets the minimum number of the Numeric.")] public int Minimum { get { return _minimum; } set { _minimum = value; Refresh(); } } /// /// Gets or sets the current number of the Numeric. /// [Category("MetroSet Framework"), Description("Gets or sets the current number of the Numeric.")] public int Value { get => _value; set { if (value <= Maximum & value >= Minimum) _value = value; Invalidate(); } } [Browsable(false)] public sealed override Color BackColor => Color.Transparent; /// /// Gets or sets the control backcolor. /// [Category("MetroSet Framework"), Description("Gets or sets the control backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the forecolor of the control whenever while disabled /// [Category("MetroSet Framework"), Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets disabled backcolor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the border color. /// [Category("MetroSet Framework"), Description("Gets or sets the border color.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets ForeColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets forecolor used by the control.")] public override Color ForeColor { get; set; } /// /// Gets or sets arrow color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets arrow color used by the control.")] public Color SymbolsColor { get { return _symbolsColor; } set { _symbolsColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events /// /// Handling the mouse moving event so that we can detect if the cursor located in the postion of our need. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); _point = e.Location; Invalidate(); Cursor = _point.X > Width - 50 ? Cursors.Hand : Cursors.IBeam; } /// /// Handling on click event so that we can increase or decrease the value. /// /// EventArgs protected override void OnClick(EventArgs e) { base.OnClick(e); Revaluate(); } /// /// Here we set the smooth mouse hand. /// /// protected override void WndProc(ref Message m) { if (m.Msg == User32.WM_SETCURSOR) { User32.SetCursor(User32.LoadCursor(IntPtr.Zero, User32.IDC_HAND)); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); } /// /// Here we handle the height of the control while resizing, we provide the fixed height. /// /// protected override void OnResize(EventArgs e) { base.OnResize(e); Height = 26; } protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (_point.X <= Width - 45 || _point.X >= Width - 3) return; if (e.Button == MouseButtons.Left) { _holdTimer.Enabled = true; } Invalidate(); } protected override void OnMouseUp(MouseEventArgs e) { _holdTimer.Enabled = false; } private void HoldTimer_Tick(object sender, EventArgs args) { Revaluate(); } private void Revaluate() { if (_point.X <= Width - 45 || _point.X >= Width - 3) return; if (_point.X > Width - 45 && _point.X < Width - 25) { if (Value + 1 <= Maximum) Value += 1; } else { if (Value - 1 >= Minimum) Value -= 1; } } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetPanel.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetPanel), "Bitmaps.Panel.bmp")] [ComVisible(true)] public class MetroSetPanel : Panel, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private int _borderThickness = 1; private Color _borderColor; private Color _backgroundColor; #endregion Internal Vars #region Constructors public MetroSetPanel() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); BorderStyle = BorderStyle.None; UpdateStyles(); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: BorderColor = Color.FromArgb(150, 150, 150); BackgroundColor = Color.White; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: BorderColor = Color.FromArgb(110, 110, 110); BackgroundColor = Color.FromArgb(30, 30, 30); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.LabelDictionary) { switch (varkey.Key) { case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(BorderThickness, BorderThickness, Width - (BorderThickness * 2 + 1), Height - ((BorderThickness * 2) + 1)); using (var bg = new SolidBrush(BackgroundColor)) { using (var p = new Pen(BorderColor, BorderThickness)) { g.FillRectangle(bg, r); g.DrawRectangle(p, r); } } } #endregion #region Properties /// /// Gets the background color. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets the foreground color. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color ForeColor => Color.Transparent; /// /// Gets or sets the border style. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new BorderStyle BorderStyle; /// /// Gets or sets the border thickness the control. /// [Category("MetroSet Framework"), Description("Gets or sets the border thickness the control.")] public int BorderThickness { get { return _borderThickness; } set { _borderThickness = value; Refresh(); } } /// /// Gets or sets BorderColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets bordercolor used by the control.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets backcolor used by the control.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetProgressBar.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetProgressBar), "Bitmaps.Progress.bmp")] [Designer(typeof(MetroSetProgressBarDesigner))] [DefaultEvent("ValueChanged")] [DefaultProperty("Value")] [ComVisible(true)] public class MetroSetProgressBar : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private int _value; private int _currentValue; private int _maximum = 100; private int _minimum; private ProgressOrientation _orientation = ProgressOrientation.Horizontal; private Color _backgroundColor; private Color _borderColor; private Color _progressColor; private Color _disabledProgressColor; private Color _disabledBackColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetProgressBar() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ProgressColor = Color.FromArgb(65, 177, 225); BorderColor = Color.FromArgb(238, 238, 238); BackgroundColor = Color.FromArgb(238, 238, 238); DisabledProgressColor = Color.FromArgb(120, 65, 177, 225); DisabledBorderColor = Color.FromArgb(238, 238, 238); DisabledBackColor = Color.FromArgb(238, 238, 238); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ProgressColor = Color.FromArgb(65, 177, 225); BackgroundColor = Color.FromArgb(38, 38, 38); BorderColor = Color.FromArgb(38, 38, 38); DisabledProgressColor = Color.FromArgb(120, 65, 177, 225); DisabledBackColor = Color.FromArgb(38, 38, 38); DisabledBorderColor = Color.FromArgb(38, 38, 38); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ProgressDictionary) { switch (varkey.Key) { case "ProgressColor": ProgressColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledProgressColor": DisabledProgressColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var rect = new Rectangle(0, 0, Width - 1, Height - 1); using (var bg = new SolidBrush(Enabled ? BackgroundColor : DisabledBackColor)) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor)) { using (var ps = new SolidBrush(Enabled ? ProgressColor : DisabledProgressColor)) { g.FillRectangle(bg, rect); if (_currentValue != 0) { switch (Orientation) { case ProgressOrientation.Horizontal: g.FillRectangle(ps, new Rectangle(0, 0, _currentValue - 1, Height - 1)); break; case ProgressOrientation.Vertical: g.FillRectangle(ps, new Rectangle(0, Height - _currentValue, Width - 1, _currentValue - 1)); break; default: throw new ArgumentOutOfRangeException(); } } g.DrawRectangle(p, rect); } } } } #endregion #region Properties /// /// Gets or sets the current position of the progressbar. /// [Category("MetroSet Framework"), Description("Gets or sets the current position of the progressbar.")] public int Value { get => _value < 0 ? 0 : _value; set { if (value > Maximum) { value = Maximum; } _value = value; RenewCurrentValue(); ValueChanged?.Invoke(this); Invalidate(); } } /// /// Gets or sets the maximum value of the progressbar. /// [Category("MetroSet Framework"), Description("Gets or sets the maximum value of the progressbar.")] public int Maximum { get { return _maximum; } set { _maximum = value; Refresh(); } } /// /// Gets or sets the minimum value of the progressbar. /// [Category("MetroSet Framework"), Description("Gets or sets the minimum value of the progressbar.")] public int Minimum { get { return _minimum; } set { _minimum = value; Refresh(); } } [Browsable(false)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the minimum value of the progressbar. /// [Category("MetroSet Framework"), Description("Gets or sets the minimum value of the progressbar.")] public ProgressOrientation Orientation { get { return _orientation; } set { _orientation = value; Refresh(); } } /// /// Gets or sets the control BackColor. /// [Category("MetroSet Framework"), Description("Gets or sets the control backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the border color. /// [Category("MetroSet Framework"), Description("Gets or sets the border color.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets the progress color of the control. /// [Category("MetroSet Framework"), Description("Gets or sets the progress color of the control.")] public Color ProgressColor { get { return _progressColor; } set { _progressColor = value; Refresh(); } } /// /// Gets or sets the Progress color of the control whenever while disabled /// [Category("MetroSet Framework"), Description("Gets or sets the progresscolor of the control whenever while disabled.")] public Color DisabledProgressColor { get { return _disabledProgressColor; } set { _disabledProgressColor = value; Refresh(); } } /// /// Gets or sets disabled BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events public event ValueChangedEventHandler ValueChanged; public delegate void ValueChangedEventHandler(object sender); /// /// Here we handle the current value. /// private void RenewCurrentValue() { if (Orientation == ProgressOrientation.Horizontal) _currentValue = (int)Math.Round((Value - Minimum) / (double)(Maximum - Minimum) * (Width - 1)); else _currentValue = Convert.ToInt32(Value / (double)Maximum * Height - 1); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetRadioButton.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Animates; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetRadioButton), "Bitmaps.RadioButton.bmp")] [Designer(typeof(MetroSetRadioButtonDesigner))] [DefaultEvent("CheckedChanged")] [DefaultProperty("Checked")] [ComVisible(true)] public class MetroSetRadioButton : Control, IMetroSetControl, IDisposable { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private bool _checked; private IntAnimate _animator; private int _group; private Color _backgroundColor; private Color _borderColor; private Color _disabledBorderColor; private Color _checkSignColor; #endregion Internal Vars #region Constructors public MetroSetRadioButton() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.SemiBold(10); _utl = new Utilites(); _animator = new IntAnimate(); _animator.Setting(100, 0, 255); _animator.Update = (alpha) => Invalidate(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackgroundColor = Color.White; BorderColor = Color.FromArgb(155, 155, 155); DisabledBorderColor = Color.FromArgb(205, 205, 205); CheckSignColor = Color.FromArgb(65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackgroundColor = Color.FromArgb(30, 30, 30); BorderColor = Color.FromArgb(155, 155, 155); DisabledBorderColor = Color.FromArgb(85, 85, 85); CheckSignColor = Color.FromArgb(65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.RadioButtonDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "CheckColor": CheckSignColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { try { ForeColor = ForeColor; Invalidate(); } catch (Exception ex) { throw new Exception(ex.StackTrace); } } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.SmoothingMode = SmoothingMode.AntiAlias; var rect = new Rectangle(0, 0, 17, 16); var alpha = _animator.Value; using (var backBrush = new SolidBrush(Enabled ? BackgroundColor : Color.FromArgb(238, 238, 238))) { using (var checkMarkBrush = new SolidBrush(Enabled ? Checked || _animator.Active ? Color.FromArgb(alpha, CheckSignColor) : BackgroundColor : Checked || _animator.Active ? Color.FromArgb(alpha, DisabledBorderColor) : Color.FromArgb(238, 238, 238))) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor)) { g.FillEllipse(backBrush, rect); if (Enabled) { g.DrawEllipse(p, rect); g.FillEllipse(checkMarkBrush, new Rectangle(3, 3, 11, 10)); } else { g.FillEllipse(checkMarkBrush, new Rectangle(3, 3, 11, 10)); g.DrawEllipse(p, rect); } } } } g.SmoothingMode = SmoothingMode.Default; using (var tb = new SolidBrush(ForeColor)) { using (var sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }) { g.DrawString(Text, Font, tb, new Rectangle(19, 2, Width, Height - 4), sf); } } } #endregion Draw Control #region Events public event CheckedChangedEventHandler CheckedChanged; public delegate void CheckedChangedEventHandler(object sender); /// /// Here we will handle the checking state in runtime. /// /// EventArgs protected override void OnClick(EventArgs e) { base.OnClick(e); Checked = !Checked; Invalidate(); } /// /// Here we will set the limited height for the control to avoid high and low of the text drawing. /// /// EventArgs protected override void OnResize(EventArgs e) { base.OnResize(e); Height = 17; Invalidate(); } /// /// This Methods prevents checikng two radios in the same container. /// private void UpdateState() { if (!IsHandleCreated || !Checked) return; foreach (Control c in Parent.Controls) { if (!ReferenceEquals(c, this) && c is MetroSetRadioButton && ((MetroSetRadioButton)c).Group == Group) { ((MetroSetRadioButton)c).Checked = false; } } CheckedChanged?.Invoke(this); } /// /// Here we set the mouse hand smooth. /// /// protected override void WndProc(ref Message m) { if (m.Msg == User32.WM_SETCURSOR) { User32.SetCursor(User32.LoadCursor(IntPtr.Zero, User32.IDC_HAND)); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); } #endregion Events #region Properties /// /// Gets or sets a value indicating whether the control is checked. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the control is checked.")] public bool Checked { get => _checked; set { _checked = value; CheckedChanged?.Invoke(this); _animator.Reverse(!value); UpdateState(); CheckState = value ? Enums.CheckState.Checked : Enums.CheckState.Unchecked; Invalidate(); } } /// /// Specifies the state of a control, such as a check box, that can be checked, unchecked. /// [Browsable(false)] public Enums.CheckState CheckState { get; set; } [Category("MetroSet Framework")] [DefaultValue(1)] public int Group { get { return _group; } set { _group = value; Refresh(); } } /// /// Gets or sets fore color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the control forecolor.")] public override Color ForeColor { get; set; } /// /// I make back color inaccessible cause I want it to be just transparent and I used another property for the same job in following properties. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the control back color. /// [Category("MetroSet Framework"), Description("Gets or sets the control backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the border color. /// [Category("MetroSet Framework"), Description("Gets or sets the border color.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the color of the check symbol. /// [Category("MetroSet Framework"), Description("Gets or sets the color of the check symbol.")] public Color CheckSignColor { get { return _checkSignColor; } set { _checkSignColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Disposing /// /// Disposing Methods. /// public new void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetRichTextBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetRichTextBox), "Bitmaps.RitchTextBox.bmp")] [Designer(typeof(MetroSetRichTextBoxDesigner))] [DefaultProperty("Text")] [DefaultEvent("TextChanged")] [ComVisible(true)] public class MetroSetRichTextBox : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private int _maxLength; private bool _readOnly; private MouseMode _state; private bool _wordWrap; private bool _autoWordSelection; private string[] _lines; private Color _foreColor; private Color _backColor; private Color _borderColor; private Color _hoverColor; private Color _disabledBackColor = Color.FromArgb(204, 204, 204); private Color _disabledForeColor = Color.FromArgb(136, 136, 136); private Color _disabledBorderColor = Color.FromArgb(155, 155, 155); #region Base RichTextBox private RichTextBox _richTextBox = new RichTextBox(); #endregion Base RichTextBox #endregion Internal Vars #region Constructors public MetroSetRichTextBox() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Regular(10); EvaluateVars(); ApplyTheme(); T_Defaults(); } private void EvaluateVars() { _utl = new Utilites(); } private void T_Defaults() { _wordWrap = true; _autoWordSelection = false; _foreColor = Color.FromArgb(20, 20, 20); _borderColor = Color.FromArgb(155, 155, 155); _hoverColor = Color.FromArgb(102, 102, 102); _backColor = Color.FromArgb(238, 238, 238); _richTextBox.BackColor = BackColor; _richTextBox.ForeColor = ForeColor; _readOnly = false; _maxLength = 32767; _state = MouseMode.Normal; _lines = null; _richTextBox.Cursor = Cursors.IBeam; _richTextBox.BorderStyle = BorderStyle.None; _richTextBox.Location = new Point(7, 8); _richTextBox.Font = Font; _richTextBox.Size = new Size(Width, Height); _richTextBox.MouseHover += T_MouseHover; _richTextBox.MouseUp += T_MouseUp; _richTextBox.Leave += T_Leave; _richTextBox.Enter += T_Enter; _richTextBox.KeyDown += T_KeyDown; _richTextBox.TextChanged += T_TextChanged; } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var rect = new Rectangle(0, 0, Width - 1, Height - 1); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; if (Enabled) { using (var bg = new SolidBrush(BackColor)) { using (var p = new Pen(BorderColor)) { using (var ph = new Pen(HoverColor)) { g.FillRectangle(bg, rect); switch (_state) { case MouseMode.Normal: g.DrawRectangle(p, rect); break; case MouseMode.Hovered: g.DrawRectangle(ph, rect); break; } _richTextBox.BackColor = BackColor; _richTextBox.ForeColor = ForeColor; } } } } else { using (var bg = new SolidBrush(DisabledBackColor)) { using (var p = new Pen(DisabledBorderColor)) { g.FillRectangle(bg, rect); g.DrawRectangle(p, rect); _richTextBox.BackColor = DisabledBackColor; _richTextBox.ForeColor = DisabledForeColor; } } } _richTextBox.Location = new Point(7, 4); _richTextBox.Width = Width - 10; } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(20, 20, 20); BackColor = Color.FromArgb(238, 238, 238); HoverColor = Color.FromArgb(102, 102, 102); BorderColor = Color.FromArgb(155, 155, 155); DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(204, 204, 204); BackColor = Color.FromArgb(34, 34, 34); HoverColor = Color.FromArgb(170, 170, 170); BorderColor = Color.FromArgb(110, 110, 110); DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.RichTextBoxDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "HoverColor": HoverColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } /// /// Updating properties after changing in style. /// private void UpdateProperties() { Invalidate(); _richTextBox.Invalidate(); } #endregion ApplyTheme #region Events public new event TextChangedEventHandler TextChanged; public delegate void TextChangedEventHandler(object sender); public event SelectionChangedEventHandler SelectionChanged; public delegate void SelectionChangedEventHandler(object sender, EventArgs e); public event LinkClickedEventHandler LinkClicked; public delegate void LinkClickedEventHandler(object sender, EventArgs e); public event ProtectedEventHandler Protected; public delegate void ProtectedEventHandler(object sender, EventArgs e); /// /// Handling richtextbox selection changed event and raising the same event here. /// /// object /// EventArgs private void T_SelectionChanged(object sender, EventArgs e) { SelectionChanged?.Invoke(sender, e); } /// /// Handling richtextbox link clicked event and raising the same event here. /// /// object /// EventArgs private void T_LinkClicked(object sender, EventArgs e) { LinkClicked?.Invoke(sender, e); } /// /// Handling textbox link clicked event and raising the same event here. /// /// object /// EventArgs private void T_Protected(object sender, EventArgs e) { Protected?.Invoke(sender, e); } /// /// Handling richtextbox leave event and raising the same event here. /// /// object /// EventArgs public void T_Leave(object sender, EventArgs e) { base.OnMouseLeave(e); Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); _state = MouseMode.Normal; Invalidate(); } /// /// Handling mouse up event of the control. /// /// EventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse up event /// /// object /// EventArgs public void T_MouseUp(object sender, MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Right) { if (ContextMenuStrip != null) ContextMenuStrip.Show(_richTextBox, new Point(e.X, e.Y)); } Invalidate(); } /// /// Handling mouse entering event of the control. /// /// EventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse hover event of the control. /// /// EventArgs protected override void OnMouseHover(EventArgs e) { base.OnMouseHover(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling the mouse hover event on textbox control. /// /// object /// EventArgs public void T_MouseHover(object sender, EventArgs e) { base.OnMouseHover(e); Invalidate(); } /// /// Handling the richtextbox size while resizing the control. /// /// EventArgs protected override void OnResize(EventArgs e) { base.OnResize(e); _richTextBox.Size = new Size(Width - 10, Height - 10); } /// /// Raises the Control.Enter event. /// /// object /// EventArgs public void T_Enter(object sender, EventArgs e) { base.OnMouseEnter(e); Invalidate(); } /// /// Handling Keydown event of thextbox control. /// /// object /// KeyEventArgs private void T_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.A) e.SuppressKeyPress = true; if (e.Control && e.KeyCode == Keys.C) { _richTextBox.Copy(); e.SuppressKeyPress = true; } } /// /// An System.EventArgs that contains the event data. /// /// /// private void T_TextChanged(object sender, EventArgs e) { Text = _richTextBox.Text; TextChanged?.Invoke(this); Invalidate(); } /// /// override the control creating , here we add the base textbox to the main control. /// protected override void OnCreateControl() { base.OnCreateControl(); if (!Controls.Contains(_richTextBox)) Controls.Add(_richTextBox); } /// /// Appends text to the current text of a text box. /// /// public void AppendText(string text) { if (_richTextBox != null) { _richTextBox.AppendText(text); } } /// /// Undoes the last edit operation in the text box. /// public void Undo() { if (_richTextBox != null) { if (_richTextBox.CanUndo) { _richTextBox.Undo(); } } } /// /// Retrieves the line number from the specified character position within the text of the control. /// /// /// public int GetLineFromCharIndex(int index) { if (_richTextBox != null) { return _richTextBox.GetLineFromCharIndex(index); } else { return 0; } } /// /// Retrieves the location within the control at the specified character index. /// /// /// public Point GetPositionFromCharIndex(int index) { return _richTextBox.GetPositionFromCharIndex(index); } /// /// Retrieves the index of the character nearest to the specified location. /// /// /// public int GetCharIndexFromPosition(Point pt) { if (_richTextBox == null) return 0; return _richTextBox.GetCharIndexFromPosition(pt); } /// /// Clears information about the most recent operation from the undo buffer of the text box. /// public void ClearUndo() { if (_richTextBox == null) return; _richTextBox.ClearUndo(); } /// /// Copies the current selection in the text box to the Clipboard. /// public void Copy() { if (_richTextBox == null) return; _richTextBox.Copy(); } /// /// Moves the current selection in the text box to the Clipboard. /// public void Cut() { if (_richTextBox == null) return; _richTextBox.Cut(); } /// /// Selects all text in the text box. /// public void SelectAll() { if (_richTextBox == null) return; _richTextBox.SelectAll(); } /// /// Specifies that the value of the TextBoxBase.SelectionLength property is zero so that no characters are selected in the control. /// public void DeselectAll() { if (_richTextBox == null) return; _richTextBox.DeselectAll(); } /// /// Selects a range of text in the text box. /// /// The position of the first character in the current text selection within the text box. /// The number of characters to select. public void Select(int start, int length) { if (_richTextBox == null) return; _richTextBox.Select(start, length); } /// /// Pastes the contents of the Clipboard in the specified Clipboard format. /// /// The Clipboard format in which the data should be obtained from the Clipboard. public void Paste(DataFormats.Format clipFormat) { if (_richTextBox == null) return; _richTextBox.Paste(clipFormat); } /// /// Loads a rich text format (RTF) or standard ASCII text file into the control. /// /// The name and location of the file to load into the control. public void LoadFile(string path) { if (_richTextBox == null) return; _richTextBox.LoadFile(path); } /// /// Loads a specific type of file into the control. /// /// The name and location of the file to load into the control. /// One of the System.Windows.Forms.RichTextBoxStreamType values. public void LoadFile(string path, RichTextBoxStreamType fileType) { if (_richTextBox == null) return; _richTextBox.LoadFile(path, fileType); } /// /// Loads the contents of an existing data stream into the System.Windows.Forms.RichTextBox control. /// /// TA stream of data to load into the control. /// One of the control StreamType values. public void LoadFile(System.IO.Stream data, RichTextBoxStreamType fileType) { if (_richTextBox == null) return; _richTextBox.LoadFile(data, fileType); } /// /// Saves the contents of the control to a rich text format (RTF) file. /// /// The name and location of the file to save. public void SaveFile(string path) { if (_richTextBox == null) return; _richTextBox.SaveFile(path); } /// /// Saves the contents of the control to a specific type of file. /// /// The name and location of the file to save. /// One of the control StreamType values. public void SaveFile(string path, RichTextBoxStreamType fileType) { if (_richTextBox == null) return; _richTextBox.SaveFile(path, fileType); } /// /// Saves the contents of the control to an open data stream. /// /// The data stream that contains the file to save to. /// One of the control StreamType values. public void SaveFile(System.IO.Stream data, RichTextBoxStreamType fileType) { if (_richTextBox == null) return; _richTextBox.SaveFile(data, fileType); } /// /// Determines whether you can paste information from the Clipboard in the specified data format. /// /// clipFormat: One of the System.Windows.Forms.DataFormats.Format values. /// true if you can paste data from the Clipboard in the specified data format; otherwise, false. public bool CanPaste(DataFormats.Format clipFormat) { return _richTextBox.CanPaste(clipFormat); } /// /// Searches the text of the control for the first instance of a character from a list of characters. /// /// The array of characters to search for. /// The location within the control where the search characters were found or -1 if the search characters are not found or an empty search character set is specified in the char parameter. public int Find(char[] characterSet) { if (_richTextBox == null) return 0; return _richTextBox.Find(characterSet); } /// /// Searches the text of the control, at a specific starting point, for the first instance of a character from a list of characters. /// /// The array of characters to search for. /// The location within the control's text at which to begin searching. /// The location within the control where the search characters are found. public int Find(char[] characterSet, int start) { if (_richTextBox == null) return 0; return _richTextBox.Find(characterSet, start); } /// /// Searches a range of text in the control for the first instance of a character from a list of characters. /// /// The array of characters to search for. /// The location within the control's text at which to begin searching. /// The location within the control's text at which to end searching. /// The location within the control where the search characters are found. public int Find(char[] characterSet, int start, int ends) { if (_richTextBox == null) return 0; return _richTextBox.Find(characterSet, start, ends); } /// /// Searches the text in the control for a string. /// /// The text to locate in the control. /// The location within the control where the search text was found or -1 if the search string is not found or an empty search string is specified in the str parameter. public int Find(string str) { if (_richTextBox == null) return 0; return _richTextBox.Find(str); } /// /// Searches the text in the control for a string within a range of text within the control and with specific options applied to the search. /// /// The text to locate in the control. /// The location within the control's text at which to begin searching. /// The location within the control's text at which to end searching. /// A bitwise combination of the control values. /// The location within the control where the search text was found. public int Find(string str, int start, int ends, RichTextBoxFinds options) { if (_richTextBox == null) return 0; return _richTextBox.Find(str, start, ends, options); } /// /// Searches the text in the control for a string at a specific location within the control and with specific options applied to the search. /// /// The text to locate in the control. /// A bitwise combination of the control values. /// The location within the control where the search text was found. public int Find(string str, RichTextBoxFinds options) { if (_richTextBox == null) return 0; return _richTextBox.Find(str, options); } /// /// Searches the text in the control for a string with specific options applied to the search. /// /// The text to locate in the control. /// The location within the control's text at which to begin searching. /// A bitwise combination of the control values. /// The location within the control where the search text was found. public int Find(string str, int start, RichTextBoxFinds options) { if (_richTextBox == null) return 0; return _richTextBox.Find(str, start, options); } #endregion Events #region Properties [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public BorderStyle BorderStyle => BorderStyle.None; /// /// Gets or sets how text is aligned in a TextBox control. /// [Category("MetroSet Framework"), Description("Gets or sets how text is aligned in a RichTextBox control.")] public int MaxLength { get => _maxLength; set { _maxLength = value; if (_richTextBox != null) { _richTextBox.MaxLength = value; } Invalidate(); } } /// /// Gets or sets the background color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the background color of the control.")] public override Color BackColor { get => _backColor; set { _backColor = value; _richTextBox.BackColor = value; Invalidate(); } } /// /// Gets or sets the color of the control whenever hovered. /// [Category("MetroSet Framework")] [Description("Gets or sets the color of the control whenever hovered.")] public Color HoverColor { get => _hoverColor; set { _hoverColor = value; Invalidate(); } } /// /// Gets or sets the border color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control.")] public Color BorderColor { get => _borderColor; set { _borderColor = value; Invalidate(); } } /// /// Gets or sets the foreground color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the foreground color of the control.")] [Browsable(false)] public override Color ForeColor { get => _foreColor; set { _foreColor = value; _richTextBox.ForeColor = value; Invalidate(); } } /// /// Gets or sets a value indicating whether text in the text box is read-only. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether text in the RichTextBox is read-only.")] public bool ReadOnly { get => _readOnly; set { _readOnly = value; if (_richTextBox != null) { _richTextBox.ReadOnly = value; } } } /// /// Gets or sets the background image. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override Image BackgroundImage => null; /// /// Gets or sets the current text in the TextBox. /// [Category("MetroSet Framework"), Description("Gets or sets the current text in the RichTextBox.")] public override string Text { get => _richTextBox.Text; set { base.Text = value; if (_richTextBox != null) { _richTextBox.Text = value; } } } /// /// Gets or sets the font of the text displayed by the control. /// [Category("MetroSet Framework"), Description("Gets or sets the font of the text displayed by the control.")] public override Font Font { get => base.Font; set { base.Font = value; if (_richTextBox == null) return; _richTextBox.Font = value; _richTextBox.Location = new Point(5, 5); _richTextBox.Width = Width - 8; } } /// /// Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary. /// [Category("MetroSet Framework"), Description("Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.")] public bool WordWrap { get => _wordWrap; set { _wordWrap = value; if (_richTextBox != null) { _richTextBox.WordWrap = value; } } } /// /// Gets or sets a value indicating whether automatic word selection is enabled. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether automatic word selection is enabled.")] public bool AutoWordSelection { get => _autoWordSelection; set { _autoWordSelection = value; if (_richTextBox != null) { _richTextBox.AutoWordSelection = value; } } } /// /// Gets or sets the lines of text in the control. /// [Category("MetroSet Framework"), Description("Gets or sets the lines of text in the control.")] public string[] Lines { get => _lines; set { _lines = value; if (_richTextBox != null) _richTextBox.Lines = value; Invalidate(); } } /// /// Gets or sets the ContextMenuStrip associated with this control. /// [Category("MetroSet Framework"), Description("Gets or sets the ContextMenuStrip associated with this control.")] public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set { base.ContextMenuStrip = value; if (_richTextBox == null) return; _richTextBox.ContextMenuStrip = value; Invalidate(); } } /// /// Gets or sets back color used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets back color used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the fore color of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the fore color of the control whenever while disabled")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties } } ================================================ FILE: MetroSet UI/Controls/MetroSetScrollBar.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetScrollBar), "Bitmaps.ScrollBar.bmp")] [Designer(typeof(MetroSetScrollBarDesigner))] [DefaultEvent("Scroll")] [DefaultProperty("Value")] public class MetroSetScrollBar : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private int _minimum; private int _maximum; private int _value; private int _val; private Rectangle _bar; private Rectangle _thumb; private bool _showThumb; private int _thumbSize; private MouseMode _thumbState; private int _smallChange; private int _largeChange; private ScrollOrientate _orientation; private Color _disabledForeColor; private Color _disabledBackColor; #endregion Internal Vars #region Constructors public MetroSetScrollBar() { SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.Selectable | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); SetDefaults(); _utl = new Utilites(); ApplyTheme(); } void SetDefaults() { _minimum = 0; _maximum = 100; _value = 0; _thumbSize = 20; } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(65, 177, 225); BackColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(65, 177, 225); BackColor = Color.FromArgb(30, 30, 30); DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.ScrollBarDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } public void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(0, 0, Width, Height); using (var bg = new SolidBrush(Enabled ? BackColor : DisabledBackColor)) { using (var thumbBrush = new SolidBrush(Enabled ? ForeColor : DisabledForeColor)) { g.FillRectangle(bg, r); g.FillRectangle(thumbBrush, _thumb); } } } #endregion #region Properties /// /// Gets or sets the lower limit of the scrollable range. /// [Category("MetroSet Framework"), Description("Gets or sets the lower limit of the scrollable range.")] public int Minimum { get => _minimum; set { _minimum = value; if (value > _value) { _value = value; } else if (value > _maximum) { _maximum = value; } InvalidateLayout(); } } /// /// Gets or sets the upper limit of the scrollable range. /// [Category("MetroSet Framework"), Description("Gets or sets the upper limit of the scrollable range.")] public int Maximum { get => _maximum; set { if (value < _value) { _value = value; } else if (value > _minimum) { _maximum = value; } if (Orientation != ScrollOrientate.Vertical) { if (Orientation == ScrollOrientate.Horizontal) { _thumbSize = value > Width ? Convert.ToInt32(Width * (Width / (double)_maximum)) : 0; } } else { _thumbSize = value > Height ? Convert.ToInt32(Height * (Height / (double)_maximum)) : 0; } InvalidateLayout(); } } /// /// Gets or sets a numeric value that represents the current position of the scroll bar box. /// [Category("MetroSet Framework"), Description("Gets or sets a numeric value that represents the current position of the scroll bar box.")] public int Value { get => _value; set { if (value > Maximum) { _value = Maximum; } else if (value < Minimum) { _value = Minimum; } else { _value = value; } InvalidatePosition(); Scroll?.Invoke(this); } } /// /// Gets or sets the distance to move a scroll bar in response to a small scroll command. /// [Category("MetroSet Framework"), Description("Gets or sets the distance to move a scroll bar in response to a small scroll command.")] [DefaultValue(1)] public int SmallChange { get { return _smallChange; } set { _smallChange = value; Refresh(); } } /// /// Gets or sets the distance to move a scroll bar in response to a large scroll command. /// [Category("MetroSet Framework"), Description("Gets or sets the distance to move a scroll bar in response to a large scroll command.")] [DefaultValue(10)] public int LargeChange { get { return _largeChange; } set { _largeChange = value; Refresh(); } } /// /// Gets or sets the scroll bar orientation. /// [Category("MetroSet Framework"), Description("Gets or sets the scroll bar orientation.")] [DefaultValue(ScrollOrientate.Horizontal)] public ScrollOrientate Orientation { get { return _orientation; } set { _orientation = value; Refresh(); } } /// /// Gets or sets fore color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets the scroll bar forecolor.")] public override Color ForeColor { get; set; } /// /// Gets or sets back color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets backcolor used by the control.")] public override Color BackColor { get; set; } /// /// Gets or sets disabled fore color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled forecolor used by the control.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets disabled back color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events protected override void OnSizeChanged(EventArgs e) { InvalidateLayout(); } /// /// Updating the thumb rectangle. /// private void InvalidateLayout() { _bar = new Rectangle(0, 0, Width, Height); _showThumb = Maximum - Minimum > 0; switch (Orientation) { case ScrollOrientate.Vertical: if (_showThumb) _thumb = new Rectangle(0, 0, Width, _thumbSize); break; case ScrollOrientate.Horizontal: if (_showThumb) _thumb = new Rectangle(0, 0, Width, _thumbSize); break; } Scroll?.Invoke(this); InvalidatePosition(); } public event ScrollEventHandler Scroll; public delegate void ScrollEventHandler(object sender); /// /// Updating the thumb location. /// private void InvalidatePosition() { switch (Orientation) { case ScrollOrientate.Vertical: _thumb.Y = Convert.ToInt32(CurrentValue() * (_bar.Height - _thumbSize)); break; case ScrollOrientate.Horizontal: _thumb.X = Convert.ToInt32(CurrentValue() * (_bar.Width - _thumbSize)); break; } Invalidate(); } /// /// Handling mouse down event so that we set the state of the thumb to pressed and ready to move. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.Button != MouseButtons.Left || !_showThumb) return; if (_thumb.Contains(e.Location)) { _thumbState = MouseMode.Pushed; Invalidate(); return; } switch (Orientation) { case ScrollOrientate.Vertical: _val = e.Y < _thumb.Y ? Value - LargeChange : Value + LargeChange; break; case ScrollOrientate.Horizontal: _val = e.X < _thumb.X ? Value - LargeChange : Value + LargeChange; break; default: throw new ArgumentOutOfRangeException(); } Value = Math.Min(Math.Max(_val, Minimum), Maximum); InvalidatePosition(); } /// /// Handling the mouse move event so that we can set the value of the thumb. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { if (!(_thumbState == MouseMode.Pushed | !_showThumb)) return; int thumbPosition; int thumbBounds; switch (Orientation) { case ScrollOrientate.Vertical: thumbPosition = e.Y - _thumbSize / 2; thumbBounds = _bar.Height - _thumbSize; _val = Convert.ToInt32((double)thumbPosition / thumbBounds * (Maximum - Minimum)) - Minimum; break; case ScrollOrientate.Horizontal: thumbPosition = e.X - _thumbSize / 2; thumbBounds = _bar.Width - _thumbSize; _val = Convert.ToInt32((double)thumbPosition / thumbBounds * (Maximum - Minimum)) - Minimum; break; default: throw new ArgumentOutOfRangeException(); } Value = Math.Min(Math.Max(_val, Minimum), Maximum); InvalidatePosition(); } /// /// Handling the mouse up event and determine the state of the thumb. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { _thumbState = _thumb.Contains(e.Location) ? MouseMode.Hovered : MouseMode.Normal; switch (Orientation) { case ScrollOrientate.Vertical: _thumbState = (e.Location.Y < 16) | (e.Location.Y > Width - 16) ? MouseMode.Hovered : MouseMode.Normal; break; case ScrollOrientate.Horizontal: _thumbState = e.Location.X < 16 | e.Location.X > Width - 16 ? MouseMode.Hovered : MouseMode.Normal; break; default: throw new ArgumentOutOfRangeException(); } Invalidate(); } /// /// Handling the mouse leave event and releasing the thumb state. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { _thumbState = MouseMode.Normal; Invalidate(); } /// /// The Method for finding out the current value of the scrollbar. /// /// the Current value of the scrollbar. private double CurrentValue() { return (double)(Value - Minimum) / (Maximum - Minimum); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetSwitch.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Animates; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetSwitch), "Bitmaps.Switch.bmp")] [Designer(typeof(MetroSetSwitchDesigner))] [DefaultEvent("SwitchedChanged")] [DefaultProperty("Switched")] [ComVisible(true)] public class MetroSetSwitch : Control, IMetroSetControl, IDisposable { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private StyleManager _styleManager; private bool _switched; private Style _style; private int _switchLocation; private readonly IntAnimate _animator; private Enums.CheckState _checkState; private Color _borderColor; private Color _checkColor; private Color _disabledBorderColor; private Color _disabledCheckColor; private Color _disabledUnCheckColor; private Color _backgroundColor; private Color _symbolColor; private Color _unCheckColor; #endregion Internal Vars #region Constructors public MetroSetSwitch() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Cursor = Cursors.Hand; _utl = new Utilites(); _animator = new IntAnimate(); _animator.Setting(100, 0, 132); _animator.Update = (alpha) => { _switchLocation = alpha; Invalidate(false); }; ApplyTheme(); } #endregion Constructors #region ApplyTheme private void UpdateProperties() { Invalidate(); } /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.Black; BackColor = Color.White; BorderColor = Color.FromArgb(165, 159, 147); DisabledBorderColor = Color.FromArgb(205, 205, 205); SymbolColor = Color.FromArgb(92, 92, 92); UnCheckColor = Color.FromArgb(155, 155, 155); CheckColor = Color.FromArgb(65, 177, 225); DisabledUnCheckColor = Color.FromArgb(200, 205, 205, 205); DisabledCheckColor = Color.FromArgb(100, 65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(170, 170, 170); BackColor = Color.FromArgb(30, 30, 30); BorderColor = Color.FromArgb(155, 155, 155); DisabledBorderColor = Color.FromArgb(85, 85, 85); SymbolColor = Color.FromArgb(92, 92, 92); UnCheckColor = Color.FromArgb(155, 155, 155); CheckColor = Color.FromArgb(65, 177, 225); DisabledUnCheckColor = Color.FromArgb(200, 205, 205, 205); DisabledCheckColor = Color.FromArgb(100, 65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.SwitchBoxDictionary) { switch (varkey.Key) { case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "SymbolColor": SymbolColor = _utl.HexColor((string)varkey.Value); break; case "UnCheckColor": UnCheckColor = _utl.HexColor((string)varkey.Value); break; case "CheckColor": CheckColor = _utl.HexColor((string)varkey.Value); break; case "DisabledUnCheckColor": DisabledUnCheckColor = _utl.HexColor((string)varkey.Value); break; case "DisabledCheckColor": DisabledCheckColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion ApplyTheme #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; var rect = new Rectangle(1, 1, 56, 20); var rect2 = new Rectangle(3, 3, 52, 16); using (var backBrush = new SolidBrush(BackgroundColor)) { using (var checkback = new SolidBrush(Enabled ? Switched ? CheckColor : UnCheckColor : Switched ? DisabledCheckColor : DisabledUnCheckColor)) { using (var checkMarkBrush = new SolidBrush(SymbolColor)) { using (var p = new Pen(Enabled ? BorderColor : DisabledBorderColor, 2)) { g.FillRectangle(backBrush, rect); g.FillRectangle(checkback, rect2); g.DrawRectangle(p, rect); g.FillRectangle(checkMarkBrush, new Rectangle((Convert.ToInt32(rect.Width * (_switchLocation / 180.0))), 0, 16, 22)); } } } } } #endregion Draw Control #region Events public delegate void SwitchedChangedEventHandler(object sender); public event SwitchedChangedEventHandler SwitchedChanged; /// /// Here we will handle the checking state in runtime. /// /// EventArgs protected override void OnClick(EventArgs e) { base.OnClick(e); Switched = !Switched; Invalidate(); } /// /// Here we will set the limited height for the control to avoid high and low of the text drawing. /// /// EventArgs protected override void OnResize(EventArgs e) { base.OnResize(e); Size = new Size(58, 22); Invalidate(); } /// /// Here we set the smooth mouse hand. /// /// protected override void WndProc(ref Message m) { _utl.SmoothCursor(ref m); base.WndProc(ref m); } #endregion Events #region Properties /// /// Specifies the state of a control, such as a check box, that can be checked, unchecked. /// [Browsable(false)] public Enums.CheckState CheckState { get { return _checkState; } set { _checkState = value; Refresh(); } } /// /// Gets or sets a value indicating whether the control is checked. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the control is checked.")] public bool Switched { get => _switched; set { _switched = value; SwitchedChanged?.Invoke(this); _animator.Reverse(!value); CheckState = value != true ? Enums.CheckState.Unchecked : Enums.CheckState.Checked; Invalidate(); } } /// /// Gets or sets the border color. /// [Category("MetroSet Framework"), Description("Gets or sets the border color.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets the Checked backColor. /// [Category("MetroSet Framework"), Description("Gets or sets the Checkd backColor.")] public Color CheckColor { get { return _checkColor; } set { _checkColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the CheckedBackColor while disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the CheckdBackColor while disabled.")] public Color DisabledCheckColor { get { return _disabledCheckColor; } set { _disabledCheckColor = value; Refresh(); } } /// /// Gets or sets the Unchecked BackColor while disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the Un-Checkd BackColor while disabled.")] public Color DisabledUnCheckColor { get { return _disabledUnCheckColor; } set { _disabledUnCheckColor = value; Refresh(); } } /// /// Gets or sets fore color used by the control /// [Category("MetroSet Framework"), Description("Gets or sets forecolor used by the control.")] public override Color ForeColor { get; set; } /// /// I make back color inaccessible cause I want it to be just transparent and I used another property for the same job in following properties. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the control back color. /// [Category("MetroSet Framework"), Description("Gets or sets the control backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the color of the check symbol. /// [Category("MetroSet Framework"), Description("Gets or sets the color of the check symbol.")] public Color SymbolColor { get { return _symbolColor; } set { _symbolColor = value; Refresh(); } } /// /// Gets or sets the Unchecked backColor. /// [Category("MetroSet Framework"), Description("Gets or sets the Un-Checkd backColor.")] public Color UnCheckColor { get { return _unCheckColor; } set { _unCheckColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Disposing /// /// Disposing Methods. /// public new void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetTabControl.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Animates; using MetroSet_UI.Child; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetTabControl), "Bitmaps.TabControl.bmp")] [Designer(typeof(MetroSetTabControlDesigner))] [ComVisible(true)] public class MetroSetTabControl : TabControl, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Methods _mth; private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private PointFAnimate _slideAnimator; private Graphics _slideGraphics; private Bitmap _slideBitmap; private bool _useAnimation; private int _speed = 100; private Color _unselectedTextColor; private Color _selectedTextColor; private TabStyle _tabStyle; #endregion Internal Vars #region Constructors public MetroSetTabControl() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); ItemSize = new Size(100, 38); Font = MetroSetFonts.UIRegular(8); _mth = new Methods(); _utl = new Utilites(); _slideAnimator = new PointFAnimate(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForegroundColor = Color.FromArgb(65, 177, 225); BackgroundColor = Color.White; UnselectedTextColor = Color.Gray; SelectedTextColor = Color.White; ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForegroundColor = Color.FromArgb(65, 177, 225); BackgroundColor = Color.FromArgb(30, 30, 30); UnselectedTextColor = Color.Gray; SelectedTextColor = Color.White; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.TabControlDictionary) { switch (varkey.Key) { case "ForeColor": ForegroundColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "UnselectedTextColor": UnselectedTextColor = _utl.HexColor((string)varkey.Value); break; case "SelectedTextColor": SelectedTextColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; } } private void UpdateProperties() { try { InvalidateTabPage(BackgroundColor); Invalidate(); } catch { //throw new Exception(ex.StackTrace); } } #endregion ApplyTheme #region Properties /// /// Get or set slide animate time(ms). /// [Category("MetroSet Framework"), Description("Get or set slide animate time(ms).")] public int AnimateTime { get; set; } = 200; /// /// Get or set slide animate easing type /// [Category("MetroSet Framework"), Description("Get or set slide animate easing type")] public EasingType AnimateEasingType { get; set; } = EasingType.CubeOut; /// /// Gets the collection of tab pages in this tab control. /// [Category("MetroSet Framework")] [Editor(typeof(MetroSetTabPageCollectionEditor), typeof(UITypeEditor))] public new TabPageCollection TabPages => base.TabPages; /// /// Gets or sets whether the tab control use animation or not. /// [Category("MetroSet Framework"), Description("Gets or sets wether the tabcontrol use animation or not.")] [DefaultValue(true)] public bool UseAnimation { get { return _useAnimation; } set { _useAnimation = value; Refresh(); } } /// /// Gets or sets the size of the control's tabs. /// [Category("MetroSet Framework"), Description("Gets or sets the size of the control's tabs.")] public new Size ItemSize { get => base.ItemSize; set { base.ItemSize = value; Invalidate(); } } /// /// Gets or sets the font used when displaying text in the control. /// [Category("MetroSet Framework"), Description("Gets or sets the font used when displaying text in the control.")] public new Font Font { get; set; } /// /// Gets or sets the area of the control (for example, along the top) where the tabs are aligned. /// [Category("MetroSet Framework"), Description("Gets or sets the area of the control (for example, along the top) where the tabs are aligned.")] public new TabAlignment Alignment => TabAlignment.Top; /// /// Gets or sets the speed of transition. /// [Category("MetroSet Framework"), Description("Gets or sets the speed of transition.")] [DefaultValue(20)] public int Speed { get { return _speed; } set { _speed = value; Refresh(); } } /// /// Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. /// [Category("MetroSet Framework")] public override DockStyle Dock { get => base.Dock; set => base.Dock = value; } /// /// Gets or sets the way that the control's tabs are sized. /// [Category("MetroSet Framework")] [Browsable(false)] public new TabSizeMode SizeMode { get; set; } = TabSizeMode.Fixed; /// /// Gets or sets the way that the control's tabs are drawn. /// [Category("MetroSet Framework")] [Browsable(false)] public new TabDrawMode DrawMode { get; set; } = TabDrawMode.Normal; /// /// Gets or sets the background color. /// [Category("MetroSet Framework"), Description("Gets or sets the backgorund color.")] public Color BackgroundColor { get; set; } /// /// Gets or sets the foreground color. /// [Category("MetroSet Framework"), Description("Gets or sets the foregorund color.")] private Color ForegroundColor { get; set; } /// /// Gets or sets the tab page text while un-selected. /// [Category("MetroSet Framework"), Description("Gets or sets the tabpage text while un-selected.")] public Color UnselectedTextColor { get { return _unselectedTextColor; } set { _unselectedTextColor = value; Refresh(); } } /// /// Gets or sets the tab page text while selected. /// [Category("MetroSet Framework"), Description("Gets or sets the tabpage text while selected.")] public Color SelectedTextColor { get { return _selectedTextColor; } set { _selectedTextColor = value; Refresh(); } } /// /// Gets or sets the tab control appearance style /// [Category("MetroSet Framework"), Description("Gets or sets the tancontrol apperance style.")] [DefaultValue(TabStyle.Style1)] public TabStyle TabStyle { get { return _tabStyle; } set { _tabStyle = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion Properties #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; g.Clear(BackgroundColor); var h = ItemSize.Height + 2; switch (TabStyle) { case TabStyle.Style1: using (var sb = new Pen(ForegroundColor, 2)) { g.DrawLine(sb, 2, h, Width - 3, h); } for (var i = 0; i <= TabCount - 1; i++) { var r = GetTabRect(i); if (i == SelectedIndex) { using (var sb = new SolidBrush(ForegroundColor)) { g.FillRectangle(sb, r); } } using (var tb = new SolidBrush(i == SelectedIndex ? SelectedTextColor : UnselectedTextColor)) { g.DrawString(TabPages[i].Text, Font, tb, r, _mth.SetPosition()); } } break; case TabStyle.Style2: for (var i = 0; i <= TabCount - 1; i++) { var r = GetTabRect(i); if (i == SelectedIndex) { using (var sb = new Pen(ForegroundColor, 2)) { g.DrawLine(sb, r.X, r.Height, r.X + r.Width, r.Height); } } using (var tb = new SolidBrush(UnselectedTextColor)) { g.DrawString(TabPages[i].Text, Font, tb, r, _mth.SetPosition()); } } break; } } #endregion Draw Control #region Events /// /// Handling mouse move event of the control, chnaging the cursor to hande whenever mouse located in a tab page. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); for (var i = 0; i <= TabCount - 1; i++) { var r = GetTabRect(i); if (!r.Contains(e.Location)) continue; Cursor = Cursors.Hand; Invalidate(); } } /// /// Handling mouse leave event and releasing hand cursor. /// /// protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); Cursor = Cursors.Default; Invalidate(); } /// /// Here we set the smooth mouse hand. /// /// protected override void WndProc(ref Message m) { _utl.SmoothCursor(ref m); base.WndProc(ref m); } #region Animation // Credits : Mavamaarten private int _oldIndex; private void DoSlideAnimate(TabPage control1, TabPage control2, bool moveback) { // initialize control and child controls when control first painted _utl.InitControlHandle(control1); _utl.InitControlHandle(control2); _slideGraphics = Graphics.FromHwnd(control2.Handle); _slideBitmap = new Bitmap(control1.Width + control2.Width, control1.Height + control2.Height); if (moveback) { control2.DrawToBitmap(_slideBitmap, new Rectangle(0, 0, control2.Width, control2.Height)); control1.DrawToBitmap(_slideBitmap, new Rectangle(control2.Width, 0, control1.Width, control1.Height)); } else { control1.DrawToBitmap(_slideBitmap, new Rectangle(0, 0, control1.Width, control1.Height)); control2.DrawToBitmap(_slideBitmap, new Rectangle(control1.Width, 0, control2.Width, control2.Height)); } foreach (Control c in control2.Controls) { c.Hide(); } _slideAnimator.Update = (alpha) => { _slideGraphics.DrawImage(_slideBitmap, alpha); }; _slideAnimator.Complete = () => { SelectedTab = control2; foreach (Control c in control2.Controls) { c.Show(); } }; _slideAnimator.Start( AnimateTime, new Point(moveback ? -control2.Width : 0, 0), new Point(moveback ? 0 : -control1.Width, 0), AnimateEasingType ); } protected override void OnSelecting(TabControlCancelEventArgs e) { if (!UseAnimation) return; if (_slideAnimator.Active) { e.Cancel = true; return; } DoSlideAnimate(TabPages[_oldIndex], TabPages[e.TabPageIndex], _oldIndex > e.TabPageIndex); } protected override void OnDeselecting(TabControlCancelEventArgs e) { _oldIndex = e.TabPageIndex; } private void DoAnimationScrollRight(Control control1, Control control2) { var g = control1.CreateGraphics(); var p1 = new Bitmap(control1.Width, control1.Height); var p2 = new Bitmap(control2.Width, control2.Height); control1.DrawToBitmap(p1, new Rectangle(0, 0, control1.Width, control1.Height)); control2.DrawToBitmap(p2, new Rectangle(0, 0, control2.Width, control2.Height)); foreach (Control c in control1.Controls) { c.Hide(); } var slide = control1.Width - (control1.Width % Speed); int a; for (a = 0; a >= -slide; a += -Speed) { g.DrawImage(p1, new Rectangle(a, 0, control1.Width, control1.Height)); g.DrawImage(p2, new Rectangle(a + control2.Width, 0, control2.Width, control2.Height)); } a = control1.Width; g.DrawImage(p1, new Rectangle(a, 0, control1.Width, control1.Height)); g.DrawImage(p2, new Rectangle(a + control2.Width, 0, control2.Width, control2.Height)); SelectedTab = (TabPage)control2; foreach (Control c in control2.Controls) { c.Show(); } foreach (Control c in control1.Controls) { c.Show(); } } #endregion Animation #endregion Events #region Methods /// /// The Method that provide the specific color for every single tab page in the tab control. /// /// private void InvalidateTabPage(Color c) { foreach (MetroSetSetTabPage T in TabPages) { T.Style = Style; T.BaseColor = c; T.Invalidate(); } } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetTextBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetTextBox), "Bitmaps.TextBox.bmp")] [Designer(typeof(MetroSetTextBoxDesigner))] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetTextBox : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private HorizontalAlignment _textAlign; private int _maxLength; private bool _readOnly; private bool _useSystemPasswordChar; private string _watermarkText; private Image _image; private MouseMode _state; private AutoCompleteSource _autoCompleteSource; private AutoCompleteMode _autoCompleteMode; private AutoCompleteStringCollection _autoCompleteCustomSource; private bool _multiline; private string[] _lines; private Color _backColor; private Color _foreColor; private Color _borderColor; private Color _hoverColor; private Color _disabledForeColor; private Color _disabledBackColor; private Color _disabledBorderColor; #region Base TextBox private TextBox _textBox = new TextBox(); #endregion #endregion Internal Vars #region Constructors public MetroSetTextBox() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); UpdateStyles(); Font = MetroSetFonts.Regular(10); EvaluateVars(); ApplyTheme(); T_Defaults(); if (!Multiline) Size = new Size(135, 30); } private void EvaluateVars() { _utl = new Utilites(); } private void T_Defaults() { _watermarkText = string.Empty; _useSystemPasswordChar = false; _readOnly = false; _maxLength = 32767; _textAlign = HorizontalAlignment.Left; _state = MouseMode.Normal; _autoCompleteMode = AutoCompleteMode.None; _autoCompleteSource = AutoCompleteSource.None; _lines = null; _multiline = false; _textBox.Multiline = _multiline; _textBox.Cursor = Cursors.IBeam; _textBox.BackColor = BackColor; _textBox.ForeColor = ForeColor; _textBox.BorderStyle = BorderStyle.None; _textBox.Location = new Point(7, 8); _textBox.Font = Font; _textBox.UseSystemPasswordChar = UseSystemPasswordChar; if (Multiline) { _textBox.Height = Height - 11; } else { Height = _textBox.Height + 11; } _textBox.MouseHover += T_MouseHover; _textBox.Leave += T_Leave; _textBox.Enter += T_Enter; _textBox.KeyDown += T_KeyDown; _textBox.TextChanged += T_TextChanged; _textBox.KeyPress += T_KeyPress; } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var rect = new Rectangle(0, 0, Width - 1, Height - 1); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; if (Enabled) { using (var bg = new SolidBrush(BackColor)) { using (var p = new Pen(BorderColor)) { using (var ph = new Pen(HoverColor)) { g.FillRectangle(bg, rect); if (_state == MouseMode.Normal) g.DrawRectangle(p, rect); else if (_state == MouseMode.Hovered) { g.DrawRectangle(ph, rect); } } } } } else { using (var bg = new SolidBrush(DisabledBackColor)) { using (var p = new Pen(DisabledBorderColor)) { g.FillRectangle(bg, rect); g.DrawRectangle(p, rect); _textBox.BackColor = DisabledBackColor; _textBox.ForeColor = DisabledForeColor; } } } if (Image != null) { _textBox.Location = new Point(31, 4); _textBox.Width = Width - 60; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(Image, new Rectangle(7, 6, 18, 18)); } else { _textBox.Location = new Point(7, 4); _textBox.Width = Width - 10; } } #endregion #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: ForeColor = Color.FromArgb(20, 20, 20); BackColor = Color.FromArgb(238, 238, 238); HoverColor = Color.FromArgb(102, 102, 102); BorderColor = Color.FromArgb(155, 155, 155); DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.FromArgb(204, 204, 204); BackColor = Color.FromArgb(34, 34, 34); HoverColor = Color.FromArgb(65, 177, 225); BorderColor = Color.FromArgb(110, 110, 110); DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.TextBoxDictionary) { switch (varkey.Key) { case "ForeColor": ForeColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackColor = _utl.HexColor((string)varkey.Value); break; case "HoverColor": HoverColor = _utl.HexColor((string)varkey.Value); break; case "BorderColor": BorderColor = _utl.HexColor((string)varkey.Value); break; case "WatermarkText": WatermarkText = (string)varkey.Value; break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBorderColor": DisabledBorderColor = _utl.HexColor((string)varkey.Value); break; case "DisabledForeColor": DisabledForeColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; } } public void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Events public new event EventHandler TextChanged; public event KeyPressEventHandler KeyPressed; public new event EventHandler Leave; /// /// Handling textbox leave event and raising the same event here. /// /// object /// EventArgs public void T_Leave(object sender, EventArgs e) { base.OnMouseLeave(e); Leave?.Invoke(sender, e); } public void T_KeyPress(object sender, KeyPressEventArgs e) { KeyPressed?.Invoke(this, e); Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { _state = MouseMode.Normal; base.OnMouseLeave(e); } /// /// Handling mouse up event of the control. /// /// EventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// EventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse hover event of the control. /// /// EventArgs protected override void OnMouseHover(EventArgs e) { base.OnMouseHover(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling the mouse hover event on text box control. /// /// object /// EventArgs public void T_MouseHover(object sender, EventArgs e) { base.OnMouseHover(e); Invalidate(); } /// /// Raises the Control.Resize event. /// /// EventArgs protected override void OnResize(EventArgs e) { base.OnResize(e); //if (!Multiline) //{ _textBox.Size = new Size(Width - 10, Height - 10); //} } protected override void OnGotFocus(EventArgs e) { base.OnGotFocus(e); _textBox.Focus(); } /// /// Raises the Control.Enter event. /// /// object /// EventArgs public void T_Enter(object sender, EventArgs e) { base.OnMouseEnter(e); Invalidate(); } /// /// Handling Keydown event of text box control. /// /// object /// KeyEventArgs private void T_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.A) e.SuppressKeyPress = true; if (!e.Control || e.KeyCode != Keys.C) return; _textBox.Copy(); e.SuppressKeyPress = true; } /// /// An System.EventArgs that contains the event data. /// /// /// private void T_TextChanged(object sender, EventArgs e) { Text = _textBox.Text; TextChanged?.Invoke(this, e); Invalidate(); } /// /// override the control creating , here we add the base textbox to the main control. /// protected override void OnCreateControl() { base.OnCreateControl(); if (!Controls.Contains(_textBox)) Controls.Add(_textBox); } /// /// Appends text to the current text of a text box. /// /// public void AppendText(string text) { _textBox?.AppendText(text); } /// /// Undoes the last edit operation in the text box. /// public void Undo() { if (_textBox == null) return; if (_textBox.CanUndo) { _textBox.Undo(); } } /// /// Retrieves the line number from the specified character position within the text of the control. /// /// /// public int GetLineFromCharIndex(int index) { return _textBox?.GetLineFromCharIndex(index) ?? 0; } /// /// Retrieves the location within the control at the specified character index. /// /// /// public Point GetPositionFromCharIndex(int index) { return _textBox.GetPositionFromCharIndex(index); } /// /// Retrieves the index of the character nearest to the specified location. /// /// /// public int GetCharIndexFromPosition(Point pt) { return _textBox?.GetCharIndexFromPosition(pt) ?? 0; } /// /// Clears information about the most recent operation from the undo buffer of the text box. /// public void ClearUndo() { _textBox?.ClearUndo(); } /// /// Copies the current selection in the text box to the Clipboard. /// public void Copy() { _textBox?.Copy(); } /// /// Moves the current selection in the text box to the Clipboard. /// public void Cut() { _textBox?.Cut(); } /// /// Selects all text in the text box. /// public void SelectAll() { _textBox?.SelectAll(); } /// /// Specifies that the value of the TextBoxBase.SelectionLength property is zero so that no characters are selected in the control. /// public void DeselectAll() { _textBox?.DeselectAll(); } /// /// Replaces the current selection in the text box with the contents of the Clipboard. /// /// public void Paste(string clipFormat) { _textBox?.Paste(clipFormat); } /// /// Selects a range of text in the text box. /// /// /// public void Select(int start, int length) { _textBox?.Select(start, length); } #endregion #region Properties /// /// Gets the border style. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public BorderStyle BorderStyle => BorderStyle.None; /// /// Gets or sets how text is aligned in a TextBox control. /// [Category("MetroSet Framework"), Description("Gets or sets how text is aligned in a TextBox control.")] public HorizontalAlignment TextAlign { get => _textAlign; set { _textAlign = value; var text = _textBox; if (text != null) { text.TextAlign = value; } Invalidate(); } } /// /// Gets or sets how text is aligned in a TextBox control. /// [Category("MetroSet Framework"), Description("Gets or sets how text is aligned in a TextBox control.")] public int MaxLength { get => _maxLength; set { _maxLength = value; if (_textBox != null) { _textBox.MaxLength = value; } Invalidate(); } } /// /// Gets or sets the background color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the background color of the control.")] public override Color BackColor { get => _backColor; set { _backColor = value; _textBox.BackColor = value; Invalidate(); } } /// /// Gets or sets the color of the control whenever hovered. /// [Category("MetroSet Framework")] [Description("Gets or sets the color of the control whenever hovered.")] public Color HoverColor { get => _hoverColor; set { _hoverColor = value; Invalidate(); } } /// /// Gets or sets the border color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control.")] public Color BorderColor { get => _borderColor; set { _borderColor = value; Invalidate(); } } /// /// Gets or sets the foreground color of the control. /// [Category("MetroSet Framework")] [Description("Gets or sets the foreground color of the control.")] [Browsable(false)] public override Color ForeColor { get => _foreColor; set { _foreColor = value; _textBox.ForeColor = value; Invalidate(); } } /// /// Gets or sets a value indicating whether text in the text box is read-only. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether text in the text box is read-only.")] public bool ReadOnly { get => _readOnly; set { _readOnly = value; if (_textBox != null) { _textBox.ReadOnly = value; } } } /// /// Gets or sets a value indicating whether the text in the TextBox control should appear as the default password character. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the text in the TextBox control should appear as the default password character.")] public bool UseSystemPasswordChar { get => _useSystemPasswordChar; set { _useSystemPasswordChar = value; if (_textBox != null) { _textBox.UseSystemPasswordChar = value; } } } /// /// Gets or sets a value indicating whether this is a multiline TextBox control. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether this is a multiline TextBox control.")] public bool Multiline { get => _multiline; set { _multiline = value; if (_textBox == null) { return; } _textBox.Multiline = value; if (value) { _textBox.Height = Height - 10; } else { Height = _textBox.Height + 10; } } } /// /// Gets or sets the background image. /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override Image BackgroundImage => null; /// /// Gets or sets the current text in the TextBox. /// [Category("MetroSet Framework"), Description("Gets or sets the current text in the TextBox.")] public override string Text { get => _textBox.Text; set { base.Text = value; if (_textBox != null) { _textBox.Text = value; } } } /// /// Gets or sets the text in the TextBox while being empty. /// [Category("MetroSet Framework"), Description("Gets or sets the text in the TextBox while being empty.")] public string WatermarkText { get => _watermarkText; set { _watermarkText = value; User32.SendMessage(_textBox.Handle, 5377, 0, value); Invalidate(); } } /// /// Gets or sets the image of the control. /// [Category("MetroSet Framework"), Description("Gets or sets the image of the control.")] public Image Image { get => _image; set { _image = value; Invalidate(); } } /// /// Gets or sets a value specifying the source of complete strings used for automatic completion. /// [Category("MetroSet Framework"), Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")] public AutoCompleteSource AutoCompleteSource { get => _autoCompleteSource; set { _autoCompleteSource = value; if (_textBox != null) { _textBox.AutoCompleteSource = value; } Invalidate(); } } /// /// Gets or sets a value specifying the source of complete strings used for automatic completion. /// [Category("MetroSet Framework"), Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")] public AutoCompleteStringCollection AutoCompleteCustomSource { get => _autoCompleteCustomSource; set { _autoCompleteCustomSource = value; if (_textBox != null) { _textBox.AutoCompleteCustomSource = value; } Invalidate(); } } /// /// Gets or sets an option that controls how automatic completion works for the TextBox. /// [Category("MetroSet Framework"), Description("Gets or sets an option that controls how automatic completion works for the TextBox.")] public AutoCompleteMode AutoCompleteMode { get => _autoCompleteMode; set { _autoCompleteMode = value; if (_textBox != null) { _textBox.AutoCompleteMode = value; } Invalidate(); } } /// /// Gets or sets the font of the text displayed by the control. /// [Category("MetroSet Framework"), Description("Gets or sets the font of the text displayed by the control.")] public sealed override Font Font { get => base.Font; set { base.Font = value; if (_textBox == null) return; _textBox.Font = value; _textBox.Location = new Point(5, 5); _textBox.Width = Width - 8; if (!Multiline) Height = _textBox.Height + 11; } } /// /// Gets or sets the lines of text in the control. /// [Category("MetroSet Framework"), Description("Gets or sets the lines of text in the control.")] public string[] Lines { get => _lines; set { _lines = value; if (_textBox != null) _textBox.Lines = value; Invalidate(); } } /// /// Gets or sets the ContextMenuStrip associated with this control. /// [Category("MetroSet Framework"), Description("Gets or sets the ContextMenuStrip associated with this control.")] public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set { base.ContextMenuStrip = value; if (_textBox == null) return; _textBox.ContextMenuStrip = value; Invalidate(); } } /// /// Gets or sets the forecolor of the control whenever while disabled /// [Category("MetroSet Framework"), Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets disabled backcolor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion } } ================================================ FILE: MetroSet UI/Controls/MetroSetTile.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetTile), "Bitmaps.Button.bmp")] [Designer(typeof(MetroSetTileDesigner))] [DefaultEvent("Click")] [DefaultProperty("Text")] [ComVisible(true)] public class MetroSetTile : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private MouseMode _state; private Style _style; private StyleManager _styleManager; private TileAlign _textAlign; private Color _normalColor; private Color _normalBorderColor; private Color _normalTextColor; private Color _hoverColor; private Color _hoverBorderColor; private Color _hoverTextColor; private Color _pressColor; private Color _pressBorderColor; private Color _pressTextColor; private Color _disabledBackColor; private Color _disabledForeColor; private Color _disabledBorderColor; #endregion Internal Vars #region Constructors public MetroSetTile() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); base.Font = MetroSetFonts.Light(10); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; var r = new Rectangle(1, 1, Width - 2, Height - 2); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; StringFormat sf; switch (TileAlign) { case TileAlign.BottmLeft: sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Far }; break; case TileAlign.BottomRight: sf = new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Far }; break; case TileAlign.Topleft: sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near }; break; case TileAlign.TopRight: sf = new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Near }; break; case TileAlign.TopCenter: sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Near }; break; case TileAlign.BottomCenter: sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Far }; break; default: throw new ArgumentOutOfRangeException(); } switch (_state) { case MouseMode.Normal: using (var bg = new SolidBrush(NormalColor)) { using (var p = new Pen(NormalBorderColor, 2)) { using (var tb = new SolidBrush(NormalTextColor)) { if (BackgroundImage != null) { g.DrawImage(BackgroundImage, r); } else { g.FillRectangle(bg, r); g.DrawRectangle(p, r); } g.DrawString(Text, Font, tb, r, sf); } } } break; case MouseMode.Hovered: Cursor = Cursors.Hand; using (var bg = new SolidBrush(HoverColor)) { using (var p = new Pen(HoverBorderColor, 2)) { using (var tb = new SolidBrush(HoverTextColor)) { if (BackgroundImage != null) { g.DrawImage(BackgroundImage, r); } else { g.FillRectangle(bg, r); } g.DrawString(Text, Font, tb, r, sf); g.DrawRectangle(p, r); } } } break; case MouseMode.Pushed: using (var bg = new SolidBrush(PressColor)) { using (var p = new Pen(PressBorderColor, 2)) { using (var tb = new SolidBrush(PressTextColor)) { if (BackgroundImage != null) { g.DrawImage(BackgroundImage, r); } else { g.FillRectangle(bg, r); } g.DrawString(Text, Font, tb, r, sf); g.DrawRectangle(p, r); } } } break; case MouseMode.Disabled: using (var bg = new SolidBrush(DisabledBackColor)) { using (var p = new Pen(DisabledBorderColor)) { using (var tb = new SolidBrush(DisabledForeColor)) { g.FillRectangle(bg, r); g.DrawString(Text, Font, tb, r, sf); g.DrawRectangle(p, r); } } } break; default: throw new ArgumentOutOfRangeException(); } } #endregion Draw Control #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: NormalColor = Color.FromArgb(65, 177, 225); NormalBorderColor = Color.FromArgb(65, 177, 225); NormalTextColor = Color.White; HoverColor = Color.FromArgb(65, 177, 225); HoverBorderColor = Color.FromArgb(230, 230, 230); HoverTextColor = Color.White; PressColor = Color.FromArgb(65, 177, 225); PressBorderColor = Color.FromArgb(65, 177, 225); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(204, 204, 204); DisabledBorderColor = Color.FromArgb(155, 155, 155); DisabledForeColor = Color.FromArgb(136, 136, 136); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; break; case Style.Dark: NormalColor = Color.FromArgb(65, 177, 225); NormalBorderColor = Color.FromArgb(65, 177, 225); NormalTextColor = Color.White; HoverColor = Color.FromArgb(65, 177, 225); HoverBorderColor = Color.FromArgb(102, 102, 102); HoverTextColor = Color.White; PressColor = Color.FromArgb(65, 177, 225); PressBorderColor = Color.FromArgb(51, 51, 51); PressTextColor = Color.White; DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledBorderColor = Color.FromArgb(109, 109, 109); DisabledForeColor = Color.FromArgb(109, 109, 109); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.TileDictionary) { if ((varkey.Key == null) || varkey.Key == null) { return; } if (varkey.Key == "NormalColor") { NormalColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "NormalBorderColor") { NormalBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "NormalTextColor") { NormalTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverColor") { HoverColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverBorderColor") { HoverBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "HoverTextColor") { HoverTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressColor") { PressColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressBorderColor") { PressBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "PressTextColor") { PressTextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledBackColor") { DisabledBackColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledBorderColor") { DisabledBorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "DisabledForeColor") { DisabledForeColor = _utl.HexColor((string)varkey.Value); } } Refresh(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } #endregion Theme Changing #region Properties /// /// Gets the background color. /// [Browsable(false)] public override Color BackColor => Color.Transparent; /// /// Gets or sets a value indicating whether the control can respond to user interaction. /// [Category("MetroSet Framework"), Description("Gets or sets a value indicating whether the control can respond to user interaction.")] public new bool Enabled { get => base.Enabled; set { base.Enabled = value; if (value == false) { _state = MouseMode.Disabled; } Invalidate(); } } /// /// Gets or sets the BackgroundImage associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the BackgroundImage associated with the control.")] public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; } /// /// Gets or sets the TileAlign associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the TileAlign associated with the control.")] [DefaultValue(TileAlign.BottmLeft)] public TileAlign TileAlign { get { return _textAlign; } set { _textAlign = value; Refresh(); } } /// /// Gets or sets the control background color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in normal mouse sate.")] public Color NormalColor { get { return _normalColor; } set { _normalColor = value; Refresh(); } } /// /// Gets or sets the control border color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in normal mouse sate.")] public Color NormalBorderColor { get { return _normalBorderColor; } set { _normalBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in normal mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in normal mouse sate.")] public Color NormalTextColor { get { return _normalTextColor; } set { _normalTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in hover mouse sate.")] public Color HoverColor { get { return _hoverColor; } set { _hoverColor = value; Refresh(); } } /// /// Gets or sets the control border color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in hover mouse sate.")] public Color HoverBorderColor { get { return _hoverBorderColor; } set { _hoverBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in hover mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in hover mouse sate.")] public Color HoverTextColor { get { return _hoverTextColor; } set { _hoverTextColor = value; Refresh(); } } /// /// Gets or sets the control background color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control background color in pushed mouse sate.")] public Color PressColor { get { return _pressColor; } set { _pressColor = value; Refresh(); } } /// /// Gets or sets the control border color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control border color in pushed mouse sate.")] public Color PressBorderColor { get { return _pressBorderColor; } set { _pressBorderColor = value; Refresh(); } } /// /// Gets or sets the control Text color in pushed mouse sate. /// [Category("MetroSet Framework")] [Description("Gets or sets the control Text color in pushed mouse sate.")] public Color PressTextColor { get { return _pressTextColor; } set { _pressTextColor = value; Refresh(); } } /// /// Gets or sets back color used by the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets backcolor used by the control while disabled.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the fore color of the control whenever while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the forecolor of the control whenever while disabled.")] public Color DisabledForeColor { get { return _disabledForeColor; } set { _disabledForeColor = value; Refresh(); } } /// /// Gets or sets the border color of the control while disabled. /// [Category("MetroSet Framework")] [Description("Gets or sets the border color of the control while disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events /// /// Handling mouse up event of the control. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse down event of the control. /// /// MouseEventArgs protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseUp(e); _state = MouseMode.Pushed; Invalidate(); } /// /// Handling mouse entering event of the control. /// /// MouseEventArgs protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Hovered; Invalidate(); } /// /// Handling mouse leave event of the control. /// /// EventArgs protected override void OnMouseLeave(EventArgs e) { base.OnMouseEnter(e); _state = MouseMode.Normal; Invalidate(); } #endregion Events } } ================================================ FILE: MetroSet UI/Controls/MetroSetTrackBar.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Design; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; namespace MetroSet_UI.Controls { [ToolboxItem(true)] [ToolboxBitmap(typeof(MetroSetTrackBar), "Bitmaps.Slider.bmp")] [Designer(typeof(MetroSetTrackBarDesigner))] [DefaultProperty("Value")] [DefaultEvent("Scroll")] [ComVisible(true)] public class MetroSetTrackBar : Control, IMetroSetControl { #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control.")] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: ApplyTheme(); break; } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private bool _variable; private Rectangle _track; private int _maximum; private int _minimum; private int _value; private int _currentValue; private Color _valueColor; private Color _handlerColor; private Color _backgroundColor; private Color _disabledValueColor; private Color _disabledBackColor; private Color _disabledBorderColor; private Color _disabledHandlerColor; #endregion Internal Vars #region Constructors public MetroSetTrackBar() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); _maximum = 100; _minimum = 0; _value = 0; _currentValue = Convert.ToInt32(Value / (double)(Maximum) - (2 * Width)); UpdateStyles(); _utl = new Utilites(); ApplyTheme(); } #endregion Constructors #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. private void ApplyTheme(Style style = Style.Light) { if (!IsDerivedStyle) return; switch (style) { case Style.Light: HandlerColor = Color.FromArgb(180, 180, 180); BackgroundColor = Color.FromArgb(205, 205, 205); ValueColor = Color.FromArgb(65, 177, 225); DisabledBackColor = Color.FromArgb(235, 235, 235); DisabledValueColor = Color.FromArgb(205, 205, 205); DisabledHandlerColor = Color.FromArgb(196, 196, 196); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: HandlerColor = Color.FromArgb(143, 143, 143); BackgroundColor = Color.FromArgb(90, 90, 90); ValueColor = Color.FromArgb(65, 177, 225); DisabledBackColor = Color.FromArgb(80, 80, 80); DisabledValueColor = Color.FromArgb(109, 109, 109); DisabledHandlerColor = Color.FromArgb(90, 90, 90); ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.TrackBarDictionary) { switch (varkey.Key) { case "HandlerColor": HandlerColor = _utl.HexColor((string)varkey.Value); break; case "BackColor": BackgroundColor = _utl.HexColor((string)varkey.Value); break; case "ValueColor": ValueColor = _utl.HexColor((string)varkey.Value); break; case "DisabledBackColor": DisabledBackColor = _utl.HexColor((string)varkey.Value); break; case "DisabledValueColor": DisabledValueColor = _utl.HexColor((string)varkey.Value); break; case "DisabledHandlerColor": DisabledHandlerColor = _utl.HexColor((string)varkey.Value); break; default: return; } } UpdateProperties(); break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Draw Control protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; Cursor = Cursors.Hand; using (var bg = new SolidBrush(Enabled ? BackgroundColor : DisabledBackColor)) { using (var v = new SolidBrush(Enabled ? ValueColor : DisabledValueColor)) { using (var vc = new SolidBrush(Enabled ? HandlerColor : DisabledHandlerColor)) { g.FillRectangle(bg, new Rectangle(0, 6, Width, 4)); if (_currentValue != 0) g.FillRectangle(v, new Rectangle(0, 6, _currentValue, 4)); g.FillRectangle(vc, _track); } } } } #endregion #region Properties /// /// Gets or sets the upper limit of the range this TrackBar is working with. /// [Category("MetroSet Framework"), Description("Gets or sets the upper limit of the range this TrackBar is working with.")] public int Maximum { get => _maximum; set { _maximum = value; RenewCurrentValue(); MoveTrack(); Invalidate(); } } /// /// Gets or sets the lower limit of the range this TrackBar is working with. /// [Category("MetroSet Framework"), Description("Gets or sets the lower limit of the range this TrackBar is working with.")] public int Minimum { get => _minimum; set { if (!(value < 0)) { _minimum = value; RenewCurrentValue(); MoveTrack(); Invalidate(); } } } /// /// Gets or sets a numeric value that represents the current position of the scroll box on the track bar. /// [Category("MetroSet Framework"), Description("Gets or sets a numeric value that represents the current position of the scroll box on the track bar.")] public int Value { get => _value; set { if (value != _value) { _value = value; RenewCurrentValue(); MoveTrack(); Invalidate(); Scroll?.Invoke(this); } } } [Browsable(false)] public override Color BackColor => Color.Transparent; /// /// Gets or sets the value color in normal mouse sate. /// [Category("MetroSet Framework"), Description(" Gets or sets the value color in normal mouse sate.")] public Color ValueColor { get { return _valueColor; } set { _valueColor = value; Refresh(); } } /// /// Gets or sets the handler color. /// [Category("MetroSet Framework"), Description("Gets or sets the handler color.")] public Color HandlerColor { get { return _handlerColor; } set { _handlerColor = value; Refresh(); } } /// /// Gets or sets the control BackColor. /// [Category("MetroSet Framework"), Description("Gets or sets the control backcolor.")] [DisplayName("BackColor")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the value of the control whenever while disabled /// [Category("MetroSet Framework"), Description("Gets or sets the value of the control whenever while disabled.")] public Color DisabledValueColor { get { return _disabledValueColor; } set { _disabledValueColor = value; Refresh(); } } /// /// Gets or sets disabled BackColor used by the control /// [Category("MetroSet Framework"), Description("Gets or sets disabled backcolor used by the control.")] public Color DisabledBackColor { get { return _disabledBackColor; } set { _disabledBackColor = value; Refresh(); } } /// /// Gets or sets the border color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the border color while the control disabled.")] public Color DisabledBorderColor { get { return _disabledBorderColor; } set { _disabledBorderColor = value; Refresh(); } } /// /// Gets or sets the handler color while the control disabled. /// [Category("MetroSet Framework"), Description("Gets or sets the handler color while the control disabled.")] public Color DisabledHandlerColor { get { return _disabledHandlerColor; } set { _disabledHandlerColor = value; Refresh(); } } private bool _isDerivedStyle = true; /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// [Category("MetroSet Framework")] [Description("Gets or sets the whether this control reflect to parent(s) style. \n " + "Set it to false if you want the style of this control be independent. ")] public bool IsDerivedStyle { get { return _isDerivedStyle; } set { _isDerivedStyle = value; Refresh(); } } #endregion #region Events public event ScrollEventHandler Scroll; public delegate void ScrollEventHandler(object sender); /// /// Handling mouse move event so that we can handle the thumb value. /// /// MouseEventArgs protected override void OnMouseMove(MouseEventArgs e) { if (_variable && e.X > -1 && e.X < Width + 1) { Value = Minimum + (int)Math.Round((double)(Maximum - Minimum) * e.X / Width); } base.OnMouseMove(e); } /// /// Handling mouse down event so that we can put the thumb in clicked state. /// /// protected override void OnMouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left && Height > 0) { RenewCurrentValue(); _track = new Rectangle(_currentValue, 0, 6, 16); _variable = new Rectangle(_currentValue, 0, 6, 16).Contains(e.Location); } base.OnMouseDown(e); } /// /// Handling mouse up event. /// /// MouseEventArgs protected override void OnMouseUp(MouseEventArgs e) { _variable = false; base.OnMouseUp(e); } /// /// Handling key press event so that we can change the track value by keys. /// /// MouseEventArgs protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.Down || e.KeyCode == Keys.Left) { if (Value != 0) { Value -= 1; } } else if (e.KeyCode == Keys.Add || e.KeyCode == Keys.Up || e.KeyCode == Keys.Right) { if (Value != Maximum) { Value += 1; } } base.OnKeyDown(e); } /// /// Handling the height and value of the track while resizing the control. /// /// protected override void OnResize(EventArgs e) { RenewCurrentValue(); MoveTrack(); Height = 16; Invalidate(); base.OnResize(e); } /// /// The Method to provide the track value. /// private void MoveTrack() { _track = new Rectangle(_currentValue, 0, 6, 16); } /// /// The Method to renew the value of the track. /// public void RenewCurrentValue() { _currentValue = Convert.ToInt32(Math.Round((double)(Value - Minimum) / (Maximum - Minimum) * (Width - 6))); Invalidate(); } #endregion } } ================================================ FILE: MetroSet UI/Design/MetroSetBadgeDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetBadgeDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetBadgeActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetButtonDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetButtonDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetButtonActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetCheckBoxDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetCheckBoxDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetCheckBoxActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetControBoxDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetControBoxDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetControlBoxActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetDefaultButtonDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetDefaultButtonDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetDefaultButtonActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetDividerDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetDividerDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetDividerActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetEllipseDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetEllipseDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetEllipseActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetLabelDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetLabelDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetLabelActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetLinkDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetLinkDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetLinkActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetListBoxDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetListBoxDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetListBoxActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetNumericDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetNumericDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetNumericActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetProgressBarDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetProgressBarDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetProgressBarActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetRadioButtonDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetRadioButtonDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetRadioButtonActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetRichTextBoxDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetRichTextBoxDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetRichTextBoxActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetScrollBarDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetScrollBarDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetScrollBarActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetSwitchDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetSwitchDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetSwitchActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetTabControlDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using System.Windows.Forms.Design; using MetroSet_UI.Child; using MetroSet_UI.Controls; using MetroSet_UI.Native; namespace MetroSet_UI.Design { /// /// The below class designer is a part from : https://www.codeproject.com/Articles/38014/KRBTabControl after a few clean code clean up. /// public class MetroSetTabControlDesigner : ParentControlDesigner { #region Instance Members private DesignerVerbCollection _verbs; private IDesignerHost _designerHost; private IComponentChangeService _changeService; #endregion Instance Members #region Constructor #endregion Constructor #region Property public override DesignerVerbCollection Verbs { get { if (_verbs == null) { var addVerbs = new[] { new DesignerVerb("Add Tab", OnAddTab), new DesignerVerb("Remove Tab", OnRemoveTab) }; _verbs = new DesignerVerbCollection(); _verbs.AddRange(addVerbs); if (!(Control is MetroSetTabControl parentControl)) return _verbs; switch (parentControl.TabPages.Count) { case 0: _verbs[1].Enabled = false; break; default: _verbs[1].Enabled = true; break; } } return _verbs; } } #endregion Property #region Override Methods public override void Initialize(IComponent component) { base.Initialize(component); _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); // Update your designer verb whenever ComponentChanged event occurs. if (_changeService != null) _changeService.ComponentChanged += OnComponentChanged; } /// /// Override this method to remove unused or inappropriate properties. /// /// Properties collection of the control. protected override void PostFilterProperties(IDictionary properties) { properties.Remove("Margin"); properties.Remove("ImeMode"); properties.Remove("Padding"); properties.Remove("Enabled"); properties.Remove("RightToLeft"); properties.Remove("RightToLeftLayout"); properties.Remove("ApplicationSettings"); properties.Remove("DataBindings"); base.PostFilterProperties(properties); } protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.Msg == (int)User32.Msgs.WM_NCHITTEST) { if (m.Result.ToInt32() == User32._HT_TRANSPARENT) m.Result = (IntPtr)User32._HTCLIENT; } } protected override bool GetHitTest(Point point) { var selectionService = (ISelectionService)GetService(typeof(ISelectionService)); var selectedObject = selectionService?.PrimarySelection; if (selectedObject != null && selectedObject.Equals(Control)) { var p = Control.PointToClient(point); var hti = new User32.TCHITTESTINFO(p, User32.TabControlHitTest.TCHT_ONITEM); var m = new Message { HWnd = Control.Handle, Msg = User32._TCM_HITTEST }; var lParam = Marshal.AllocHGlobal(Marshal.SizeOf(hti)); Marshal.StructureToPtr(hti, lParam, false); m.LParam = lParam; base.WndProc(ref m); Marshal.FreeHGlobal(lParam); if (m.Result.ToInt32() != -1) return hti.flags != User32.TabControlHitTest.TCHT_NOWHERE; } return false; } protected override void Dispose(bool disposing) { if (disposing && _changeService != null) _changeService.ComponentChanged -= OnComponentChanged; base.Dispose(disposing); } #endregion Override Methods #region Helper Methods /* When the designer modifies the MetroSetTabControl.TabPages collection, the Properties window is not updated until the control is deselected and then reselected. To correct this defect, you need to explicitly notify the IDE that a change has been made by using the PropertyDescriptor for the property. */ private void OnAddTab(Object sender, EventArgs e) { var parentControl = Control as MetroSetTabControl; var oldTabs = parentControl?.TabPages; // Notify the IDE that the TabPages collection property of the current tab control has changed. RaiseComponentChanging(TypeDescriptor.GetProperties(parentControl)["TabPages"]); var newTab = (MetroSetSetTabPage)_designerHost.CreateComponent(typeof(MetroSetSetTabPage)); newTab.Text = newTab.Name; parentControl?.TabPages.Add(newTab); if (parentControl == null) return; parentControl.SelectedTab = newTab; RaiseComponentChanged(TypeDescriptor.GetProperties(parentControl)["TabPages"], oldTabs, parentControl.TabPages); } private void OnRemoveTab(Object sender, EventArgs e) { var parentControl = Control as MetroSetTabControl; if (parentControl != null && parentControl.SelectedIndex < 0) return; var oldTabs = parentControl?.TabPages; // Notify the IDE that the TabPages collection property of the current tab control has changed. RaiseComponentChanging(TypeDescriptor.GetProperties(parentControl)["TabPages"]); _designerHost.DestroyComponent(parentControl?.SelectedTab); RaiseComponentChanged(TypeDescriptor.GetProperties(parentControl)["TabPages"], oldTabs, parentControl?.TabPages); } private void OnComponentChanged(object sender, ComponentChangedEventArgs e) { if (!(e.Component is MetroSetTabControl parentControl) || e.Member.Name != "TabPages") return; foreach (DesignerVerb verb in Verbs) { if (verb.Text != "Remove Tab") continue; switch (parentControl.TabPages.Count) { case 0: verb.Enabled = false; break; default: verb.Enabled = true; break; } break; } } #endregion Helper Methods } } ================================================ FILE: MetroSet UI/Design/MetroSetTabpageDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Windows.Forms.Design; namespace MetroSet_UI.Design { internal class MetroSetTabPageDesigner : ScrollableControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode","BorderStyle","Margin","Padding","Enabled","UseVisualStyleBackColor" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } } } ================================================ FILE: MetroSet UI/Design/MetroSetTextBoxDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetTextBoxDesigner : ControlDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetTextBoxActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetTileDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetTileDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetTileActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetToolTipDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetToolTipDesigner : ComponentDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetToolTipActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/MetroSetTrackBarDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using System.Windows.Forms.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { internal class MetroSetTrackBarDesigner : ControlDesigner { private readonly string[] _propertiesToRemove = { "BackgroundImage", "BackgroundImageLayout", "ForeColor", "RightToLeft","ImeMode" }; protected override void PostFilterProperties(System.Collections.IDictionary properties) { foreach (var property in _propertiesToRemove) { properties.Remove(property); } base.PostFilterProperties(properties); } private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new MetroSetTrackBarActionList(Component) }); } } ================================================ FILE: MetroSet UI/Design/StyleManagerDesigner.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.ComponentModel.Design; using MetroSet_UI.Actions; namespace MetroSet_UI.Design { public class StyleManagerDesigner : ComponentDesigner { private DesignerActionListCollection _actionListCollection; public override DesignerActionListCollection ActionLists => _actionListCollection ?? (_actionListCollection = new DesignerActionListCollection { new StyleManagerActionList(Component) }); } } ================================================ FILE: MetroSet UI/Enums/BageAlign.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum BadgeAlign { // Sets the badge to Topleft corner. Topleft, // Sets the badge to TopRight corner. TopRight, // Sets the badge to BottmLeft corner. BottmLeft, // Sets the badge to BottomRight corner. BottomRight } } ================================================ FILE: MetroSet UI/Enums/CheckState.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum CheckState { //The control is unchecked. Unchecked = 0, //The control is checked. Checked = 1, } } ================================================ FILE: MetroSet UI/Enums/DividerStyle.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum DividerStyle { // Sets the Orientation of Divider to Horizontal. Horizontal, // Sets the Orientation of Divider to Vertical. Vertical } } ================================================ FILE: MetroSet UI/Enums/EasingType.cs ================================================ namespace MetroSet_UI.Enums { // for animate public enum EasingType { None, Linear, QuadIn, QuadOut, QuadInOut, CubeIn, CubeOut, CubeInOut, QuartIn, QuartOut, QuartInOut, QuintIn, QuintOut, QuintInOut, SineIn, SineOut, SineInOut } } ================================================ FILE: MetroSet UI/Enums/MouseSates.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { /// /// The helper enumerator to get mouse states. /// public enum MouseMode { Normal, Hovered, Pushed, Disabled } } ================================================ FILE: MetroSet UI/Enums/ProgressOrientation.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum ProgressOrientation { /// /// Sets the progressbar on horizontal orientation. /// Horizontal, /// /// Sets the progressbar on vertical orientation. /// Vertical } } ================================================ FILE: MetroSet UI/Enums/ScrollOrientation.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum ScrollOrientate { /// /// Sets the scrollbar on horizontal orientation. /// Horizontal, /// /// Sets the scrollbar on vertical orientation. /// Vertical } } ================================================ FILE: MetroSet UI/Enums/SignStyle.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum SignStyle { // Sets the CheckBox checking style to checkmark. Sign, // Sets the CheckBox checking style to rectangle. Shape } } ================================================ FILE: MetroSet UI/Enums/Style.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum Style { // Sets the style of the control to Light. Light, // Sets the style of the control to Dark. Dark, // Sets the style of the control to Custom. Custom } } ================================================ FILE: MetroSet UI/Enums/TabStyle.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum TabStyle { /// /// Sets the TabControlStyle Style1. /// Style1, /// /// Sets the TabControlStyle Style2. /// Style2 } } ================================================ FILE: MetroSet UI/Enums/TextAlign.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum TextAlign { // Sets the textalign of the control to Left. Left, // Sets the textalign of the control to Center. Center, // Sets the textalign of the control to Right. Right } } ================================================ FILE: MetroSet UI/Enums/TileAlign.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace MetroSet_UI.Enums { public enum TileAlign { // Sets the Tile to Topleft corner. Topleft, // Sets the Tile to TopRight corner. TopRight, // Sets the Tile to BottmLeft corner. BottmLeft, // Sets the Tile to BottomRight corner. BottomRight, // Sets the Tile to TopCenter corner. TopCenter, // Sets the Tile to BottomCenter corner. BottomCenter } } ================================================ FILE: MetroSet UI/Extensions/Global Font.cs ================================================ using System.Drawing; namespace MetroSet_UI.Extensions { public class Global_Font { /// /// Gets the font for the most of controls. /// /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font Regular(float size) { return new Font("Segoe UI", size); } /// /// Gets the font for the most of controls. /// /// The Font name. /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font Normal(string fnt, float size) { return new Font(fnt, size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font Light(float size) { return new Font("Segoe UI Light", size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font Italic(float size) { return new Font("Segoe UI", size, FontStyle.Italic); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font SemiBold(float size) { return new Font("Segoe UI semibold", size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe UI font. /// The Segoe UI font with the given size. public static Font Bold(float size) { return new Font("Segoe UI", size, FontStyle.Bold); } } } ================================================ FILE: MetroSet UI/Extensions/GraphicsQuality.cs ================================================ using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Windows.Forms; namespace MetroSet_UI.Extensions { public class GraphicsQuality { /// /// sets The quality of the drawing to the given graphics. /// /// The Graphics to set the quality /// Gets or sets the rendering quality for this System.Drawing.Graphics. /// /// Gets or set a value specifying how pixels are offset during rendering of this /// Gets or sets the interpolation mode associated with this System.Drawing.Graphics. /// Gets or sets the rendering quality of composited images drawn to this System.Drawing.Graphics. public void SetQuality(Graphics e, SmoothingMode smoothingMode = SmoothingMode.Default, TextRenderingHint textRenderingHint = TextRenderingHint.ClearTypeGridFit, PixelOffsetMode pixelOffsetMode = PixelOffsetMode.Default, InterpolationMode interpolationMode = InterpolationMode.Default, CompositingQuality compositingQuality = CompositingQuality.Default) { try { e.SmoothingMode = smoothingMode; e.PixelOffsetMode = pixelOffsetMode; e.InterpolationMode = interpolationMode; e.CompositingQuality = compositingQuality; e.TextRenderingHint = textRenderingHint; } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } } } } ================================================ FILE: MetroSet UI/Extensions/Methods.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace MetroSet_UI.Extensions { internal class Methods { /// /// The Method to draw the image from encoded base64 string. /// /// The Graphics to draw the image. /// The Encoded base64 image. /// The Rectangle area for the image. public void DrawImageFromBase64(Graphics graphics, string base64Image, Rectangle rect) { Image im; using (var ms = new System.IO.MemoryStream(Convert.FromBase64String(base64Image))) { im = Image.FromStream(ms); ms.Close(); } graphics.DrawImage(im, rect); } /// /// The Method to draw the image with custom color. /// /// The Graphic to draw the image. /// The Rectangle area of image. /// The image that the custom color applies on it. /// The Color that be applied to the image. /// public void DrawImageWithColor(Graphics G, Rectangle r, Image image, Color c) { var ptsArray = new[] { new[] {Convert.ToSingle(c.R / 255.0), 0f, 0f, 0f, 0f}, new[] {0f, Convert.ToSingle(c.G / 255.0), 0f, 0f, 0f}, new[] {0f, 0f, Convert.ToSingle(c.B / 255.0), 0f, 0f}, new[] {0f, 0f, 0f, Convert.ToSingle(c.A / 255.0), 0f}, new[] { Convert.ToSingle( c.R/255.0), Convert.ToSingle( c.G/255.0), Convert.ToSingle( c.B/255.0), 0f, Convert.ToSingle( c.A/255.0) } }; var imageAttributes = new ImageAttributes(); imageAttributes.SetColorMatrix(new ColorMatrix(ptsArray), ColorMatrixFlag.Default, ColorAdjustType.Default); G.DrawImage(image, r, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttributes); image.Dispose(); } /// /// The Method to draw the image with custom color. /// /// The Graphic to draw the image. /// The Rectangle area of image. /// The Encoded base64 image that the custom color applies on it. /// The Color that be applied to the image. /// public void DrawImageWithColor(Graphics G, Rectangle r, string image, Color c) { var im = ImageFromBase64(image); var ptsArray = new[] { new[] {Convert.ToSingle(c.R / 255.0), 0f, 0f, 0f, 0f}, new[] {0f, Convert.ToSingle(c.G / 255.0), 0f, 0f, 0f}, new[] {0f, 0f, Convert.ToSingle(c.B / 255.0), 0f, 0f}, new[] {0f, 0f, 0f, Convert.ToSingle(c.A / 255.0), 0f}, new[] { Convert.ToSingle( c.R/255.0), Convert.ToSingle( c.G/255.0), Convert.ToSingle( c.B/255.0), 0f, Convert.ToSingle( c.A/255.0) } }; var imageAttributes = new ImageAttributes(); imageAttributes.SetColorMatrix(new ColorMatrix(ptsArray), ColorMatrixFlag.Default, ColorAdjustType.Default); G.DrawImage(im, r, 0, 0, im.Width, im.Height, GraphicsUnit.Pixel, imageAttributes); } /// /// The String format to provide the alignment. /// /// Horizontal alignment. /// Horizontal alignment. alignment. /// The String format. public StringFormat SetPosition(StringAlignment horizontal = StringAlignment.Center, StringAlignment vertical = StringAlignment.Center) { return new StringFormat { Alignment = horizontal, LineAlignment = vertical }; } /// /// The Matrix array of single from color. /// /// The Color. /// /// The Opacity. /// The Matrix array of single from the given color public float[][] ColorToMatrix(float alpha, Color c) { return new[] { new [] {Convert.ToSingle(c.R / 255),0,0,0,0}, new [] {0,Convert.ToSingle(c.G / 255),0,0,0}, new [] {0,0,Convert.ToSingle(c.B / 255),0,0}, new [] {0,0,0,Convert.ToSingle(c.A / 255),0}, new [] { Convert.ToSingle(c.R / 255), Convert.ToSingle(c.G / 255), Convert.ToSingle(c.B / 255), alpha, Convert.ToSingle(c.A / 255) } }; } public void DrawImageWithTransparency(Graphics G, float alpha, Image image, Rectangle rect) { var colorMatrix = new ColorMatrix { Matrix33 = alpha }; var imageAttributes = new ImageAttributes(); imageAttributes.SetColorMatrix(colorMatrix); G.DrawImage(image, new Rectangle(rect.X, rect.Y, image.Width, image.Height), rect.X, rect.Y, image.Width, image.Height, GraphicsUnit.Pixel, imageAttributes); imageAttributes.Dispose(); } /// /// The Image from encoded base64 image. /// /// The Encoded base64 image /// The Image from encoded base64. public Image ImageFromBase64(string base64Image) { using (var ms = new System.IO.MemoryStream(Convert.FromBase64String(base64Image))) { return Image.FromStream(ms); } } /// /// Turns the rectangle to rounded rectangle. /// Credits : Aeonhack /// The Rectangle to fill. /// The Rounding border radius. /// Wether the top left of rectangle be round or not. /// Wether the top right of rectangle be round or not. /// Wether the bottom left of rectangle be round or not. /// Wether the bottom right of rectangle be round or not. /// the rounded rectangle base one given rectangle /// public GraphicsPath RoundRec(Rectangle r, int curve, bool topLeft = true, bool topRight = true, bool bottomLeft = true, bool bottomRight = true) { var createRoundPath = new GraphicsPath(FillMode.Winding); if (topLeft) { createRoundPath.AddArc(r.X, r.Y, curve, curve, 180f, 90f); } else { createRoundPath.AddLine(r.X, r.Y, r.X, r.Y); } if (topRight) { createRoundPath.AddArc(r.Right - curve, r.Y, curve, curve, 270f, 90f); } else { createRoundPath.AddLine(r.Right - r.Width, r.Y, r.Width, r.Y); } if (bottomRight) { createRoundPath.AddArc(r.Right - curve, r.Bottom - curve, curve, curve, 0f, 90f); } else { createRoundPath.AddLine(r.Right, r.Bottom, r.Right, r.Bottom); } if (bottomLeft) { createRoundPath.AddArc(r.X, r.Bottom - curve, curve, curve, 90f, 90f); } else { createRoundPath.AddLine(r.X, r.Bottom, r.X, r.Bottom); } createRoundPath.CloseFigure(); return createRoundPath; } /// /// Turns the rectangle to rounded rectangle. /// Credits : Aeonhack /// The x-coordinate of the upper-left corner of this Rectangle/param> /// The y-coordinate of the upper-left corner of this Rectangle /// The Width of the rectangle /// The Height of the rectangle /// The Rounding border radius. /// Whether the top left of rectangle be round or not. /// Whether the top right of rectangle be round or not. /// Whether the bottom left of rectangle be round or not. /// Whether the bottom right of rectangle be round or not. /// the rounded rectangle base one given dimensions /// the rounded rectangle base one given details /// public GraphicsPath RoundRec(int x, int y, int width, int height, int curve, bool topLeft = true, bool topRight = true, bool bottomLeft = true, bool bottomRight = true) { var r = new Rectangle(x, y, width, height); var createRoundPath = new GraphicsPath(FillMode.Winding); if (topLeft) { createRoundPath.AddArc(r.X, r.Y, curve, curve, 180f, 90f); } else { createRoundPath.AddLine(r.X, r.Y, r.X, r.Y); } if (topRight) { createRoundPath.AddArc(r.Right - curve, r.Y, curve, curve, 270f, 90f); } else { createRoundPath.AddLine(r.Right - r.Width, r.Y, r.Width, r.Y); } if (bottomRight) { createRoundPath.AddArc(r.Right - curve, r.Bottom - curve, curve, curve, 0f, 90f); } else { createRoundPath.AddLine(r.Right, r.Bottom, r.Right, r.Bottom); } if (bottomLeft) { createRoundPath.AddArc(r.X, r.Bottom - curve, curve, curve, 90f, 90f); } else { createRoundPath.AddLine(r.X, r.Bottom, r.X, r.Bottom); } createRoundPath.CloseFigure(); return createRoundPath; } } } ================================================ FILE: MetroSet UI/Extensions/MetroSetFonts.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Drawing; using System.Drawing.Text; using System.Runtime.InteropServices; namespace MetroSet_UI.Extensions { public class MetroSetFonts { /// /// Gets the font for the most of controls. /// /// The Size of the Segoe WP Semilight font. /// The Segoe WP Semilight font with the given size. public static Font SemiLight(float size) { return GetFont(Properties.Resources.SegoeWP_Semilight, size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe WP Light font. /// The Segoe WP Light font with the given size. public static Font Light(float size) { return GetFont(Properties.Resources.SegoeWP_Light, size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe WP SemiBold font. /// The Segoe WP SemiBold font with the given size. public static Font SemiBold(float size) { return GetFont(Properties.Resources.SegoeWP_Semibold, size); } /// /// Gets the font for the most of controls. /// /// The Size of the Segoe WP Bold font. /// The Segoe WP Bold font with the given size. public static Font Bold(float size) { return GetFont(Properties.Resources.SegoeWP_Bold, size); } /// /// Gets or sets the font of the most controls. /// /// The Size of the Segoe WP font. /// The Segoe WP font with the given size. public static Font Regular(float size) { return GetFont(Properties.Resources.SegoeWP, size); } public static Font UIRegular(float size) { return new Font("Segoe UI", size); } /// /// Gets the font stored from resources. /// /// The Font stored from resources. /// The Desired size for the font /// The Font stored from resources with desired size. public static Font GetFont(byte[] fontbyte, float size) { using (PrivateFontCollection privateFontCollection = new PrivateFontCollection()) { byte[] fnt = fontbyte; IntPtr buffer = Marshal.AllocCoTaskMem(fnt.Length); Marshal.Copy(fnt, 0, buffer, fnt.Length); privateFontCollection.AddMemoryFont(buffer, fnt.Length); return new Font(privateFontCollection.Families[0].Name, size); } } } } ================================================ FILE: MetroSet UI/Extensions/Utilites.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR alpha * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using MetroSet_UI.Native; namespace MetroSet_UI.Extensions { internal class Utilites { /// /// The Brush with two colors one center another surounding the center based on the given rectangle area. /// /// The Center color of the rectangle. /// The Surrounding color of the rectangle. /// The Point of surrounding. /// The Rectangle of the brush. /// The Brush with two colors one center another surounding the center. public static PathGradientBrush GlowBrush(Color CenterColor, Color SurroundColor, Point P, Rectangle Rect) { GraphicsPath GP = new GraphicsPath { FillMode = FillMode.Winding }; GP.AddRectangle(Rect); return new PathGradientBrush(GP) { CenterColor = CenterColor, SurroundColors = new[] { SurroundColor }, FocusScales = P }; } /// /// The Brush from RGBA color. /// /// Red. /// Green. /// Blue. /// Alpha. /// The Brush from given RGBA color. public SolidBrush SolidBrushRGBColor(int R, int G, int B, int A = 0) { return new SolidBrush(Color.FromArgb(A, R, G, B)); } /// /// The Brush from HEX color. /// /// HEX Color without hash. /// The Brush from given HEX color. public SolidBrush SolidBrushHTMlColor(string C_WithoutHash) { return new SolidBrush(HexColor(C_WithoutHash)); } /// /// The Pen from RGBA color. /// /// Red. /// Green. /// Blue. /// Alpha. /// /// The Pen from given RGBA color. public Pen PenRGBColor(int red, int green, int blue, int alpha, float size) { return new Pen(Color.FromArgb(alpha, red, green, blue), size); } /// /// The Pen from HEX color. /// /// HEX Color without hash. /// The size of the pen. /// public Pen PenHTMlColor(string colorWithoutHash, float size = 1) { return new Pen(HexColor(colorWithoutHash), size); } /// /// Gets Color based on given hex color string. /// /// Hex Color /// The Color based on given hex color string public Color HexColor(string hexColor) { return ColorTranslator.FromHtml(hexColor); } /// /// The Color from HEX by alpha property. /// /// Alpha. /// HEX Color with hash. /// The Color from HEX with given ammount of transparency public Color GetAlphaHexColor(int alpha, string hexColor) { return Color.FromArgb(alpha, ColorTranslator.FromHtml(hexColor)); } // Check and create handle of control // Credits : // control invalidate does not trigger the paint event of hidden or invisible control // see https://stackoverflow.com/questions/38137654 // force create handle // see https://stackoverflow.com/questions/1807921/ /// /// Initialize the Handle of Control and child controls if their handle were not created /// public void InitControlHandle(Control ctrl) { if (ctrl.IsHandleCreated) return; var unused = ctrl.Handle; foreach (Control child in ctrl.Controls) { InitControlHandle(child); } } /// /// Setting smoothness for hand type cursor especially while hovering controls. /// /// Windows message api. public void SmoothCursor(ref Message message) { if (message.Msg != User32.WM_SETCURSOR) return; User32.SetCursor(User32.LoadCursor(IntPtr.Zero, User32.IDC_HAND)); message.Result = IntPtr.Zero; } } } ================================================ FILE: MetroSet UI/Forms/MetroSetForm.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using MetroSet_UI.Components; using MetroSet_UI.Controls; using MetroSet_UI.Enums; using MetroSet_UI.Extensions; using MetroSet_UI.Interfaces; using MetroSet_UI.Native; using static MetroSet_UI.Native.User32; namespace MetroSet_UI.Forms { [ToolboxItem(false)] [ToolboxBitmap(typeof(MetroSetForm), "Bitmaps.Form.bmp")] [DesignerCategory("Form")] [DefaultEvent("Load")] [DesignTimeVisible(false)] [ComVisible(true)] [InitializationEvent("Load")] public class MetroSetForm : Form, IMetroForm { #region Constructor protected MetroSetForm() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ContainerControl | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _mth = new Methods(); _utl = new Utilites(); _user32 = new User32(); Padding = new Padding(12, 70, 12, 12); FormBorderStyle = FormBorderStyle.None; _backgroundImageTransparency = 0.90f; base.Font = MetroSetFonts.SemiLight(13); DropShadowEffect = true; _showLeftRect = true; _showHeader = false; AllowResize = true; ApplyTheme(); } #endregion Constructor #region Draw Control protected override void OnPaint(PaintEventArgs e) { e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; e.Graphics.InterpolationMode = InterpolationMode.High; e.Graphics.CompositingQuality = CompositingQuality.HighQuality; using (var b = new SolidBrush(BackgroundColor)) { e.Graphics.FillRectangle(b, new Rectangle(0, 0, Width, Height)); if (BackgroundImage != null) { _mth.DrawImageWithTransparency(e.Graphics, BackgroundImageTransparency, BackgroundImage, ClientRectangle); } } if (ShowBorder) { using (var p = new Pen(BorderColor, BorderThickness)) { e.Graphics.DrawRectangle(p, new Rectangle(0, 0, Width - 1, Height - 1)); } } if (ShowLeftRect) { using (var b = new LinearGradientBrush(new Rectangle(0, 25, SmallRectThickness, 35), SmallLineColor1, SmallLineColor2, 90)) { using (var textBrush = new SolidBrush(TextColor)) { e.Graphics.FillRectangle(b, new Rectangle(0, 40, SmallRectThickness, 35)); e.Graphics.DrawString(Text, Font, textBrush, new Point(SmallRectThickness + 10, 46)); } } } else { if (ShowHeader) { using (var b = new SolidBrush(HeaderColor)) { e.Graphics.FillRectangle(b, new Rectangle(1, 1, Width - 1, HeaderHeight)); } } var textBrush = new SolidBrush(TextColor); if (ShowTitle) { switch (TextAlign) { case TextAlign.Left: using (var stringFormat = new StringFormat() { LineAlignment = StringAlignment.Center }) { e.Graphics.DrawString(Text, Font, textBrush, new Rectangle(20, 0, Width, HeaderHeight), stringFormat); } break; case TextAlign.Center: using (var stringFormat = new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }) { e.Graphics.DrawString(Text, Font, textBrush, new Rectangle(20, 0, Width - 21, HeaderHeight), stringFormat); } break; case TextAlign.Right: using (var stringFormat = new StringFormat() { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Center }) { e.Graphics.DrawString(Text, Font, textBrush, new Rectangle(20, 0, Width - 26, HeaderHeight), stringFormat); } break; default: throw new ArgumentOutOfRangeException(); } } textBrush.Dispose(); } } #endregion Draw Control #region Properties /// /// Gets or sets the form backcolor. /// [Category("MetroSet Framework"), Description("Gets or sets the form backcolor.")] public Color BackgroundColor { get { return _backgroundColor; } set { _backgroundColor = value; Refresh(); } } /// /// Gets or sets the form fore color. /// [Category("MetroSet Framework"), Description("Gets or sets the form forecolor.")] public override Color ForeColor { get; set; } /// /// Gets or sets the form border color. /// [Category("MetroSet Framework"), Description("Gets or sets the form bordercolor.")] public Color BorderColor { get { return _borderColor; } set { _borderColor = value; Refresh(); } } /// /// Gets or sets the form text color. /// [Category("MetroSet Framework"), Description("Gets or sets the form textcolor.")] public Color TextColor { get { return _textColor; } set { _textColor = value; Refresh(); } } /// /// Gets or sets the form small line color 1. /// [Category("MetroSet Framework"), Description("Gets or sets the form small line color 1.")] public Color SmallLineColor1 { get { return _smallLineColor1; } set { _smallLineColor1 = value; Refresh(); } } /// /// Gets or sets the form small line color 2. /// [Category("MetroSet Framework"), Description("Gets or sets the form small line color 2.")] public Color SmallLineColor2 { get { return _smallLineColor2; } set { _smallLineColor2 = value; Refresh(); } } /// /// Gets or sets the header color. /// [Category("MetroSet Framework"), Description("Gets or sets the header color.")] public Color HeaderColor { get { return _headerColor; } set { _headerColor = value; Refresh(); } } /// /// Gets or sets the width of the small rectangle on top left of the window. /// [Category("MetroSet Framework")] [Description("Gets or sets the width of the small rectangle on top left of the window.")] public int SmallRectThickness { get { return _smallRectThickness; } set { _smallRectThickness = value; Refresh(); } } /// /// Gets or sets whether the border be shown. /// [Category("MetroSet Framework"), Description("Gets or sets whether the border be shown."), DefaultValue(true)] public bool ShowBorder { get { return _showBorder; } set { _showBorder = value; Refresh(); } } /// /// Gets or sets the border thickness. /// [Category("MetroSet Framework")] [Description("Gets or sets the border thickness.")] public float BorderThickness { get { return _borderThickness; } set { _borderThickness = value; Refresh(); } } /// Gets or sets the border style of the form. [DefaultValue(FormBorderStyle.None)] [Browsable(false)] private new FormBorderStyle FormBorderStyle { set { if (!Enum.IsDefined(typeof(FormBorderStyle), value)) throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(FormBorderStyle)); base.FormBorderStyle = FormBorderStyle.None; } } /// Gets or sets a value indicating whether the Maximize button is displayed in the caption bar of the form. /// true to display a Maximize button for the form; otherwise, false. The default is true. [Category("WindowStyle")] [Browsable(false)] [DefaultValue(false)] [Description("FormMaximizeBox")] public new bool MaximizeBox => false; /// Gets or sets a value indicating whether the Minimize button is displayed in the caption bar of the form. /// true to display a Minimize button for the form; otherwise, false. The default is true. [Category("WindowStyle")] [Browsable(false)] [DefaultValue(false)] [Description("FormMinimizeBox")] public new bool MinimizeBox { get => false; set => value = false; } /// /// Gets or sets whether the title be shown. /// [Category("MetroSet Framework"), Description("Gets or sets whether the title be shown.")] public bool ShowTitle { get { return _showTitle; } set { _showTitle = value; Refresh(); } } /// /// Gets or sets the title alignment. /// [Category("MetroSet Framework"), Description("Gets or sets the title alignment.")] public TextAlign TextAlign { get { return _textAlign; } set { _textAlign = value; Refresh(); } } /// /// Gets or sets whether show the header. /// [Category("MetroSet Framework"), Description("Gets or sets whether show the header.")] public bool ShowHeader { get => _showHeader; set { _showHeader = value; if (value) { ShowLeftRect = false; Padding = new Padding(2, HeaderHeight + 30, 2, 2); Text = Text.ToUpper(); TextColor = Color.White; ShowTitle = true; foreach (Control c in Controls) { if (c.GetType() != typeof(MetroSetControlBox)) continue; c.BringToFront(); c.Location = new Point(Width - 12, 11); } } else { Padding = new Padding(12, 90, 12, 12); ShowTitle = false; } Invalidate(); } } /// /// Gets or sets whether the small rectangle on top left of the window be shown. /// [Category("MetroSet Framework"), Description("Gets or sets whether the small rectangle on top left of the window be shown.")] public bool ShowLeftRect { get => _showLeftRect; set { _showLeftRect = value; if (value) { ShowHeader = false; } Invalidate(); } } /// /// Gets or sets whether the form can be move or not. /// [Category("MetroSet Framework"), Description("Gets or sets whether the form can be move or not."), DefaultValue(true)] public bool Moveable { get { return _movable; } set { _movable = value; Refresh(); } } /// /// Gets or sets whether the form use animation. /// [Category("MetroSet Framework"), Description("Gets or sets whether the form use animation.")] public bool UseSlideAnimation { get { return _useSlideAnimation; } set { _useSlideAnimation = value; Refresh(); } } [Browsable(false)] public new Padding Padding { get => base.Padding; set => base.Padding = value; } /// /// Gets or sets the background image transparency. /// [Category("MetroSet Framework"), Description("Gets or sets the backgroundimage transparency.")] public float BackgroundImageTransparency { get => _backgroundImageTransparency; set { if (value > 1) throw new Exception("The Value must be between 0-1."); _backgroundImageTransparency = value; Invalidate(); } } /// /// Gets or sets the header height. /// [Category("MetroSet Framework"), Description("Gets or sets the header height.")] public int HeaderHeight { get { return _headerHeight; } set { _headerHeight = value; Refresh(); } } /// /// Gets or sets the background image displayed in the control. /// [Category("MetroSet Framework"), Description("Gets or sets the background image displayed in the control.")] public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; } /// /// Gets or sets whether the drop shadow effect apply on form. /// [Category("MetroSet Framework"), Description("Gets or sets whether the drop shadow effect apply on form.")] public bool DropShadowEffect { get { return _dropShadowEffect; } set { _dropShadowEffect = value; Refresh(); } } /// /// Gets or sets whether the user be able to resize the form or not. /// [Category("MetroSet Framework"), Description("Gets or sets whether the user be able to resize the form or not.")] public bool AllowResize { get { return _allowResize; } set { _allowResize = value; Refresh(); } } #endregion Properties #region Methods /// /// Allows the user to resize the form at runtime. /// Credits : dizzy.stackoverflow /// /// Windows Message. private void ResizeForm(ref Message message) { if (!AllowResize) return; var x = (int)(message.LParam.ToInt64() & 65535); var y = (int)((message.LParam.ToInt64() & -65536) >> 0x10); var point = PointToClient(new Point(x, y)); #region From Corners if (point.Y >= Height - 0x10) { if (point.X >= Width - 0x10) { message.Result = (IntPtr)(IsMirrored ? 0x10 : 0x11); return; } if (point.X <= 0x10) { message.Result = (IntPtr)(IsMirrored ? 0x11 : 0x10); return; } } else if (point.Y <= 0x10) { if (point.X <= 0x10) { message.Result = (IntPtr)(IsMirrored ? 0xe : 0xd); return; } if (point.X >= Width - 0x10) { message.Result = (IntPtr)(IsMirrored ? 0xd : 0xe); return; } } #endregion #region From Sides if (point.Y <= 0x10) { message.Result = (IntPtr)0xc; return; } if (point.Y >= Height - 0x10) { message.Result = (IntPtr)0xf; return; } if (point.X <= 0x10) { message.Result = (IntPtr)0xa; return; } if (point.X >= Width - 0x10) { message.Result = (IntPtr)0xb; } #endregion } #endregion Methods #region Interfaces /// /// Gets or sets the style associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the style associated with the control."), DefaultValue(Style.Light)] public Style Style { get => StyleManager?.Style ?? _style; set { _style = value; switch (value) { case Style.Light: ApplyTheme(); break; case Style.Dark: ApplyTheme(Style.Dark); break; case Style.Custom: ApplyTheme(Style.Custom); break; default: throw new ArgumentOutOfRangeException(nameof(value), value, null); } Invalidate(); } } /// /// Gets or sets the Style Manager associated with the control. /// [Category("MetroSet Framework"), Description("Gets or sets the Style Manager associated with the control.")] public StyleManager StyleManager { get => _styleManager; set { _styleManager = value; Invalidate(); } } /// /// Gets or sets the The Author name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Author name associated with the theme.")] public string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// [Category("MetroSet Framework"), Description("Gets or sets the The Theme name associated with the theme.")] public string ThemeName { get; set; } private User32 User32 => _user32; private User32 _user32 { get; } #endregion Interfaces #region Global Vars private readonly Utilites _utl; private readonly Methods _mth; #endregion Global Vars #region Internal Vars private Style _style; private StyleManager _styleManager; private bool _showLeftRect; private bool _showHeader; private float _backgroundImageTransparency; private Color _backgroundColor; private Color _borderColor; private Color _textColor; private Color _smallLineColor1; private Color _smallLineColor2; private Color _headerColor; private int _smallRectThickness = 10; private bool _showBorder; private float _borderThickness = 1; private bool _showTitle = true; private TextAlign _textAlign = TextAlign.Left; private bool _movable = true; private bool _useSlideAnimation; private int _headerHeight = 40; private bool _dropShadowEffect; private bool _allowResize; #endregion Internal Vars #region ApplyTheme /// /// Gets or sets the style provided by the user. /// /// The Style. internal void ApplyTheme(Style style = Style.Light) { switch (style) { case Style.Light: ForeColor = Color.Gray; BackgroundColor = Color.White; BorderColor = Color.FromArgb(65, 177, 225); TextColor = ShowHeader ? Color.White : Color.Gray; SmallLineColor1 = Color.FromArgb(65, 177, 225); SmallLineColor2 = Color.FromArgb(65, 177, 225); HeaderColor = Color.FromArgb(65, 177, 225); ThemeAuthor = "Narwin"; ThemeName = "MetroLite"; UpdateProperties(); break; case Style.Dark: ForeColor = Color.White; BackgroundColor = Color.FromArgb(30, 30, 30); BorderColor = Color.FromArgb(65, 177, 225); SmallLineColor1 = Color.FromArgb(65, 177, 225); SmallLineColor2 = Color.FromArgb(65, 177, 225); HeaderColor = Color.FromArgb(65, 177, 225); TextColor = ShowHeader ? Color.Gray : Color.White; ThemeAuthor = "Narwin"; ThemeName = "MetroDark"; UpdateProperties(); break; case Style.Custom: if (StyleManager != null) foreach (var varkey in StyleManager.FormDictionary) { if (!string.Equals(varkey.Key, null, StringComparison.Ordinal) && varkey.Key != null) { if (varkey.Key == "ForeColor") { ForeColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "BackColor") { BackgroundColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "BorderColor") { BorderColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "TextColor") { TextColor = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "SmallLineColor1") { SmallLineColor1 = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "SmallLineColor2") { SmallLineColor2 = _utl.HexColor((string)varkey.Value); } else if (varkey.Key == "SmallRectThickness") { SmallRectThickness = int.Parse(varkey.Value.ToString()); } else if (varkey.Key == "HeaderColor") { HeaderColor = _utl.HexColor((string)varkey.Value); } } else { throw new Exception("FormDictionary is empty"); } } UpdateProperties(); break; } } private void UpdateProperties() { Invalidate(); } #endregion Theme Changing #region Events /// /// Handling windows messages. /// /// Windows Messages protected override void WndProc(ref Message message) { base.WndProc(ref message); if ((message.Msg != _WM_NCHITTEST) | !Moveable) return; // Allow users to move the form. if ((int)message.Result == _HTCLIENT) message.Result = new IntPtr(_HTCAPTION); // Allow users to resize the form. ResizeForm(ref message); } protected override void OnHandleCreated(EventArgs e) { AutoScaleMode = AutoScaleMode.None; base.OnHandleCreated(e); } /// /// Make the drop shadow effect on form in case drop shadow property set to 'true'. /// protected override CreateParams CreateParams { get { if (!DropShadowEffect) return base.CreateParams; var cp = base.CreateParams; cp.ClassStyle |= _CS_DROPSHADOW; return cp; } } /// /// Fade in effect on form while loading. /// /// EventArgs protected override void OnLoad(EventArgs e) { base.OnLoad(e); // https://www.codeproject.com/Articles/30255/C-Fade-Form-Effect-With-the-AnimateWindow-API-Func AnimateWindow(Handle, 800, AnimateWindowFlags.AW_ACTIVATE | (UseSlideAnimation ? AnimateWindowFlags.AW_HOR_POSITIVE | AnimateWindowFlags.AW_SLIDE : AnimateWindowFlags.AW_BLEND)); } /// /// Fade out effect on form while loading. /// /// EventArgs protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); // https://www.codeproject.com/Articles/30255/C-Fade-Form-Effect-With-the-AnimateWindow-API-Func if (e.Cancel == false) { AnimateWindow(Handle, 800, User32.AW_HIDE | (UseSlideAnimation ? AnimateWindowFlags.AW_HOR_NEGATIVE | AnimateWindowFlags.AW_SLIDE : AnimateWindowFlags.AW_BLEND)); } } #endregion } } ================================================ FILE: MetroSet UI/Forms/MetroSetForm.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 ================================================ FILE: MetroSet UI/Forms/MetroSetMessageBox.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using MetroSet_UI.Controls; using MetroSet_UI.Extensions; namespace MetroSet_UI.Forms { public class MetroSetMessageBox : MetroSetForm { #region Internal vars private Size _buttonSize; private MetroSetDefaultButton _okButton; private MetroSetDefaultButton _yesButton; private MetroSetDefaultButton _noButton; private MetroSetDefaultButton _cancelButton; private MetroSetDefaultButton _retryButton; private MetroSetDefaultButton _abortButton; private MetroSetDefaultButton _ignoreButton; #endregion #region Properties /// /// Get or sets the parent form. /// private Form OwnerForm { get; set; } /// /// Gets or sets the content of the message. /// public string Content { get; set; } /// /// Gets or sets the title of the content /// public string Caption { get; set; } /// /// Gets or sets the MessageBoxButtons. /// public MessageBoxButtons Buttons { get; set; } /// /// Gets or sets the MessageBoxIcon. /// public new MessageBoxIcon Icon { get; set; } /// /// Gets or sets the BackgroundColor /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] private new static Color BackgroundColor { get; set; } /// /// Gets or sets the BorderColor /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] private new static Color BorderColor { get; set; } /// /// Gets or sets the ForegroundColor /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] private static Color ForegroundColor { get; set; } #endregion #region Constructor /// /// The Constructor. /// private MetroSetMessageBox() { base.Font = MetroSetFonts.Regular(9.5f); ShowInTaskbar = false; StartPosition = FormStartPosition.CenterParent; _buttonSize = new Size(95, 32); ApplyTheme(); EvaluateControls(); AddControls(); //HideControls(); } /// /// Here we set the buttons properties value. /// private void EvaluateControls() { EvaluateOkeyButton(); EvaluateYesButton(); EvaluateNoButton(); EvaluateCancelButton(); EvaluateRetryButton(); EvaluateAbortButton(); EvaluateIgnoreButton(); } /// /// Adding the controls just to be exist in form but we don't need them all at the moment. /// private void AddControls() { Controls.Add(_okButton); Controls.Add(_yesButton); Controls.Add(_noButton); Controls.Add(_cancelButton); Controls.Add(_retryButton); Controls.Add(_abortButton); Controls.Add(_ignoreButton); } /// /// Set the required properties values and click event of retry button. /// private void EvaluateRetryButton() { _retryButton = new MetroSetDefaultButton { Text = @"Retry", Size = _buttonSize, Visible = false }; _retryButton.Click += RetryButton_Click; } /// /// Set the required properties values and click event of cancel button. /// private void EvaluateCancelButton() { _cancelButton = new MetroSetDefaultButton { Text = @"Cancel", Size = _buttonSize, Visible = false }; _cancelButton.Click += CancelButton_Click; } /// /// Set the required properties values and click event of no button. /// private void EvaluateNoButton() { _noButton = new MetroSetDefaultButton { Text = @"No", Size = _buttonSize, Visible = false }; _noButton.Click += NoButton_Click; } /// /// Set the required properties values and click event of yes button. /// private void EvaluateYesButton() { _yesButton = new MetroSetDefaultButton { Text = @"Yes", Size = _buttonSize, Visible = false }; _yesButton.Click += YesButton_Click; } /// /// Set the required properties values and click event of ok button. /// private void EvaluateOkeyButton() { _okButton = new MetroSetDefaultButton { Text = @"Ok", Size = _buttonSize, Visible = false }; _okButton.Click += OkButton_Click; } /// /// Set the required properties values and click event of abort button. /// private void EvaluateAbortButton() { _abortButton = new MetroSetDefaultButton { Text = @"Abort", Size = _buttonSize, Visible = false }; _abortButton.Click += AbortButton_Click; } /// /// Set the required properties values and click event of ignore button. /// private void EvaluateIgnoreButton() { _ignoreButton = new MetroSetDefaultButton { Text = @"Ignore", Size = _buttonSize, Visible = false }; _ignoreButton.Click += IgnoreButton_Click; } #endregion #region Events /// /// Handling the retry button click. /// /// sender /// EventArgs private void RetryButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Retry; } /// /// Handling the cancel button click. /// /// sender /// EventArgs private void CancelButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; } /// /// Handling the no button click. /// /// sender /// EventArgs private void NoButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.No; } /// /// Handling the yes button click. /// /// sender /// EventArgs private void YesButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Yes; } /// /// Handling the okey button click. /// /// sender /// EventArgs private void OkButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; } /// /// Handling the abort button click. /// /// sender /// EventArgs private void AbortButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Abort; } /// /// Handling the ignore button click. /// /// sender /// EventArgs private void IgnoreButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Ignore; } /// /// When the user just provides the content of message to appear. /// /// The Form that messagebox will be showed from. /// The Content of the message. /// The MessageBox with just the content and an ok button. public static DialogResult Show(MetroSetForm form, string content) { return Show(form, content, form.Text, MessageBoxButtons.OK, MessageBoxIcon.None); } /// /// When the user provides the content of message and the message title to appear. /// /// The Form that messagebox will be showed from. /// The Content of the message. /// The MesageBox title. /// The MessageBox with the content and title and an ok button. public static DialogResult Show(MetroSetForm form, string content, string caption) { return Show(form, content, caption, MessageBoxButtons.OK, MessageBoxIcon.None); } /// /// When the user provides the content of message and the message title and also which type of buttons to appear. /// /// The Form that messagebox will be showed from. /// The Content of the message. /// The MesageBox title. /// The Type of buttons to appear. /// The MessageBox with the content and title and provided button(s) type. public static DialogResult Show(MetroSetForm form, string content, string caption, MessageBoxButtons buttons) { return Show(form, content, caption, buttons, MessageBoxIcon.None); } /// /// When the user provides the content of message and the message title and also which type message and buttons to appear. /// /// The Form that messagebox will be showed from. /// The Content of the message. /// The MesageBox title. /// The Type of buttons to appear. /// The MessageBox type. /// The MessageBox with the content and title and provided button(s) and type. public static DialogResult Show(MetroSetForm form, string content, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) { const string message = @"MetroSetMessageBox requires a form, use 'this' as the first parameter in the place you use MetroSetMessageBox."; var msgBox = new MetroSetMessageBox { OwnerForm = form ?? throw new ArgumentNullException(message), Content = content, Caption = caption, Buttons = buttons, Size = new Size(form.Width - 2, (form.Height / 3) - 1), Location = new Point(form.Location.X, (form.Height / 2) - 1) }; if (icon == MessageBoxIcon.Error || icon == MessageBoxIcon.Stop) { BackgroundColor = Color.FromArgb(210, 50, 45); BorderColor = Color.FromArgb(210, 50, 45); ForegroundColor = Color.White; } else if (icon == MessageBoxIcon.Information) { BackgroundColor = Color.FromArgb(60, 180, 218); BorderColor = Color.FromArgb(60, 180, 218); ForegroundColor = Color.White; } else if (icon == MessageBoxIcon.Question) { BackgroundColor = Color.FromArgb(70, 165, 70); BorderColor = Color.FromArgb(70, 165, 70); ForegroundColor = Color.White; } else if (icon == MessageBoxIcon.Exclamation || icon == MessageBoxIcon.Warning) { BackgroundColor = Color.FromArgb(237, 156, 40); BorderColor = Color.FromArgb(237, 156, 40); ForegroundColor = Color.White; } else if (icon == MessageBoxIcon.None || icon == MessageBoxIcon.Asterisk || icon == MessageBoxIcon.Hand) { BackgroundColor = Color.White; BorderColor = Color.FromArgb(65, 177, 225); ForegroundColor = Color.Black; } return msgBox.ShowDialog(); } /// /// Here we handle the user provided buttons appearance. /// /// The MessageBox with provided buttons. protected new DialogResult ShowDialog() { var buttonHeight = Height - 45; var firstButton = (Width - _buttonSize.Width) - 10; var secondButoon = (Width - (_buttonSize.Width * 2)) - 20; switch (Buttons) { case MessageBoxButtons.OK: _okButton.Location = new Point(firstButton, buttonHeight); _okButton.Visible = true; break; case MessageBoxButtons.OKCancel: _okButton.Location = new Point(secondButoon, buttonHeight); _okButton.Visible = true; _cancelButton.Location = new Point(firstButton, buttonHeight); _cancelButton.Visible = true; break; case MessageBoxButtons.YesNo: _yesButton.Location = new Point(secondButoon, buttonHeight); _yesButton.Visible = true; _noButton.Location = new Point(firstButton, buttonHeight); _noButton.Visible = true; break; case MessageBoxButtons.YesNoCancel: _yesButton.Location = new Point((Width - (_buttonSize.Width * 3)) - 30, buttonHeight); _yesButton.Visible = true; _noButton.Location = new Point(secondButoon, buttonHeight); _noButton.Visible = true; _cancelButton.Location = new Point(firstButton, buttonHeight); _cancelButton.Visible = true; break; case MessageBoxButtons.RetryCancel: _retryButton.Location = new Point(secondButoon, buttonHeight); _retryButton.Visible = true; _cancelButton.Location = new Point(firstButton, buttonHeight); _cancelButton.Visible = true; break; case MessageBoxButtons.AbortRetryIgnore: _abortButton.Location = new Point((Width - (_buttonSize.Width * 3)) - 30, buttonHeight); _abortButton.Visible = true; _retryButton.Location = new Point(secondButoon, buttonHeight); _retryButton.Visible = true; _ignoreButton.Location = new Point(firstButton, buttonHeight); _ignoreButton.Visible = true; break; default: _okButton.Location = new Point(firstButton, buttonHeight); _okButton.Visible = true; break; } return base.ShowDialog(); } #endregion #region Draw Dialog protected override void OnPaint(PaintEventArgs e) { var G = e.Graphics; G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; var rect = new Rectangle(0, ((OwnerForm.Height - (OwnerForm.Height / 2)) / 250), OwnerForm.Width - 3, (OwnerForm.Height / 3) - 3); using (var bg = new SolidBrush(BackgroundColor)) { using (var CTNT = new SolidBrush(ForegroundColor)) { using (var p = new Pen(BorderColor)) { G.FillRectangle(bg, rect); G.DrawString(Caption, Font, CTNT, new PointF(rect.X + 10, rect.Y + 10)); G.DrawString(Content, Font, CTNT, new PointF(rect.X + 10, rect.Y + 50)); G.DrawRectangle(p, rect); } } } } #endregion } } ================================================ FILE: MetroSet UI/Interfaces/IMetroForm.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using MetroSet_UI.Components; using MetroSet_UI.Enums; namespace MetroSet_UI.Interfaces { public interface IMetroForm { /// /// Gets or sets the style associated with the Form. /// Style Style { get; set; } /// /// Gets or sets the StyleManager associated with the Form. /// StyleManager StyleManager { get; set; } /// /// Gets or sets the The Author name associated with the theme. /// string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// string ThemeName { get; set; } } } ================================================ FILE: MetroSet UI/Interfaces/IMetroSetControl.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using MetroSet_UI.Components; using MetroSet_UI.Enums; namespace MetroSet_UI.Interfaces { public interface IMetroSetControl { /// /// Gets or sets the style associated with the control. /// Style Style { get; set; } /// /// Gets or sets the StyleManager associated with the control. /// StyleManager StyleManager { get; set; } /// /// Gets or sets the The Author name associated with the theme. /// string ThemeAuthor { get; set; } /// /// Gets or sets the The Theme name associated with the theme. /// string ThemeName { get; set; } /// /// Gets or sets the whether this control reflect to parent form style. /// Set it to false if you want the style of this control be independent. /// bool IsDerivedStyle { get; set; } } } ================================================ FILE: MetroSet UI/Interfaces/MetroSetControl.cs ================================================ using MetroSet_UI.Components; using MetroSet_UI.Enums; namespace MetroSet_UI.Interfaces { public interface MetroSetControl { /// /// /// Style Style { get; set; } /// /// /// StyleManager StyleManager { get; set; } string ThemeAuthor { get; set; } string ThemeName { get; set; } } } ================================================ FILE: MetroSet UI/Interfaces/MetroSetForm.cs ================================================ using MetroSet_UI.Components; using MetroSet_UI.Enums; namespace MetroSet_UI.Interfaces { public interface iMetroSetForm { /// /// /// Style Style { get; set; } /// /// /// StyleManager StyleManager { get; set; } string ThemeAuthor { get; set; } string ThemeName { get; set; } } } ================================================ FILE: MetroSet UI/MetroSet UI.csproj ================================================  Library True Properties MetroSet_UI MetroSet UI False net45;netcoreapp3.1 true https://github.com/N-a-r-w-i-n/MetroSet-UI https://github.com/N-a-r-w-i-n/MetroSet-UI MetroSetUI true LICENSE True True Settings.settings SettingsSingleFileGenerator Settings.Designer.cs True ================================================ FILE: MetroSet UI/Native/User32.cs ================================================ /* * MetroSet UI - MetroSet UI Framework * * The MIT License (MIT) * Copyright (c) 2017 Narwin, https://github.com/N-a-r-w-i-n * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Drawing; using System.Runtime.InteropServices; namespace MetroSet_UI.Native { internal class User32 { #region Properties public AnimateWindowFlags AW_HIDE { get; internal set; } #endregion #region Structure [StructLayout(LayoutKind.Sequential)] public struct TCHITTESTINFO { private readonly Point _point; public readonly TabControlHitTest flags; private TCHITTESTINFO(TabControlHitTest hitTest) : this() { flags = hitTest; } public TCHITTESTINFO(Point point, TabControlHitTest hitTest) : this(hitTest) { _point = point; } public TCHITTESTINFO(int x, int y, TabControlHitTest hitTest) : this(hitTest) { Point pt = new Point(x, y); } } #endregion #region Flags public const int WM_SETCURSOR = 0x0020; public const int IDC_HAND = 32649; public enum AnimateWindowFlags : uint { AW_HOR_POSITIVE = 0x00000001, AW_HOR_NEGATIVE = 0x00000002, AW_VER_POSITIVE = 0x00000004, AW_VER_NEGATIVE = 0x00000008, AW_CENTER = 0x00000010, AW_HIDE = 0x00010000, AW_ACTIVATE = 0x00020000, AW_SLIDE = 0x00040000, AW_BLEND = 0x00080000 } [Flags] public enum TabControlHitTest { /// /// The position is not over a tab. /// TCHT_NOWHERE = 1, /// /// The position is over a tab's icon. /// TCHT_ONITEMICON = 2, /// /// The position is over a tab's text. /// TCHT_ONITEMLABEL = 4, /// /// The position is over a tab but not over its icon or its text. For owner-drawn tab controls, this value is specified if the position is anywhere over a tab. /// TCHT_ONITEM is a bitwise-OR operation on TCHT_ONITEMICON and TCHT_ONITEMLABEL. /// TCHT_ONITEM = TCHT_ONITEMICON | TCHT_ONITEMLABEL }; #endregion #region Methods [DllImport("user32")] public static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags); internal void AnimateWindow(IntPtr handle, int v, object p) { throw new NotImplementedException(); } [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, string lParam); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName); [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SetCursor(IntPtr hCursor); #endregion #region Symbolic Constants public const byte _AC_SRC_OVER = 0x00; public const byte _AC_SRC_ALPHA = 0x01; public const int _LWA_ALPHA = 0x00000002; public const int _PAT_INVERT = 0x5A0049; public const int _HT_CAPTION = 0x2; public const int _HT_TRANSPARENT = -1; public const int _TCM_HITTEST = 0x130D; public const int _WM_NCHITTEST = 0x0084; public const int _HTCLIENT = 0x01; public const int _HTCAPTION = 0x02; public const int _SRC_COPY = 0xCC0020; public const int _CS_DROPSHADOW = 0x20000; public const int _TCM_ADJUSTRECT = 0x1328; public const int _TCN_FIRST = -550; public const int _TCN_SELCHANGE = -551; public const int _TCN_SELCHANGING = -552; #endregion #region Windows Messages /// /// Specifies values from Msgs enumeration. /// internal enum Msgs { /// /// Specified WM_NULL enumeration value. /// WM_NULL = 0x0000, /// /// Specified WM_CREATE enumeration value. /// WM_CREATE = 0x0001, /// /// Specified WM_DESTROY enumeration value. /// WM_DESTROY = 0x0002, /// /// Specified WM_MOVE enumeration value. /// WM_MOVE = 0x0003, /// /// Specified WM_SIZE enumeration value. /// WM_SIZE = 0x0005, /// /// Specified WM_ACTIVATE enumeration value. /// WM_ACTIVATE = 0x0006, /// /// Specified WM_SETFOCUS enumeration value. /// WM_SETFOCUS = 0x0007, /// /// Specified WM_KILLFOCUS enumeration value. /// WM_KILLFOCUS = 0x0008, /// /// Specified WM_ENABLE enumeration value. /// WM_ENABLE = 0x000A, /// /// Specified WM_SETREDRAW enumeration value. /// WM_SETREDRAW = 0x000B, /// /// Specified WM_SETTEXT enumeration value. /// WM_SETTEXT = 0x000C, /// /// Specified WM_GETTEXT enumeration value. /// WM_GETTEXT = 0x000D, /// /// Specified WM_GETTEXTLENGTH enumeration value. /// WM_GETTEXTLENGTH = 0x000E, /// /// Specified WM_PAINT enumeration value. /// WM_PAINT = 0x000F, /// /// Specified WM_CLOSE enumeration value. /// WM_CLOSE = 0x0010, /// /// Specified WM_QUERYENDSESSION enumeration value. /// WM_QUERYENDSESSION = 0x0011, /// /// Specified WM_QUIT enumeration value. /// WM_QUIT = 0x0012, /// /// Specified WM_QUERYOPEN enumeration value. /// WM_QUERYOPEN = 0x0013, /// /// Specified WM_ERASEBKGND enumeration value. /// WM_ERASEBKGND = 0x0014, /// /// Specified WM_SYSCOLORCHANGE enumeration value. /// WM_SYSCOLORCHANGE = 0x0015, /// /// Specified WM_ENDSESSION enumeration value. /// WM_ENDSESSION = 0x0016, /// /// Specified WM_SHOWWINDOW enumeration value. /// WM_SHOWWINDOW = 0x0018, /// /// Specified WM_WININICHANGE enumeration value. /// WM_WININICHANGE = 0x001A, /// /// Specified WM_SETTINGCHANGE enumeration value. /// WM_SETTINGCHANGE = 0x001A, /// /// Specified WM_DEVMODECHANGE enumeration value. /// WM_DEVMODECHANGE = 0x001B, /// /// Specified WM_ACTIVATEAPP enumeration value. /// WM_ACTIVATEAPP = 0x001C, /// /// Specified WM_FONTCHANGE enumeration value. /// WM_FONTCHANGE = 0x001D, /// /// Specified WM_TIMECHANGE enumeration value. /// WM_TIMECHANGE = 0x001E, /// /// Specified WM_CANCELMODE enumeration value. /// WM_CANCELMODE = 0x001F, /// /// Specified WM_SETCURSOR enumeration value. /// WM_SETCURSOR = 0x0020, /// /// Specified WM_MOUSEACTIVATE enumeration value. /// WM_MOUSEACTIVATE = 0x0021, /// /// Specified WM_CHILDACTIVATE enumeration value. /// WM_CHILDACTIVATE = 0x0022, /// /// Specified WM_QUEUESYNC enumeration value. /// WM_QUEUESYNC = 0x0023, /// /// Specified WM_GETMINMAXINFO enumeration value. /// WM_GETMINMAXINFO = 0x0024, /// /// Specified WM_PAINTICON enumeration value. /// WM_PAINTICON = 0x0026, /// /// Specified WM_ICONERASEBKGND enumeration value. /// WM_ICONERASEBKGND = 0x0027, /// /// Specified WM_NEXTDLGCTL enumeration value. /// WM_NEXTDLGCTL = 0x0028, /// /// Specified WM_SPOOLERSTATUS enumeration value. /// WM_SPOOLERSTATUS = 0x002A, /// /// Specified WM_DRAWITEM enumeration value. /// WM_DRAWITEM = 0x002B, /// /// Specified WM_MEASUREITEM enumeration value. /// WM_MEASUREITEM = 0x002C, /// /// Specified WM_DELETEITEM enumeration value. /// WM_DELETEITEM = 0x002D, /// /// Specified WM_VKEYTOITEM enumeration value. /// WM_VKEYTOITEM = 0x002E, /// /// Specified WM_CHARTOITEM enumeration value. /// WM_CHARTOITEM = 0x002F, /// /// Specified WM_SETFONT enumeration value. /// WM_SETFONT = 0x0030, /// /// Specified WM_GETFONT enumeration value. /// WM_GETFONT = 0x0031, /// /// Specified WM_SETHOTKEY enumeration value. /// WM_SETHOTKEY = 0x0032, /// /// Specified WM_GETHOTKEY enumeration value. /// WM_GETHOTKEY = 0x0033, /// /// Specified WM_QUERYDRAGICON enumeration value. /// WM_QUERYDRAGICON = 0x0037, /// /// Specified WM_COMPAREITEM enumeration value. /// WM_COMPAREITEM = 0x0039, /// /// Specified WM_GETOBJECT enumeration value. /// WM_GETOBJECT = 0x003D, /// /// Specified WM_COMPACTING enumeration value. /// WM_COMPACTING = 0x0041, /// /// Specified WM_COMMNOTIFY enumeration value. /// WM_COMMNOTIFY = 0x0044, /// /// Specified WM_WINDOWPOSCHANGING enumeration value. /// WM_WINDOWPOSCHANGING = 0x0046, /// /// Specified WM_WINDOWPOSCHANGED enumeration value. /// WM_WINDOWPOSCHANGED = 0x0047, /// /// Specified WM_POWER enumeration value. /// WM_POWER = 0x0048, /// /// Specified WM_COPYDATA enumeration value. /// WM_COPYDATA = 0x004A, /// /// Specified WM_CANCELJOURNAL enumeration value. /// WM_CANCELJOURNAL = 0x004B, /// /// Specified WM_NOTIFY enumeration value. /// WM_NOTIFY = 0x004E, /// /// Specified WM_INPUTLANGCHANGEREQUEST enumeration value. /// WM_INPUTLANGCHANGEREQUEST = 0x0050, /// /// Specified WM_INPUTLANGCHANGE enumeration value. /// WM_INPUTLANGCHANGE = 0x0051, /// /// Specified WM_TCARD enumeration value. /// WM_TCARD = 0x0052, /// /// Specified WM_HELP enumeration value. /// WM_HELP = 0x0053, /// /// Specified WM_USERCHANGED enumeration value. /// WM_USERCHANGED = 0x0054, /// /// Specified WM_NOTIFYFORMAT enumeration value. /// WM_NOTIFYFORMAT = 0x0055, /// /// Specified WM_CONTEXTMENU enumeration value. /// WM_CONTEXTMENU = 0x007B, /// /// Specified WM_STYLECHANGING enumeration value. /// WM_STYLECHANGING = 0x007C, /// /// Specified WM_STYLECHANGED enumeration value. /// WM_STYLECHANGED = 0x007D, /// /// Specified WM_DISPLAYCHANGE enumeration value. /// WM_DISPLAYCHANGE = 0x007E, /// /// Specified WM_GETICON enumeration value. /// WM_GETICON = 0x007F, /// /// Specified WM_SETICON enumeration value. /// WM_SETICON = 0x0080, /// /// Specified WM_NCCREATE enumeration value. /// WM_NCCREATE = 0x0081, /// /// Specified VK_RMENU enumeration value. /// WM_NCDESTROY = 0x0082, /// /// Specified WM_NCCALCSIZE enumeration value. /// WM_NCCALCSIZE = 0x0083, /// /// Specified WM_NCHITTEST enumeration value. /// WM_NCHITTEST = 0x0084, /// /// Specified WM_NCPAINT enumeration value. /// WM_NCPAINT = 0x0085, /// /// Specified WM_NCACTIVATE enumeration value. /// WM_NCACTIVATE = 0x0086, /// /// Specified WM_GETDLGCODE enumeration value. /// WM_GETDLGCODE = 0x0087, /// /// Specified WM_SYNCPAINT enumeration value. /// WM_SYNCPAINT = 0x0088, /// /// Specified WM_NCMOUSEMOVE enumeration value. /// WM_NCMOUSEMOVE = 0x00A0, /// /// Specified WM_NCLBUTTONDOWN enumeration value. /// WM_NCLBUTTONDOWN = 0x00A1, /// /// Specified WM_NCLBUTTONUP enumeration value. /// WM_NCLBUTTONUP = 0x00A2, /// /// Specified WM_NCLBUTTONDBLCLK enumeration value. /// WM_NCLBUTTONDBLCLK = 0x00A3, /// /// Specified WM_NCRBUTTONDOWN enumeration value. /// WM_NCRBUTTONDOWN = 0x00A4, /// /// Specified WM_NCRBUTTONUP enumeration value. /// WM_NCRBUTTONUP = 0x00A5, /// /// Specified WM_NCRBUTTONDBLCLK enumeration value. /// WM_NCRBUTTONDBLCLK = 0x00A6, /// /// Specified WM_NCMBUTTONDOWN enumeration value. /// WM_NCMBUTTONDOWN = 0x00A7, /// /// Specified WM_NCMBUTTONUP enumeration value. /// WM_NCMBUTTONUP = 0x00A8, /// /// Specified WM_NCMBUTTONDBLCLK enumeration value. /// WM_NCMBUTTONDBLCLK = 0x00A9, /// /// Specified WM_NCXBUTTONDOWN enumeration value. /// WM_NCXBUTTONDOWN = 0x00AB, /// /// Specified WM_NCXBUTTONUP enumeration value. /// WM_NCXBUTTONUP = 0x00AC, /// /// Specified WM_KEYDOWN enumeration value. /// WM_KEYDOWN = 0x0100, /// /// Specified WM_KEYUP enumeration value. /// WM_KEYUP = 0x0101, /// /// Specified WM_CHAR enumeration value. /// WM_CHAR = 0x0102, /// /// Specified WM_DEADCHAR enumeration value. /// WM_DEADCHAR = 0x0103, /// /// Specified WM_SYSKEYDOWN enumeration value. /// WM_SYSKEYDOWN = 0x0104, /// /// Specified WM_SYSKEYUP enumeration value. /// WM_SYSKEYUP = 0x0105, /// /// Specified WM_SYSCHAR enumeration value. /// WM_SYSCHAR = 0x0106, /// /// Specified WM_SYSDEADCHAR enumeration value. /// WM_SYSDEADCHAR = 0x0107, /// /// Specified WM_KEYLAST enumeration value. /// WM_KEYLAST = 0x0108, /// /// Specified WM_IME_STARTCOMPOSITION enumeration value. /// WM_IME_STARTCOMPOSITION = 0x010D, /// /// Specified WM_IME_ENDCOMPOSITION enumeration value. /// WM_IME_ENDCOMPOSITION = 0x010E, /// /// Specified WM_IME_COMPOSITION enumeration value. /// WM_IME_COMPOSITION = 0x010F, /// /// Specified WM_IME_KEYLAST enumeration value. /// WM_IME_KEYLAST = 0x010F, /// /// Specified WM_INITDIALOG enumeration value. /// WM_INITDIALOG = 0x0110, /// /// Specified WM_COMMAND enumeration value. /// WM_COMMAND = 0x0111, /// /// Specified WM_SYSCOMMAND enumeration value. /// WM_SYSCOMMAND = 0x0112, /// /// Specified WM_TIMER enumeration value. /// WM_TIMER = 0x0113, /// /// Specified WM_HSCROLL enumeration value. /// WM_HSCROLL = 0x0114, /// /// Specified WM_VSCROLL enumeration value. /// WM_VSCROLL = 0x0115, /// /// Specified WM_INITMENU enumeration value. /// WM_INITMENU = 0x0116, /// /// Specified WM_INITMENUPOPUP enumeration value. /// WM_INITMENUPOPUP = 0x0117, /// /// Specified WM_MENUSELECT enumeration value. /// WM_MENUSELECT = 0x011F, /// /// Specified WM_MENUCHAR enumeration value. /// WM_MENUCHAR = 0x0120, /// /// Specified WM_ENTERIDLE enumeration value. /// WM_ENTERIDLE = 0x0121, /// /// Specified WM_MENURBUTTONUP enumeration value. /// WM_MENURBUTTONUP = 0x0122, /// /// Specified WM_MENUDRAG enumeration value. /// WM_MENUDRAG = 0x0123, /// /// Specified WM_MENUGETOBJECT enumeration value. /// WM_MENUGETOBJECT = 0x0124, /// /// Specified WM_UNINITMENUPOPUP enumeration value. /// WM_UNINITMENUPOPUP = 0x0125, /// /// Specified WM_MENUCOMMAND enumeration value. /// WM_MENUCOMMAND = 0x0126, /// /// Specified WM_CTLCOLORMSGBOX enumeration value. /// WM_CTLCOLORMSGBOX = 0x0132, /// /// Specified WM_CTLCOLOREDIT enumeration value. /// WM_CTLCOLOREDIT = 0x0133, /// /// Specified WM_CTLCOLORLISTBOX enumeration value. /// WM_CTLCOLORLISTBOX = 0x0134, /// /// Specified WM_CTLCOLORBTN enumeration value. /// WM_CTLCOLORBTN = 0x0135, /// /// Specified WM_CTLCOLORDLG enumeration value. /// WM_CTLCOLORDLG = 0x0136, /// /// Specified WM_CTLCOLORSCROLLBAR enumeration value. /// WM_CTLCOLORSCROLLBAR = 0x0137, /// /// Specified WM_CTLCOLORSTATIC enumeration value. /// WM_CTLCOLORSTATIC = 0x0138, /// /// Specified WM_MOUSEMOVE enumeration value. /// WM_MOUSEMOVE = 0x0200, /// /// Specified WM_LBUTTONDOWN enumeration value. /// WM_LBUTTONDOWN = 0x0201, /// /// Specified WM_LBUTTONUP enumeration value. /// WM_LBUTTONUP = 0x0202, /// /// Specified WM_LBUTTONDBLCLK enumeration value. /// WM_LBUTTONDBLCLK = 0x0203, /// /// Specified WM_RBUTTONDOWN enumeration value. /// WM_RBUTTONDOWN = 0x0204, /// /// Specified WM_RBUTTONUP enumeration value. /// WM_RBUTTONUP = 0x0205, /// /// Specified WM_RBUTTONDBLCLK enumeration value. /// WM_RBUTTONDBLCLK = 0x0206, /// /// Specified WM_MBUTTONDOWN enumeration value. /// WM_MBUTTONDOWN = 0x0207, /// /// Specified WM_MBUTTONUP enumeration value. /// WM_MBUTTONUP = 0x0208, /// /// Specified WM_MBUTTONDBLCLK enumeration value. /// WM_MBUTTONDBLCLK = 0x0209, /// /// Specified WM_MOUSEWHEEL enumeration value. /// WM_MOUSEWHEEL = 0x020A, /// /// Specified WM_XBUTTONDOWN enumeration value. /// WM_XBUTTONDOWN = 0x020B, /// /// Specified WM_XBUTTONUP enumeration value. /// WM_XBUTTONUP = 0x020C, /// /// Specified WM_XBUTTONDBLCLK enumeration value. /// WM_XBUTTONDBLCLK = 0x020D, /// /// Specified WM_PARENTNOTIFY enumeration value. /// WM_PARENTNOTIFY = 0x0210, /// /// Specified WM_ENTERMENULOOP enumeration value. /// WM_ENTERMENULOOP = 0x0211, /// /// Specified WM_EXITMENULOOP enumeration value. /// WM_EXITMENULOOP = 0x0212, /// /// Specified WM_NEXTMENU enumeration value. /// WM_NEXTMENU = 0x0213, /// /// Specified WM_SIZING enumeration value. /// WM_SIZING = 0x0214, /// /// Specified WM_CAPTURECHANGED enumeration value. /// WM_CAPTURECHANGED = 0x0215, /// /// Specified WM_MOVING enumeration value. /// WM_MOVING = 0x0216, /// /// Specified WM_DEVICECHANGE enumeration value. /// WM_DEVICECHANGE = 0x0219, /// /// Specified WM_MDICREATE enumeration value. /// WM_MDICREATE = 0x0220, /// /// Specified WM_MDIDESTROY enumeration value. /// WM_MDIDESTROY = 0x0221, /// /// Specified WM_MDIACTIVATE enumeration value. /// WM_MDIACTIVATE = 0x0222, /// /// Specified WM_MDIRESTORE enumeration value. /// WM_MDIRESTORE = 0x0223, /// /// Specified WM_MDINEXT enumeration value. /// WM_MDINEXT = 0x0224, /// /// Specified WM_MDIMAXIMIZE enumeration value. /// WM_MDIMAXIMIZE = 0x0225, /// /// Specified WM_MDITILE enumeration value. /// WM_MDITILE = 0x0226, /// /// Specified WM_MDICASCADE enumeration value. /// WM_MDICASCADE = 0x0227, /// /// Specified WM_MDIICONARRANGE enumeration value. /// WM_MDIICONARRANGE = 0x0228, /// /// Specified WM_MDIGETACTIVE enumeration value. /// WM_MDIGETACTIVE = 0x0229, /// /// Specified WM_MDISETMENU enumeration value. /// WM_MDISETMENU = 0x0230, /// /// Specified WM_ENTERSIZEMOVE enumeration value. /// WM_ENTERSIZEMOVE = 0x0231, /// /// Specified WM_EXITSIZEMOVE enumeration value. /// WM_EXITSIZEMOVE = 0x0232, /// /// Specified WM_DROPFILES enumeration value. /// WM_DROPFILES = 0x0233, /// /// Specified WM_MDIREFRESHMENU enumeration value. /// WM_MDIREFRESHMENU = 0x0234, /// /// Specified WM_IME_SETCONTEXT enumeration value. /// WM_IME_SETCONTEXT = 0x0281, /// /// Specified WM_IME_NOTIFY enumeration value. /// WM_IME_NOTIFY = 0x0282, /// /// Specified WM_IME_CONTROL enumeration value. /// WM_IME_CONTROL = 0x0283, /// /// Specified WM_IME_COMPOSITIONFULL enumeration value. /// WM_IME_COMPOSITIONFULL = 0x0284, /// /// Specified WM_IME_SELECT enumeration value. /// WM_IME_SELECT = 0x0285, /// /// Specified WM_IME_CHAR enumeration value. /// WM_IME_CHAR = 0x0286, /// /// Specified WM_IME_REQUEST enumeration value. /// WM_IME_REQUEST = 0x0288, /// /// Specified WM_IME_KEYDOWN enumeration value. /// WM_IME_KEYDOWN = 0x0290, /// /// Specified WM_IME_KEYUP enumeration value. /// WM_IME_KEYUP = 0x0291, /// /// Specified WM_MOUSEHOVER enumeration value. /// WM_MOUSEHOVER = 0x02A1, WM_MOUSELEAVE = 0x02A3, WM_CUT = 0x0300, WM_COPY = 0x0301, WM_PASTE = 0x0302, WM_CLEAR = 0x0303, /// /// Specified WM_UNDO enumeration value. /// WM_UNDO = 0x0304, /// /// Specified WM_RENDERFORMAT enumeration value. /// WM_RENDERFORMAT = 0x0305, /// /// Specified WM_RENDERALLFORMATS enumeration value. /// WM_RENDERALLFORMATS = 0x0306, /// /// Specified WM_DESTROYCLIPBOARD enumeration value. /// WM_DESTROYCLIPBOARD = 0x0307, /// /// Specified WM_DRAWCLIPBOARD enumeration value. /// WM_DRAWCLIPBOARD = 0x0308, /// /// Specified WM_PAINTCLIPBOARD enumeration value. /// WM_PAINTCLIPBOARD = 0x0309, /// /// Specified WM_VSCROLLCLIPBOARD enumeration value. /// WM_VSCROLLCLIPBOARD = 0x030A, /// /// Specified WM_SIZECLIPBOARD enumeration value. /// WM_SIZECLIPBOARD = 0x030B, /// /// Specified WM_ASKCBFORMATNAME enumeration value. /// WM_ASKCBFORMATNAME = 0x030C, /// /// Specified WM_CHANGECBCHAIN enumeration value. /// WM_CHANGECBCHAIN = 0x030D, /// /// Specified WM_HSCROLLCLIPBOARD enumeration value. /// WM_HSCROLLCLIPBOARD = 0x030E, /// /// Specified WM_QUERYNEWPALETTE enumeration value. /// WM_QUERYNEWPALETTE = 0x030F, /// /// Specified WM_PALETTEISCHANGING enumeration value. /// WM_PALETTEISCHANGING = 0x0310, /// /// Specified WM_PALETTECHANGED enumeration value. /// WM_PALETTECHANGED = 0x0311, /// /// Specified WM_HOTKEY enumeration value. /// WM_HOTKEY = 0x0312, /// /// Specified WM_PRINT enumeration value. /// WM_PRINT = 0x0317, /// /// Specified WM_PRINTCLIENT enumeration value. /// WM_PRINTCLIENT = 0x0318, /// /// Specified WM_HANDHELDFIRST enumeration value. /// WM_HANDHELDFIRST = 0x0358, /// /// Specified WM_HANDHELDLAST enumeration value. /// WM_HANDHELDLAST = 0x035F, /// /// Specified WM_AFXFIRST enumeration value. /// WM_AFXFIRST = 0x0360, /// /// Specified WM_AFXLAST enumeration value. /// WM_AFXLAST = 0x037F, /// /// Specified WM_PENWINFIRST enumeration value. /// WM_PENWINFIRST = 0x0380, /// /// Specified WM_PENWINLAST enumeration value. /// WM_PENWINLAST = 0x038F, /// /// Specified WM_APP enumeration value. /// WM_APP = 0x8000, /// /// Specified WM_USER enumeration value. /// WM_USER = 0x0400, /// /// Specified WM_REFLECT enumeration value. /// WM_REFLECT = WM_USER + 0x1C00, /// /// Specified WM_THEMECHANGED enumeration value. /// WM_THEMECHANGED = 0x031A, }; #endregion } } ================================================ FILE: MetroSet UI/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("MetroSet UI")] [assembly: AssemblyDescription("The Windows Forms Metro Style Skin for .NET applications.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Narwin")] [assembly: AssemblyProduct("MetroSet UI")] [assembly: AssemblyCopyright("Copyright © Narwin 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("246951dc-5e33-4a86-9498-a03f9d784efa")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] ================================================ FILE: MetroSet UI/Properties/PublishProfiles/FolderProfile.pubxml ================================================  FileSystem Release Any CPU net45 bin\Release\net45\publish\ ================================================ FILE: MetroSet UI/Properties/Resources.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace MetroSet_UI.Properties { using System; /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MetroSet_UI.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// /// Looks up a localized string similar to <MetroSetTheme> /// <Theme> /// <Name>DarkUI</Name> /// <Author>Narwin</Author> /// </Theme> /// <Form> /// <Enabled>true</Enabled> /// <ForeColor>#293955</ForeColor> /// <BackColor>#1e1e1e</BackColor> /// <BorderColor>#b72828</BorderColor> /// <SmallLineColor1>#F11199</SmallLineColor1> /// <SmallLineColor2>#EA5216</SmallLineColor2> /// <TextColor>#ffffff</TextColor> /// <DrawLeftRect>true</DrawLeftRect> /// <DisplayHeader>true</DisplayHeader> /// <TextAlign>left</TextAlign> /// <SmallRectThickne [rest of string was truncated]";. /// internal static string MetroSet_Theme { get { return ResourceManager.GetString("MetroSet_Theme", resourceCulture); } } /// /// Looks up a localized resource of type System.Byte[]. /// internal static byte[] SegoeWP { get { object obj = ResourceManager.GetObject("SegoeWP", resourceCulture); return ((byte[])(obj)); } } /// /// Looks up a localized resource of type System.Byte[]. /// internal static byte[] SegoeWP_Bold { get { object obj = ResourceManager.GetObject("SegoeWP_Bold", resourceCulture); return ((byte[])(obj)); } } /// /// Looks up a localized resource of type System.Byte[]. /// internal static byte[] SegoeWP_Light { get { object obj = ResourceManager.GetObject("SegoeWP_Light", resourceCulture); return ((byte[])(obj)); } } /// /// Looks up a localized resource of type System.Byte[]. /// internal static byte[] SegoeWP_Semibold { get { object obj = ResourceManager.GetObject("SegoeWP_Semibold", resourceCulture); return ((byte[])(obj)); } } /// /// Looks up a localized resource of type System.Byte[]. /// internal static byte[] SegoeWP_Semilight { get { object obj = ResourceManager.GetObject("SegoeWP_Semilight", resourceCulture); return ((byte[])(obj)); } } } } ================================================ FILE: MetroSet UI/Properties/Resources.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\MetroSet Theme.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 ..\Resources\SegoeWP.ttf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\SegoeWP-Bold.ttf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\SegoeWP-Light.ttf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\SegoeWP-Semibold.ttf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\SegoeWP-Semilight.ttf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: MetroSet UI/Properties/Settings.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace MetroSet_UI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string ThemeFile { get { return ((string)(this["ThemeFile"])); } set { this["ThemeFile"] = value; } } } } ================================================ FILE: MetroSet UI/Properties/Settings.settings ================================================  ================================================ FILE: MetroSet UI/Resources/MetroSet Theme.xml ================================================  Custom Theme Narwin
#293955 #FFFFFF #ffc40d #ffc40d #ffc40d #293955 #ffc40d
#ffc40d #000000 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #EEEEEE #505050 #6D6D6D #ffc40d #ffc40d #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #EEEEEE #505050 #6D6D6D #ffc40d #FFBA03 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #FFE235 #FFE235 #6D6D6D #ffc40d #000000 #FFFFFF #293A56 #2B2B2B #FFFFFF #D6DBE9 #2B2B2B #FFFFFF #ffc40d #FFFFFF #cb2828 #FFFFFF #a31414 #FFFFFF #FFE235 #FFE235 #6D6D6D #CCCCCC #FFFFFF #6E6E6E #6E6E6E #ffc40d #FFFFFF #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #ffc40d #6E6E6E n #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #ffc40d #6E6E6E #EEEEEE #505050 #6D6D6D #CCCCCC #FFFFFF #6E6E6E #ffc40d #EEEEEE #505050 #6D6D6D #ffc40d #ffc40d #00FFFFFF #ffc40d #999999 Shape #5C5C5C #FFFFFF #9B9B9B #555555 #9B9B9B #ffc40d #CDCDCD #FFE235 #ffc40d #ffc40d #00FFFFFF #ffc40d #999999 Horizontal 1 #ffc40d #ffc40d #00FFFFFF #41b1e1 #55c5f5 #2d9dcd HoverUnderline #FFFFFF #FFFFFF #ffc40d #EEEEEE #EEEEEE #ffc40d #EEEEEE #EEEEEE #FFE235 #EEEEEE #8F8F8F #ffc40d #EEEEEE #8F8F8F #FFE235 #FFFFFF #AAAAAA #808080 #808080 #FFFFFF #ffc40d #C0C0C0 #FFFFFF #ffc40d #808080 #FFFFFF #FFFFFF #ffc40d #505050 #6D6D6D #FFFFFF #808080 #404040 #FFFFFF #ffc40d #000000 #FFE235 #505050 #6D6D6D #FFFFFF #6E6E6E #ffc40d #FFFFFF #808080 #EEEEEE #808080 #808080 #EEEEEE #808080 #808080
================================================ FILE: MetroSet UI Example/Form1.Designer.cs ================================================ using MetroSet_UI.Components; namespace MetroSet_UI_Example { partial class Form1 { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this._metroSetTabControl1 = new MetroSet_UI.Controls.MetroSetTabControl(); this._metroSetSetTabPage2 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetButton2 = new MetroSet_UI.Controls.MetroSetButton(); this.styleManager1 = new MetroSet_UI.Components.StyleManager(); this._metroSetButton1 = new MetroSet_UI.Controls.MetroSetButton(); this._metroSetEllipse3 = new MetroSet_UI.Controls.MetroSetEllipse(); this._metroSetEllipse2 = new MetroSet_UI.Controls.MetroSetEllipse(); this._metroSetEllipse1 = new MetroSet_UI.Controls.MetroSetEllipse(); this._metroSetBadge2 = new MetroSet_UI.Controls.MetroSetBadge(); this._metroSetBadge1 = new MetroSet_UI.Controls.MetroSetBadge(); this._metroSetLabel2 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel3 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel19 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel1 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetDefaultButton2 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetDefaultButton1 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetSetTabPage1 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetTile8 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile4 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile7 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile6 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile2 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile5 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile3 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetTile1 = new MetroSet_UI.Controls.MetroSetTile(); this._metroSetLabel4 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetSetTabPage3 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetListBox2 = new MetroSet_UI.Controls.MetroSetListBox(); this._metroSetComboBox2 = new MetroSet_UI.Controls.MetroSetComboBox(); this._metroSetComboBox1 = new MetroSet_UI.Controls.MetroSetComboBox(); this._metroSetNumeric3 = new MetroSet_UI.Controls.MetroSetNumeric(); this._metroSetNumeric2 = new MetroSet_UI.Controls.MetroSetNumeric(); this._metroSetRichTextBox1 = new MetroSet_UI.Controls.MetroSetRichTextBox(); this._metroSetTextBox3 = new MetroSet_UI.Controls.MetroSetTextBox(); this._metroSetTextBox2 = new MetroSet_UI.Controls.MetroSetTextBox(); this._metroSetTextBox4 = new MetroSet_UI.Controls.MetroSetTextBox(); this._metroSetTextBox1 = new MetroSet_UI.Controls.MetroSetTextBox(); this._metroSetContextMenuStrip1 = new MetroSet_UI.Controls.MetroSetContextMenuStrip(); this.textBoxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._metroSetLabel8 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel9 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel6 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel7 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel5 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetSetTabPage4 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetSwitch4 = new MetroSet_UI.Controls.MetroSetSwitch(); this._metroSetSwitch3 = new MetroSet_UI.Controls.MetroSetSwitch(); this._metroSetSwitch2 = new MetroSet_UI.Controls.MetroSetSwitch(); this._metroSetSwitch1 = new MetroSet_UI.Controls.MetroSetSwitch(); this._metroSetLabel12 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetRadioButton4 = new MetroSet_UI.Controls.MetroSetRadioButton(); this._metroSetRadioButton3 = new MetroSet_UI.Controls.MetroSetRadioButton(); this._metroSetRadioButton2 = new MetroSet_UI.Controls.MetroSetRadioButton(); this._metroSetRadioButton1 = new MetroSet_UI.Controls.MetroSetRadioButton(); this._metroSetCheckBox5 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetCheckBox4 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetCheckBox3 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetCheckBox2 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetCheckBox6 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetCheckBox1 = new MetroSet_UI.Controls.MetroSetCheckBox(); this._metroSetLabel11 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel10 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetSetTabPage5 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetTrackBar2 = new MetroSet_UI.Controls.MetroSetTrackBar(); this._metroSetTrackBar1 = new MetroSet_UI.Controls.MetroSetTrackBar(); this._metroSetProgressBar4 = new MetroSet_UI.Controls.MetroSetProgressBar(); this._metroSetProgressBar3 = new MetroSet_UI.Controls.MetroSetProgressBar(); this._metroSetLabel14 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel15 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel13 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetProgressBar2 = new MetroSet_UI.Controls.MetroSetProgressBar(); this._metroSetProgressBar1 = new MetroSet_UI.Controls.MetroSetProgressBar(); this._metroSetSetTabPage6 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetLink2 = new MetroSet_UI.Controls.MetroSetLink(); this._metroSetLink1 = new MetroSet_UI.Controls.MetroSetLink(); this._metroSetLabel17 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetLabel16 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetSetTabPage7 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetButton7 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetButton6 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetButton5 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetButton4 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetButton3 = new MetroSet_UI.Controls.MetroSetDefaultButton(); this._metroSetLabel18 = new MetroSet_UI.Controls.MetroSetLabel(); this._metroSetSetTabPage8 = new MetroSet_UI.Child.MetroSetSetTabPage(); this._metroSetControlBox1 = new MetroSet_UI.Controls.MetroSetControlBox(); this._metroSetSetToolTip1 = new MetroSet_UI.Components.MetroSetSetToolTip(); this._metroSetTabControl1.SuspendLayout(); this._metroSetSetTabPage2.SuspendLayout(); this._metroSetSetTabPage1.SuspendLayout(); this._metroSetSetTabPage3.SuspendLayout(); this._metroSetContextMenuStrip1.SuspendLayout(); this._metroSetSetTabPage4.SuspendLayout(); this._metroSetSetTabPage5.SuspendLayout(); this._metroSetSetTabPage6.SuspendLayout(); this._metroSetSetTabPage7.SuspendLayout(); this.SuspendLayout(); // // _metroSetTabControl1 // this._metroSetTabControl1.AnimateEasingType = MetroSet_UI.Enums.EasingType.CubeOut; this._metroSetTabControl1.AnimateTime = 200; this._metroSetTabControl1.BackgroundColor = System.Drawing.Color.White; this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage2); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage1); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage3); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage4); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage5); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage6); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage7); this._metroSetTabControl1.Controls.Add(this._metroSetSetTabPage8); this._metroSetTabControl1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this._metroSetTabControl1.IsDerivedStyle = true; this._metroSetTabControl1.ItemSize = new System.Drawing.Size(100, 38); this._metroSetTabControl1.Location = new System.Drawing.Point(12, 70); this._metroSetTabControl1.Name = "_metroSetTabControl1"; this._metroSetTabControl1.SelectedIndex = 7; this._metroSetTabControl1.SelectedTextColor = System.Drawing.Color.White; this._metroSetTabControl1.Size = new System.Drawing.Size(1114, 616); this._metroSetTabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this._metroSetTabControl1.Speed = 100; this._metroSetTabControl1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTabControl1.StyleManager = this.styleManager1; this._metroSetTabControl1.TabIndex = 0; this._metroSetTabControl1.ThemeAuthor = "Narwin"; this._metroSetTabControl1.ThemeName = "MetroLite"; this._metroSetTabControl1.UnselectedTextColor = System.Drawing.Color.Gray; this._metroSetTabControl1.UseAnimation = false; // // _metroSetSetTabPage2 // this._metroSetSetTabPage2.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage2.Controls.Add(this._metroSetButton2); this._metroSetSetTabPage2.Controls.Add(this._metroSetButton1); this._metroSetSetTabPage2.Controls.Add(this._metroSetEllipse3); this._metroSetSetTabPage2.Controls.Add(this._metroSetEllipse2); this._metroSetSetTabPage2.Controls.Add(this._metroSetEllipse1); this._metroSetSetTabPage2.Controls.Add(this._metroSetBadge2); this._metroSetSetTabPage2.Controls.Add(this._metroSetBadge1); this._metroSetSetTabPage2.Controls.Add(this._metroSetLabel2); this._metroSetSetTabPage2.Controls.Add(this._metroSetLabel3); this._metroSetSetTabPage2.Controls.Add(this._metroSetLabel19); this._metroSetSetTabPage2.Controls.Add(this._metroSetLabel1); this._metroSetSetTabPage2.Controls.Add(this._metroSetDefaultButton2); this._metroSetSetTabPage2.Controls.Add(this._metroSetDefaultButton1); this._metroSetSetTabPage2.Font = null; this._metroSetSetTabPage2.ImageIndex = 0; this._metroSetSetTabPage2.ImageKey = null; this._metroSetSetTabPage2.IsDerivedStyle = true; this._metroSetSetTabPage2.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage2.Name = "_metroSetSetTabPage2"; this._metroSetSetTabPage2.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage2.StyleManager = this.styleManager1; this._metroSetSetTabPage2.TabIndex = 1; this._metroSetSetTabPage2.Text = "ButtonBase"; this._metroSetSetTabPage2.ThemeAuthor = "Narwin"; this._metroSetSetTabPage2.ThemeName = "MetroLite"; this._metroSetSetTabPage2.ToolTipText = null; // // _metroSetButton2 // this._metroSetButton2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton2.DisabledForeColor = System.Drawing.Color.Gray; this._metroSetButton2.Enabled = false; this._metroSetButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton2.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(207)))), ((int)(((byte)(255))))); this._metroSetButton2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(207)))), ((int)(((byte)(255))))); this._metroSetButton2.HoverTextColor = System.Drawing.Color.White; this._metroSetButton2.IsDerivedStyle = true; this._metroSetButton2.Location = new System.Drawing.Point(376, 171); this._metroSetButton2.Name = "_metroSetButton2"; this._metroSetButton2.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton2.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton2.NormalTextColor = System.Drawing.Color.White; this._metroSetButton2.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(147)))), ((int)(((byte)(195))))); this._metroSetButton2.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(147)))), ((int)(((byte)(195))))); this._metroSetButton2.PressTextColor = System.Drawing.Color.White; this._metroSetButton2.Size = new System.Drawing.Size(180, 40); this._metroSetButton2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton2.StyleManager = this.styleManager1; this._metroSetButton2.TabIndex = 9; this._metroSetButton2.Text = "Disabled button"; this._metroSetButton2.ThemeAuthor = "Narwin"; this._metroSetButton2.ThemeName = "MetroLite"; // // styleManager1 // this.styleManager1.CustomTheme = "C:\\Users\\Halloween\\Desktop\\MetroSet Theme.xml"; this.styleManager1.MetroForm = this; this.styleManager1.Style = MetroSet_UI.Enums.Style.Light; this.styleManager1.ThemeAuthor = "Narwin"; this.styleManager1.ThemeName = "MetroLite"; // // _metroSetButton1 // this._metroSetButton1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton1.DisabledForeColor = System.Drawing.Color.Gray; this._metroSetButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(207)))), ((int)(((byte)(255))))); this._metroSetButton1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(207)))), ((int)(((byte)(255))))); this._metroSetButton1.HoverTextColor = System.Drawing.Color.White; this._metroSetButton1.IsDerivedStyle = true; this._metroSetButton1.Location = new System.Drawing.Point(376, 104); this._metroSetButton1.Name = "_metroSetButton1"; this._metroSetButton1.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton1.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetButton1.NormalTextColor = System.Drawing.Color.White; this._metroSetButton1.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(147)))), ((int)(((byte)(195))))); this._metroSetButton1.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(147)))), ((int)(((byte)(195))))); this._metroSetButton1.PressTextColor = System.Drawing.Color.White; this._metroSetButton1.Size = new System.Drawing.Size(180, 40); this._metroSetButton1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton1.StyleManager = this.styleManager1; this._metroSetButton1.TabIndex = 9; this._metroSetButton1.Text = "Normal button"; this._metroSetButton1.ThemeAuthor = "Narwin"; this._metroSetButton1.ThemeName = "MetroLite"; // // _metroSetEllipse3 // this._metroSetEllipse3.BackColor = System.Drawing.Color.Transparent; this._metroSetEllipse3.BorderThickness = 5; this._metroSetEllipse3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetEllipse3.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetEllipse3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetEllipse3.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse3.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse3.HoverTextColor = System.Drawing.Color.White; this._metroSetEllipse3.Image = global::MetroSet_UI_Example.Properties.Resources.icons8_double_right; this._metroSetEllipse3.ImageSize = new System.Drawing.Size(64, 64); this._metroSetEllipse3.IsDerivedStyle = true; this._metroSetEllipse3.Location = new System.Drawing.Point(793, 234); this._metroSetEllipse3.Name = "_metroSetEllipse3"; this._metroSetEllipse3.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse3.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetEllipse3.NormalTextColor = System.Drawing.Color.Black; this._metroSetEllipse3.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse3.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse3.PressTextColor = System.Drawing.Color.White; this._metroSetEllipse3.Size = new System.Drawing.Size(139, 122); this._metroSetEllipse3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetEllipse3.StyleManager = this.styleManager1; this._metroSetEllipse3.TabIndex = 5; this._metroSetEllipse3.ThemeAuthor = "Narwin"; this._metroSetEllipse3.ThemeName = "MetroLite"; // // _metroSetEllipse2 // this._metroSetEllipse2.BackColor = System.Drawing.Color.Transparent; this._metroSetEllipse2.BorderThickness = 7; this._metroSetEllipse2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetEllipse2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetEllipse2.Enabled = false; this._metroSetEllipse2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetEllipse2.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse2.HoverTextColor = System.Drawing.Color.White; this._metroSetEllipse2.Image = null; this._metroSetEllipse2.ImageSize = new System.Drawing.Size(64, 64); this._metroSetEllipse2.IsDerivedStyle = true; this._metroSetEllipse2.Location = new System.Drawing.Point(870, 104); this._metroSetEllipse2.Name = "_metroSetEllipse2"; this._metroSetEllipse2.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse2.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetEllipse2.NormalTextColor = System.Drawing.Color.Black; this._metroSetEllipse2.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse2.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse2.PressTextColor = System.Drawing.Color.White; this._metroSetEllipse2.Size = new System.Drawing.Size(139, 122); this._metroSetEllipse2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetEllipse2.StyleManager = this.styleManager1; this._metroSetEllipse2.TabIndex = 5; this._metroSetEllipse2.Text = "Disabled Ellipse"; this._metroSetEllipse2.ThemeAuthor = "Narwin"; this._metroSetEllipse2.ThemeName = "MetroLite"; // // _metroSetEllipse1 // this._metroSetEllipse1.BackColor = System.Drawing.Color.Transparent; this._metroSetEllipse1.BorderThickness = 7; this._metroSetEllipse1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetEllipse1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetEllipse1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetEllipse1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetEllipse1.HoverTextColor = System.Drawing.Color.White; this._metroSetEllipse1.Image = null; this._metroSetEllipse1.ImageSize = new System.Drawing.Size(64, 64); this._metroSetEllipse1.IsDerivedStyle = true; this._metroSetEllipse1.Location = new System.Drawing.Point(714, 104); this._metroSetEllipse1.Name = "_metroSetEllipse1"; this._metroSetEllipse1.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetEllipse1.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetEllipse1.NormalTextColor = System.Drawing.Color.Black; this._metroSetEllipse1.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse1.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetEllipse1.PressTextColor = System.Drawing.Color.White; this._metroSetEllipse1.Size = new System.Drawing.Size(139, 122); this._metroSetEllipse1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetEllipse1.StyleManager = this.styleManager1; this._metroSetEllipse1.TabIndex = 5; this._metroSetEllipse1.Text = "Ellipse Button"; this._metroSetEllipse1.ThemeAuthor = "Narwin"; this._metroSetEllipse1.ThemeName = "MetroLite"; // // _metroSetBadge2 // this._metroSetBadge2.BackColor = System.Drawing.Color.Transparent; this._metroSetBadge2.BadgeAlignment = MetroSet_UI.Enums.BadgeAlign.TopRight; this._metroSetBadge2.BadgeText = "A"; this._metroSetBadge2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetBadge2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetBadge2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetBadge2.Enabled = false; this._metroSetBadge2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetBadge2.HoverBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(85)))), ((int)(((byte)(187)))), ((int)(((byte)(245))))); this._metroSetBadge2.HoverBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge2.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetBadge2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetBadge2.HoverTextColor = System.Drawing.Color.White; this._metroSetBadge2.IsDerivedStyle = true; this._metroSetBadge2.Location = new System.Drawing.Point(376, 289); this._metroSetBadge2.Name = "_metroSetBadge2"; this._metroSetBadge2.NormalBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetBadge2.NormalBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge2.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetBadge2.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetBadge2.NormalTextColor = System.Drawing.Color.Black; this._metroSetBadge2.PressBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(147)))), ((int)(((byte)(205))))); this._metroSetBadge2.PressBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge2.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetBadge2.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetBadge2.PressTextColor = System.Drawing.Color.White; this._metroSetBadge2.Size = new System.Drawing.Size(198, 67); this._metroSetBadge2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetBadge2.StyleManager = this.styleManager1; this._metroSetBadge2.TabIndex = 4; this._metroSetBadge2.Text = "Disabled Badge Button"; this._metroSetBadge2.ThemeAuthor = "Narwin"; this._metroSetBadge2.ThemeName = "MetroLite"; // // _metroSetBadge1 // this._metroSetBadge1.BackColor = System.Drawing.Color.Transparent; this._metroSetBadge1.BadgeAlignment = MetroSet_UI.Enums.BadgeAlign.TopRight; this._metroSetBadge1.BadgeText = "A"; this._metroSetBadge1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetBadge1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetBadge1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetBadge1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetBadge1.HoverBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(85)))), ((int)(((byte)(187)))), ((int)(((byte)(245))))); this._metroSetBadge1.HoverBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetBadge1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetBadge1.HoverTextColor = System.Drawing.Color.White; this._metroSetBadge1.IsDerivedStyle = true; this._metroSetBadge1.Location = new System.Drawing.Point(15, 289); this._metroSetBadge1.Name = "_metroSetBadge1"; this._metroSetBadge1.NormalBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetBadge1.NormalBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge1.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetBadge1.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetBadge1.NormalTextColor = System.Drawing.Color.Black; this._metroSetBadge1.PressBadgeColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(147)))), ((int)(((byte)(205))))); this._metroSetBadge1.PressBadgeTextColor = System.Drawing.Color.White; this._metroSetBadge1.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetBadge1.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetBadge1.PressTextColor = System.Drawing.Color.White; this._metroSetBadge1.Size = new System.Drawing.Size(195, 67); this._metroSetBadge1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetBadge1.StyleManager = this.styleManager1; this._metroSetBadge1.TabIndex = 3; this._metroSetBadge1.Text = "Normal Badge Button"; this._metroSetBadge1.ThemeAuthor = "Narwin"; this._metroSetBadge1.ThemeName = "MetroLite"; // // _metroSetLabel2 // this._metroSetLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel2.IsDerivedStyle = true; this._metroSetLabel2.Location = new System.Drawing.Point(15, 259); this._metroSetLabel2.Name = "_metroSetLabel2"; this._metroSetLabel2.Size = new System.Drawing.Size(100, 23); this._metroSetLabel2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel2.StyleManager = this.styleManager1; this._metroSetLabel2.TabIndex = 2; this._metroSetLabel2.Text = "Badge Button"; this._metroSetLabel2.ThemeAuthor = "Narwin"; this._metroSetLabel2.ThemeName = "MetroLite"; // // _metroSetLabel3 // this._metroSetLabel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel3.IsDerivedStyle = true; this._metroSetLabel3.Location = new System.Drawing.Point(810, 59); this._metroSetLabel3.Name = "_metroSetLabel3"; this._metroSetLabel3.Size = new System.Drawing.Size(100, 23); this._metroSetLabel3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel3.StyleManager = this.styleManager1; this._metroSetLabel3.TabIndex = 1; this._metroSetLabel3.Text = "Ellipse Button"; this._metroSetLabel3.ThemeAuthor = "Narwin"; this._metroSetLabel3.ThemeName = "MetroLite"; // // _metroSetLabel19 // this._metroSetLabel19.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel19.IsDerivedStyle = true; this._metroSetLabel19.Location = new System.Drawing.Point(376, 59); this._metroSetLabel19.Name = "_metroSetLabel19"; this._metroSetLabel19.Size = new System.Drawing.Size(100, 23); this._metroSetLabel19.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel19.StyleManager = this.styleManager1; this._metroSetLabel19.TabIndex = 1; this._metroSetLabel19.Text = "Normal Button"; this._metroSetLabel19.ThemeAuthor = "Narwin"; this._metroSetLabel19.ThemeName = "MetroLite"; // // _metroSetLabel1 // this._metroSetLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel1.IsDerivedStyle = true; this._metroSetLabel1.Location = new System.Drawing.Point(15, 59); this._metroSetLabel1.Name = "_metroSetLabel1"; this._metroSetLabel1.Size = new System.Drawing.Size(100, 23); this._metroSetLabel1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel1.StyleManager = this.styleManager1; this._metroSetLabel1.TabIndex = 1; this._metroSetLabel1.Text = "Default Button"; this._metroSetLabel1.ThemeAuthor = "Narwin"; this._metroSetLabel1.ThemeName = "MetroLite"; // // _metroSetDefaultButton2 // this._metroSetDefaultButton2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetDefaultButton2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetDefaultButton2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetDefaultButton2.Enabled = false; this._metroSetDefaultButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetDefaultButton2.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetDefaultButton2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetDefaultButton2.HoverTextColor = System.Drawing.Color.White; this._metroSetDefaultButton2.IsDerivedStyle = true; this._metroSetDefaultButton2.Location = new System.Drawing.Point(15, 171); this._metroSetDefaultButton2.Name = "_metroSetDefaultButton2"; this._metroSetDefaultButton2.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetDefaultButton2.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetDefaultButton2.NormalTextColor = System.Drawing.Color.Black; this._metroSetDefaultButton2.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetDefaultButton2.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetDefaultButton2.PressTextColor = System.Drawing.Color.White; this._metroSetDefaultButton2.Size = new System.Drawing.Size(180, 40); this._metroSetDefaultButton2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetDefaultButton2.StyleManager = this.styleManager1; this._metroSetDefaultButton2.TabIndex = 0; this._metroSetDefaultButton2.Text = "Disabled button"; this._metroSetDefaultButton2.ThemeAuthor = "Narwin"; this._metroSetDefaultButton2.ThemeName = "MetroLite"; // // _metroSetDefaultButton1 // this._metroSetDefaultButton1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetDefaultButton1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetDefaultButton1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetDefaultButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetDefaultButton1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetDefaultButton1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetDefaultButton1.HoverTextColor = System.Drawing.Color.White; this._metroSetDefaultButton1.IsDerivedStyle = true; this._metroSetDefaultButton1.Location = new System.Drawing.Point(15, 104); this._metroSetDefaultButton1.Name = "_metroSetDefaultButton1"; this._metroSetDefaultButton1.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetDefaultButton1.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetDefaultButton1.NormalTextColor = System.Drawing.Color.Black; this._metroSetDefaultButton1.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetDefaultButton1.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetDefaultButton1.PressTextColor = System.Drawing.Color.White; this._metroSetDefaultButton1.Size = new System.Drawing.Size(180, 40); this._metroSetDefaultButton1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetDefaultButton1.StyleManager = this.styleManager1; this._metroSetDefaultButton1.TabIndex = 0; this._metroSetDefaultButton1.Text = "Default button"; this._metroSetDefaultButton1.ThemeAuthor = "Narwin"; this._metroSetDefaultButton1.ThemeName = "MetroLite"; this._metroSetDefaultButton1.Click += new System.EventHandler(this.MetroSetDefaultButton1_Click); // // _metroSetSetTabPage1 // this._metroSetSetTabPage1.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage1.Controls.Add(this._metroSetTile8); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile4); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile7); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile6); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile2); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile5); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile3); this._metroSetSetTabPage1.Controls.Add(this._metroSetTile1); this._metroSetSetTabPage1.Controls.Add(this._metroSetLabel4); this._metroSetSetTabPage1.Font = null; this._metroSetSetTabPage1.ImageIndex = 0; this._metroSetSetTabPage1.ImageKey = null; this._metroSetSetTabPage1.IsDerivedStyle = true; this._metroSetSetTabPage1.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage1.Name = "_metroSetSetTabPage1"; this._metroSetSetTabPage1.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage1.StyleManager = this.styleManager1; this._metroSetSetTabPage1.TabIndex = 7; this._metroSetSetTabPage1.Text = "Tile"; this._metroSetSetTabPage1.ThemeAuthor = "Narwin"; this._metroSetSetTabPage1.ThemeName = "MetroLite"; this._metroSetSetTabPage1.ToolTipText = null; // // _metroSetTile8 // this._metroSetTile8.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile8.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile8.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile8.Enabled = false; this._metroSetTile8.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile8.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile8.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile8.HoverTextColor = System.Drawing.Color.White; this._metroSetTile8.IsDerivedStyle = true; this._metroSetTile8.Location = new System.Drawing.Point(732, 259); this._metroSetTile8.Name = "_metroSetTile8"; this._metroSetTile8.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile8.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile8.NormalTextColor = System.Drawing.Color.White; this._metroSetTile8.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile8.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile8.PressTextColor = System.Drawing.Color.White; this._metroSetTile8.Size = new System.Drawing.Size(190, 122); this._metroSetTile8.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile8.StyleManager = this.styleManager1; this._metroSetTile8.TabIndex = 13; this._metroSetTile8.Text = "Disabled Tile"; this._metroSetTile8.ThemeAuthor = "Narwin"; this._metroSetTile8.ThemeName = "MetroLite"; this._metroSetTile8.TileAlign = MetroSet_UI.Enums.TileAlign.BottomCenter; // // _metroSetTile4 // this._metroSetTile4.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile4.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile4.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile4.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile4.HoverTextColor = System.Drawing.Color.White; this._metroSetTile4.IsDerivedStyle = true; this._metroSetTile4.Location = new System.Drawing.Point(732, 104); this._metroSetTile4.Name = "_metroSetTile4"; this._metroSetTile4.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile4.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile4.NormalTextColor = System.Drawing.Color.White; this._metroSetTile4.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile4.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile4.PressTextColor = System.Drawing.Color.White; this._metroSetTile4.Size = new System.Drawing.Size(190, 122); this._metroSetTile4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile4.StyleManager = this.styleManager1; this._metroSetTile4.TabIndex = 13; this._metroSetTile4.Text = "Normal Tile"; this._metroSetTile4.ThemeAuthor = "Narwin"; this._metroSetTile4.ThemeName = "MetroLite"; this._metroSetTile4.TileAlign = MetroSet_UI.Enums.TileAlign.TopCenter; // // _metroSetTile7 // this._metroSetTile7.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._111201; this._metroSetTile7.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile7.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile7.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile7.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile7.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile7.HoverTextColor = System.Drawing.Color.White; this._metroSetTile7.IsDerivedStyle = true; this._metroSetTile7.Location = new System.Drawing.Point(254, 259); this._metroSetTile7.Name = "_metroSetTile7"; this._metroSetTile7.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile7.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile7.NormalTextColor = System.Drawing.Color.White; this._metroSetTile7.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile7.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile7.PressTextColor = System.Drawing.Color.White; this._metroSetTile7.Size = new System.Drawing.Size(190, 122); this._metroSetTile7.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile7.StyleManager = this.styleManager1; this._metroSetTile7.TabIndex = 10; this._metroSetTile7.Text = "TopCenter"; this._metroSetTile7.ThemeAuthor = "Narwin"; this._metroSetTile7.ThemeName = "MetroLite"; this._metroSetTile7.TileAlign = MetroSet_UI.Enums.TileAlign.BottomCenter; // // _metroSetTile6 // this._metroSetTile6.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._475841; this._metroSetTile6.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile6.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile6.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile6.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile6.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile6.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile6.HoverTextColor = System.Drawing.Color.White; this._metroSetTile6.IsDerivedStyle = true; this._metroSetTile6.Location = new System.Drawing.Point(493, 259); this._metroSetTile6.Name = "_metroSetTile6"; this._metroSetTile6.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile6.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile6.NormalTextColor = System.Drawing.Color.White; this._metroSetTile6.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile6.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile6.PressTextColor = System.Drawing.Color.White; this._metroSetTile6.Size = new System.Drawing.Size(190, 122); this._metroSetTile6.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile6.StyleManager = this.styleManager1; this._metroSetTile6.TabIndex = 11; this._metroSetTile6.Text = "BottomRight"; this._metroSetTile6.ThemeAuthor = "Narwin"; this._metroSetTile6.ThemeName = "MetroLite"; this._metroSetTile6.TileAlign = MetroSet_UI.Enums.TileAlign.BottomRight; // // _metroSetTile2 // this._metroSetTile2.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._579841; this._metroSetTile2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile2.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile2.HoverTextColor = System.Drawing.Color.White; this._metroSetTile2.IsDerivedStyle = true; this._metroSetTile2.Location = new System.Drawing.Point(254, 104); this._metroSetTile2.Name = "_metroSetTile2"; this._metroSetTile2.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile2.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile2.NormalTextColor = System.Drawing.Color.White; this._metroSetTile2.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile2.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile2.PressTextColor = System.Drawing.Color.White; this._metroSetTile2.Size = new System.Drawing.Size(190, 122); this._metroSetTile2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile2.StyleManager = this.styleManager1; this._metroSetTile2.TabIndex = 10; this._metroSetTile2.Text = "TopCenter"; this._metroSetTile2.ThemeAuthor = "Narwin"; this._metroSetTile2.ThemeName = "MetroLite"; this._metroSetTile2.TileAlign = MetroSet_UI.Enums.TileAlign.TopCenter; // // _metroSetTile5 // this._metroSetTile5.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._579840; this._metroSetTile5.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile5.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile5.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile5.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile5.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile5.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile5.HoverTextColor = System.Drawing.Color.White; this._metroSetTile5.IsDerivedStyle = true; this._metroSetTile5.Location = new System.Drawing.Point(493, 104); this._metroSetTile5.Name = "_metroSetTile5"; this._metroSetTile5.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile5.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile5.NormalTextColor = System.Drawing.Color.White; this._metroSetTile5.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile5.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile5.PressTextColor = System.Drawing.Color.White; this._metroSetTile5.Size = new System.Drawing.Size(190, 122); this._metroSetTile5.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile5.StyleManager = this.styleManager1; this._metroSetTile5.TabIndex = 12; this._metroSetTile5.ThemeAuthor = "Narwin"; this._metroSetTile5.ThemeName = "MetroLite"; this._metroSetTile5.TileAlign = MetroSet_UI.Enums.TileAlign.Topleft; // // _metroSetTile3 // this._metroSetTile3.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._475841; this._metroSetTile3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile3.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile3.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile3.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile3.HoverTextColor = System.Drawing.Color.White; this._metroSetTile3.IsDerivedStyle = true; this._metroSetTile3.Location = new System.Drawing.Point(15, 259); this._metroSetTile3.Name = "_metroSetTile3"; this._metroSetTile3.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile3.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile3.NormalTextColor = System.Drawing.Color.White; this._metroSetTile3.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile3.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile3.PressTextColor = System.Drawing.Color.White; this._metroSetTile3.Size = new System.Drawing.Size(190, 122); this._metroSetTile3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile3.StyleManager = this.styleManager1; this._metroSetTile3.TabIndex = 11; this._metroSetTile3.Text = "BottomRight"; this._metroSetTile3.ThemeAuthor = "Narwin"; this._metroSetTile3.ThemeName = "MetroLite"; this._metroSetTile3.TileAlign = MetroSet_UI.Enums.TileAlign.BottomRight; // // _metroSetTile1 // this._metroSetTile1.BackgroundImage = global::MetroSet_UI_Example.Properties.Resources._372649; this._metroSetTile1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTile1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTile1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTile1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTile1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this._metroSetTile1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile1.HoverTextColor = System.Drawing.Color.White; this._metroSetTile1.IsDerivedStyle = true; this._metroSetTile1.Location = new System.Drawing.Point(15, 104); this._metroSetTile1.Name = "_metroSetTile1"; this._metroSetTile1.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile1.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile1.NormalTextColor = System.Drawing.Color.White; this._metroSetTile1.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile1.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetTile1.PressTextColor = System.Drawing.Color.White; this._metroSetTile1.Size = new System.Drawing.Size(190, 122); this._metroSetTile1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTile1.StyleManager = this.styleManager1; this._metroSetTile1.TabIndex = 12; this._metroSetTile1.Text = "BottmLeft"; this._metroSetTile1.ThemeAuthor = "Narwin"; this._metroSetTile1.ThemeName = "MetroLite"; this._metroSetTile1.TileAlign = MetroSet_UI.Enums.TileAlign.Topleft; // // _metroSetLabel4 // this._metroSetLabel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel4.IsDerivedStyle = true; this._metroSetLabel4.Location = new System.Drawing.Point(15, 59); this._metroSetLabel4.Name = "_metroSetLabel4"; this._metroSetLabel4.Size = new System.Drawing.Size(100, 23); this._metroSetLabel4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel4.StyleManager = this.styleManager1; this._metroSetLabel4.TabIndex = 9; this._metroSetLabel4.Text = "Tile"; this._metroSetLabel4.ThemeAuthor = "Narwin"; this._metroSetLabel4.ThemeName = "MetroLite"; // // _metroSetSetTabPage3 // this._metroSetSetTabPage3.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage3.Controls.Add(this._metroSetListBox2); this._metroSetSetTabPage3.Controls.Add(this._metroSetComboBox2); this._metroSetSetTabPage3.Controls.Add(this._metroSetComboBox1); this._metroSetSetTabPage3.Controls.Add(this._metroSetNumeric3); this._metroSetSetTabPage3.Controls.Add(this._metroSetNumeric2); this._metroSetSetTabPage3.Controls.Add(this._metroSetRichTextBox1); this._metroSetSetTabPage3.Controls.Add(this._metroSetTextBox3); this._metroSetSetTabPage3.Controls.Add(this._metroSetTextBox2); this._metroSetSetTabPage3.Controls.Add(this._metroSetTextBox4); this._metroSetSetTabPage3.Controls.Add(this._metroSetTextBox1); this._metroSetSetTabPage3.Controls.Add(this._metroSetLabel8); this._metroSetSetTabPage3.Controls.Add(this._metroSetLabel9); this._metroSetSetTabPage3.Controls.Add(this._metroSetLabel6); this._metroSetSetTabPage3.Controls.Add(this._metroSetLabel7); this._metroSetSetTabPage3.Controls.Add(this._metroSetLabel5); this._metroSetSetTabPage3.Font = null; this._metroSetSetTabPage3.ImageIndex = 0; this._metroSetSetTabPage3.ImageKey = null; this._metroSetSetTabPage3.IsDerivedStyle = true; this._metroSetSetTabPage3.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage3.Name = "_metroSetSetTabPage3"; this._metroSetSetTabPage3.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage3.StyleManager = this.styleManager1; this._metroSetSetTabPage3.TabIndex = 2; this._metroSetSetTabPage3.Text = "InputBase"; this._metroSetSetTabPage3.ThemeAuthor = "Narwin"; this._metroSetSetTabPage3.ThemeName = "MetroLite"; this._metroSetSetTabPage3.ToolTipText = null; // // _metroSetListBox2 // this._metroSetListBox2.BackColor = System.Drawing.Color.White; this._metroSetListBox2.BorderColor = System.Drawing.Color.LightGray; this._metroSetListBox2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetListBox2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetListBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetListBox2.HoveredItemBackColor = System.Drawing.Color.LightGray; this._metroSetListBox2.HoveredItemColor = System.Drawing.Color.DimGray; this._metroSetListBox2.IsDerivedStyle = true; this._metroSetListBox2.ItemHeight = 30; this._metroSetListBox2.Items.Add("ListItem 1"); this._metroSetListBox2.Items.Add("ListItem 2"); this._metroSetListBox2.Items.Add("ListItem 3"); this._metroSetListBox2.Items.Add("ListItem 4"); this._metroSetListBox2.Items.Add("ListItem 5"); this._metroSetListBox2.Items.Add("ListItem 6"); this._metroSetListBox2.Items.Add("ListItem 7"); this._metroSetListBox2.Items.Add("ListItem 8"); this._metroSetListBox2.Items.Add("ListItem 9"); this._metroSetListBox2.Items.Add("ListItem 10"); this._metroSetListBox2.Items.Add("ListItem 11"); this._metroSetListBox2.Items.Add("ListItem 12"); this._metroSetListBox2.Items.Add("ListItem 13"); this._metroSetListBox2.Items.Add("ListItem 14"); this._metroSetListBox2.Items.Add("ListItem 15"); this._metroSetListBox2.Items.Add("ListItem 16"); this._metroSetListBox2.Items.Add("ListItem 17"); this._metroSetListBox2.Items.Add("ListItem 18"); this._metroSetListBox2.Items.Add("ListItem 19"); this._metroSetListBox2.Items.Add("ListItem 20"); this._metroSetListBox2.Items.Add("ListItem 21"); this._metroSetListBox2.Items.Add("ListItem 22"); this._metroSetListBox2.Items.Add("ListItem 23"); this._metroSetListBox2.Items.Add("ListItem 24"); this._metroSetListBox2.Items.Add("ListItem 25"); this._metroSetListBox2.Items.Add("ListItem 26"); this._metroSetListBox2.Items.Add("ListItem 27"); this._metroSetListBox2.Items.Add("ListItem 28"); this._metroSetListBox2.Items.Add("ListItem 29"); this._metroSetListBox2.Items.Add("ListItem 30"); this._metroSetListBox2.Items.Add("ListItem 31"); this._metroSetListBox2.Items.Add("ListItem 32"); this._metroSetListBox2.Items.Add("ListItem 33"); this._metroSetListBox2.Items.Add("ListItem 34"); this._metroSetListBox2.Items.Add("ListItem 35"); this._metroSetListBox2.Items.Add("ListItem 36"); this._metroSetListBox2.Items.Add("ListItem 37"); this._metroSetListBox2.Items.Add("ListItem 38"); this._metroSetListBox2.Items.Add("ListItem 39"); this._metroSetListBox2.Items.Add("ListItem 40"); this._metroSetListBox2.Items.Add("ListItem 41"); this._metroSetListBox2.Items.Add("ListItem 42"); this._metroSetListBox2.Items.Add("ListItem 43"); this._metroSetListBox2.Items.Add("ListItem 44"); this._metroSetListBox2.Items.Add("ListItem 45"); this._metroSetListBox2.Items.Add("ListItem 46"); this._metroSetListBox2.Items.Add("ListItem 47"); this._metroSetListBox2.Items.Add("ListItem 48"); this._metroSetListBox2.Items.Add("ListItem 49"); this._metroSetListBox2.Items.Add("ListItem 50"); this._metroSetListBox2.Items.Add("ListItem 51"); this._metroSetListBox2.Items.Add("ListItem 52"); this._metroSetListBox2.Items.Add("ListItem 53"); this._metroSetListBox2.Items.Add("ListItem 54"); this._metroSetListBox2.Items.Add("ListItem 55"); this._metroSetListBox2.Items.Add("ListItem 56"); this._metroSetListBox2.Items.Add("ListItem 57"); this._metroSetListBox2.Items.Add("ListItem 58"); this._metroSetListBox2.Items.Add("ListItem 59"); this._metroSetListBox2.Items.Add("ListItem 60"); this._metroSetListBox2.Items.Add("ListItem 61"); this._metroSetListBox2.Items.Add("ListItem 62"); this._metroSetListBox2.Items.Add("ListItem 63"); this._metroSetListBox2.Items.Add("ListItem 64"); this._metroSetListBox2.Items.Add("ListItem 65"); this._metroSetListBox2.Items.Add("ListItem 66"); this._metroSetListBox2.Items.Add("ListItem 67"); this._metroSetListBox2.Items.Add("ListItem 68"); this._metroSetListBox2.Items.Add("ListItem 69"); this._metroSetListBox2.Items.Add("ListItem 70"); this._metroSetListBox2.Items.Add("ListItem 71"); this._metroSetListBox2.Items.Add("ListItem 72"); this._metroSetListBox2.Items.Add("ListItem 73"); this._metroSetListBox2.Items.Add("ListItem 74"); this._metroSetListBox2.Items.Add("ListItem 75"); this._metroSetListBox2.Items.Add("ListItem 76"); this._metroSetListBox2.Items.Add("ListItem 77"); this._metroSetListBox2.Items.Add("ListItem 78"); this._metroSetListBox2.Items.Add("ListItem 79"); this._metroSetListBox2.Items.Add("ListItem 80"); this._metroSetListBox2.Items.Add("ListItem 81"); this._metroSetListBox2.Items.Add("ListItem 82"); this._metroSetListBox2.Items.Add("ListItem 83"); this._metroSetListBox2.Items.Add("ListItem 84"); this._metroSetListBox2.Items.Add("ListItem 85"); this._metroSetListBox2.Items.Add("ListItem 86"); this._metroSetListBox2.Items.Add("ListItem 87"); this._metroSetListBox2.Items.Add("ListItem 88"); this._metroSetListBox2.Items.Add("ListItem 89"); this._metroSetListBox2.Items.Add("ListItem 90"); this._metroSetListBox2.Items.Add("ListItem 91"); this._metroSetListBox2.Items.Add("ListItem 92"); this._metroSetListBox2.Items.Add("ListItem 93"); this._metroSetListBox2.Items.Add("ListItem 94"); this._metroSetListBox2.Items.Add("ListItem 95"); this._metroSetListBox2.Items.Add("ListItem 96"); this._metroSetListBox2.Items.Add("ListItem 97"); this._metroSetListBox2.Items.Add("ListItem 98"); this._metroSetListBox2.Items.Add("ListItem 99"); this._metroSetListBox2.Items.Add("ListItem 100"); this._metroSetListBox2.Location = new System.Drawing.Point(635, 82); this._metroSetListBox2.MultiSelect = false; this._metroSetListBox2.Name = "_metroSetListBox2"; this._metroSetListBox2.SelectedIndex = -1; this._metroSetListBox2.SelectedItem = null; this._metroSetListBox2.SelectedItemBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetListBox2.SelectedItemColor = System.Drawing.Color.White; this._metroSetListBox2.SelectedText = null; this._metroSetListBox2.SelectedValue = null; this._metroSetListBox2.ShowBorder = false; this._metroSetListBox2.ShowScrollBar = true; this._metroSetListBox2.Size = new System.Drawing.Size(374, 286); this._metroSetListBox2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetListBox2.StyleManager = this.styleManager1; this._metroSetListBox2.TabIndex = 9; this._metroSetListBox2.ThemeAuthor = "Narwin"; this._metroSetListBox2.ThemeName = "MetroLite"; this._metroSetListBox2.SelectedIndexChanged += new MetroSet_UI.Controls.MetroSetListBox.SelectedIndexChangedEventHandler(this.metroSetListBox2_SelectedIndexChanged); // // _metroSetComboBox2 // this._metroSetComboBox2.AllowDrop = true; this._metroSetComboBox2.ArrowColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetComboBox2.BackColor = System.Drawing.Color.Transparent; this._metroSetComboBox2.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetComboBox2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetComboBox2.CausesValidation = false; this._metroSetComboBox2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetComboBox2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetComboBox2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetComboBox2.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this._metroSetComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._metroSetComboBox2.Enabled = false; this._metroSetComboBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); this._metroSetComboBox2.FormattingEnabled = true; this._metroSetComboBox2.IsDerivedStyle = true; this._metroSetComboBox2.ItemHeight = 20; this._metroSetComboBox2.Location = new System.Drawing.Point(305, 342); this._metroSetComboBox2.Name = "_metroSetComboBox2"; this._metroSetComboBox2.SelectedItemBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetComboBox2.SelectedItemForeColor = System.Drawing.Color.White; this._metroSetComboBox2.Size = new System.Drawing.Size(215, 26); this._metroSetComboBox2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetComboBox2.StyleManager = this.styleManager1; this._metroSetComboBox2.TabIndex = 7; this._metroSetComboBox2.ThemeAuthor = "Narwin"; this._metroSetComboBox2.ThemeName = "MetroLite"; // // _metroSetComboBox1 // this._metroSetComboBox1.AllowDrop = true; this._metroSetComboBox1.ArrowColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetComboBox1.BackColor = System.Drawing.Color.Transparent; this._metroSetComboBox1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetComboBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetComboBox1.CausesValidation = false; this._metroSetComboBox1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetComboBox1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetComboBox1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetComboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this._metroSetComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._metroSetComboBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); this._metroSetComboBox1.FormattingEnabled = true; this._metroSetComboBox1.IsDerivedStyle = true; this._metroSetComboBox1.ItemHeight = 20; this._metroSetComboBox1.Items.AddRange(new object[] { "ListItem 1", "ListItem 2", "ListItem 3", "ListItem 4", "ListItem 5", "ListItem 6", "ListItem 7", "ListItem 8", "ListItem 9", "ListItem 10", "ListItem 11", "ListItem 12", "ListItem 13", "ListItem 14", "ListItem 15", "ListItem 16", "ListItem 17", "ListItem 18", "ListItem 19", "ListItem 20", "ListItem 21", "ListItem 22", "ListItem 23", "ListItem 24", "ListItem 25", "ListItem 26", "ListItem 27", "ListItem 28", "ListItem 29", "ListItem 30", "ListItem 31", "ListItem 32", "ListItem 33", "ListItem 34", "ListItem 35", "ListItem 36", "ListItem 37", "ListItem 38", "ListItem 39", "ListItem 40", "ListItem 41", "ListItem 42", "ListItem 43", "ListItem 44", "ListItem 45", "ListItem 46", "ListItem 47", "ListItem 48", "ListItem 49", "ListItem 50", "ListItem 51", "ListItem 52", "ListItem 53", "ListItem 54", "ListItem 55", "ListItem 56", "ListItem 57", "ListItem 58", "ListItem 59", "ListItem 60", "ListItem 61", "ListItem 62", "ListItem 63", "ListItem 64", "ListItem 65", "ListItem 66", "ListItem 67", "ListItem 68", "ListItem 69", "ListItem 70", "ListItem 71", "ListItem 72", "ListItem 73", "ListItem 74", "ListItem 75", "ListItem 76", "ListItem 77", "ListItem 78", "ListItem 79", "ListItem 80", "ListItem 81", "ListItem 82", "ListItem 83", "ListItem 84", "ListItem 85", "ListItem 86", "ListItem 87", "ListItem 88", "ListItem 89", "ListItem 90", "ListItem 91", "ListItem 92", "ListItem 93", "ListItem 94", "ListItem 95", "ListItem 96", "ListItem 97", "ListItem 98", "ListItem 99", "ListItem 100"}); this._metroSetComboBox1.Location = new System.Drawing.Point(305, 292); this._metroSetComboBox1.Name = "_metroSetComboBox1"; this._metroSetComboBox1.SelectedItemBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetComboBox1.SelectedItemForeColor = System.Drawing.Color.White; this._metroSetComboBox1.Size = new System.Drawing.Size(215, 26); this._metroSetComboBox1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetComboBox1.StyleManager = this.styleManager1; this._metroSetComboBox1.TabIndex = 7; this._metroSetComboBox1.ThemeAuthor = "Narwin"; this._metroSetComboBox1.ThemeName = "MetroLite"; this._metroSetSetToolTip1.SetToolTip(this._metroSetComboBox1, "MetroSetComboBox"); // // _metroSetNumeric3 // this._metroSetNumeric3.BackColor = System.Drawing.Color.Transparent; this._metroSetNumeric3.BackgroundColor = System.Drawing.Color.Empty; this._metroSetNumeric3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetNumeric3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetNumeric3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetNumeric3.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetNumeric3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetNumeric3.IsDerivedStyle = true; this._metroSetNumeric3.Location = new System.Drawing.Point(15, 426); this._metroSetNumeric3.Maximum = 100; this._metroSetNumeric3.Minimum = 0; this._metroSetNumeric3.Name = "_metroSetNumeric3"; this._metroSetNumeric3.Size = new System.Drawing.Size(215, 26); this._metroSetNumeric3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetNumeric3.StyleManager = this.styleManager1; this._metroSetNumeric3.SymbolsColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); this._metroSetNumeric3.TabIndex = 6; this._metroSetNumeric3.Text = "_metroSetNumeric3"; this._metroSetNumeric3.ThemeAuthor = "Narwin"; this._metroSetNumeric3.ThemeName = "MetroLite"; this._metroSetNumeric3.Value = 5; // // _metroSetNumeric2 // this._metroSetNumeric2.BackColor = System.Drawing.Color.Transparent; this._metroSetNumeric2.BackgroundColor = System.Drawing.Color.Empty; this._metroSetNumeric2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this._metroSetNumeric2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetNumeric2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetNumeric2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetNumeric2.Enabled = false; this._metroSetNumeric2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetNumeric2.IsDerivedStyle = true; this._metroSetNumeric2.Location = new System.Drawing.Point(15, 476); this._metroSetNumeric2.Maximum = 100; this._metroSetNumeric2.Minimum = 0; this._metroSetNumeric2.Name = "_metroSetNumeric2"; this._metroSetNumeric2.Size = new System.Drawing.Size(215, 26); this._metroSetNumeric2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetNumeric2.StyleManager = this.styleManager1; this._metroSetNumeric2.SymbolsColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); this._metroSetNumeric2.TabIndex = 5; this._metroSetNumeric2.Text = "metroSetNumeric1"; this._metroSetNumeric2.ThemeAuthor = "Narwin"; this._metroSetNumeric2.ThemeName = "MetroLite"; this._metroSetNumeric2.Value = 0; // // _metroSetRichTextBox1 // this._metroSetRichTextBox1.AutoWordSelection = false; this._metroSetRichTextBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRichTextBox1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetRichTextBox1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRichTextBox1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetRichTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetRichTextBox1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetRichTextBox1.IsDerivedStyle = true; this._metroSetRichTextBox1.Lines = null; this._metroSetRichTextBox1.Location = new System.Drawing.Point(305, 93); this._metroSetRichTextBox1.MaxLength = 32767; this._metroSetRichTextBox1.Name = "_metroSetRichTextBox1"; this._metroSetRichTextBox1.ReadOnly = false; this._metroSetRichTextBox1.Size = new System.Drawing.Size(245, 138); this._metroSetRichTextBox1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetRichTextBox1.StyleManager = this.styleManager1; this._metroSetRichTextBox1.TabIndex = 4; this._metroSetRichTextBox1.Text = resources.GetString("_metroSetRichTextBox1.Text"); this._metroSetRichTextBox1.ThemeAuthor = "Narwin"; this._metroSetRichTextBox1.ThemeName = "MetroLite"; this._metroSetRichTextBox1.WordWrap = true; // // _metroSetTextBox3 // this._metroSetTextBox3.AutoCompleteCustomSource = null; this._metroSetTextBox3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None; this._metroSetTextBox3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None; this._metroSetTextBox3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTextBox3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox3.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTextBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTextBox3.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetTextBox3.Image = null; this._metroSetTextBox3.IsDerivedStyle = true; this._metroSetTextBox3.Lines = null; this._metroSetTextBox3.Location = new System.Drawing.Point(15, 230); this._metroSetTextBox3.MaxLength = 32767; this._metroSetTextBox3.Multiline = true; this._metroSetTextBox3.Name = "_metroSetTextBox3"; this._metroSetTextBox3.ReadOnly = false; this._metroSetTextBox3.Size = new System.Drawing.Size(215, 138); this._metroSetTextBox3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTextBox3.StyleManager = this.styleManager1; this._metroSetTextBox3.TabIndex = 3; this._metroSetTextBox3.Text = resources.GetString("_metroSetTextBox3.Text"); this._metroSetTextBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this._metroSetTextBox3.ThemeAuthor = "Narwin"; this._metroSetTextBox3.ThemeName = "MetroLite"; this._metroSetTextBox3.UseSystemPasswordChar = false; this._metroSetTextBox3.WatermarkText = ""; // // _metroSetTextBox2 // this._metroSetTextBox2.AutoCompleteCustomSource = null; this._metroSetTextBox2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None; this._metroSetTextBox2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None; this._metroSetTextBox2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTextBox2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox2.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTextBox2.Enabled = false; this._metroSetTextBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTextBox2.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetTextBox2.Image = null; this._metroSetTextBox2.IsDerivedStyle = true; this._metroSetTextBox2.Lines = null; this._metroSetTextBox2.Location = new System.Drawing.Point(15, 185); this._metroSetTextBox2.MaxLength = 32767; this._metroSetTextBox2.Multiline = false; this._metroSetTextBox2.Name = "_metroSetTextBox2"; this._metroSetTextBox2.ReadOnly = false; this._metroSetTextBox2.Size = new System.Drawing.Size(215, 26); this._metroSetTextBox2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTextBox2.StyleManager = this.styleManager1; this._metroSetTextBox2.TabIndex = 3; this._metroSetTextBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this._metroSetTextBox2.ThemeAuthor = "Narwin"; this._metroSetTextBox2.ThemeName = "MetroLite"; this._metroSetTextBox2.UseSystemPasswordChar = false; this._metroSetTextBox2.WatermarkText = "Disabled TextBox"; // // _metroSetTextBox4 // this._metroSetTextBox4.AutoCompleteCustomSource = null; this._metroSetTextBox4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None; this._metroSetTextBox4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None; this._metroSetTextBox4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox4.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTextBox4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox4.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTextBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTextBox4.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetTextBox4.Image = global::MetroSet_UI_Example.Properties.Resources.filter; this._metroSetTextBox4.IsDerivedStyle = true; this._metroSetTextBox4.Lines = null; this._metroSetTextBox4.Location = new System.Drawing.Point(15, 139); this._metroSetTextBox4.MaxLength = 32767; this._metroSetTextBox4.Multiline = false; this._metroSetTextBox4.Name = "_metroSetTextBox4"; this._metroSetTextBox4.ReadOnly = false; this._metroSetTextBox4.Size = new System.Drawing.Size(215, 26); this._metroSetTextBox4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTextBox4.StyleManager = this.styleManager1; this._metroSetTextBox4.TabIndex = 3; this._metroSetTextBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this._metroSetTextBox4.ThemeAuthor = "Narwin"; this._metroSetTextBox4.ThemeName = "MetroLite"; this._metroSetTextBox4.UseSystemPasswordChar = false; this._metroSetTextBox4.WatermarkText = "Image TextBox"; // // _metroSetTextBox1 // this._metroSetTextBox1.AutoCompleteCustomSource = null; this._metroSetTextBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None; this._metroSetTextBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None; this._metroSetTextBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox1.ContextMenuStrip = this._metroSetContextMenuStrip1; this._metroSetTextBox1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetTextBox1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetTextBox1.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetTextBox1.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetTextBox1.Image = null; this._metroSetTextBox1.IsDerivedStyle = true; this._metroSetTextBox1.Lines = null; this._metroSetTextBox1.Location = new System.Drawing.Point(15, 93); this._metroSetTextBox1.MaxLength = 32767; this._metroSetTextBox1.Multiline = false; this._metroSetTextBox1.Name = "_metroSetTextBox1"; this._metroSetTextBox1.ReadOnly = false; this._metroSetTextBox1.Size = new System.Drawing.Size(215, 26); this._metroSetTextBox1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTextBox1.StyleManager = this.styleManager1; this._metroSetTextBox1.TabIndex = 3; this._metroSetTextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this._metroSetTextBox1.ThemeAuthor = "Narwin"; this._metroSetTextBox1.ThemeName = "MetroLite"; this._metroSetTextBox1.UseSystemPasswordChar = false; this._metroSetTextBox1.WatermarkText = "Normal TextBox"; // // _metroSetContextMenuStrip1 // this._metroSetContextMenuStrip1.IsDerivedStyle = true; this._metroSetContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.textBoxToolStripMenuItem}); this._metroSetContextMenuStrip1.Name = "_metroSetContextMenuStrip1"; this._metroSetContextMenuStrip1.Size = new System.Drawing.Size(116, 26); this._metroSetContextMenuStrip1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetContextMenuStrip1.StyleManager = null; this._metroSetContextMenuStrip1.ThemeAuthor = "Narwin"; this._metroSetContextMenuStrip1.ThemeName = "MetroLite"; // // textBoxToolStripMenuItem // this.textBoxToolStripMenuItem.Name = "textBoxToolStripMenuItem"; this.textBoxToolStripMenuItem.Size = new System.Drawing.Size(115, 22); this.textBoxToolStripMenuItem.Text = "TextBox"; // // _metroSetLabel8 // this._metroSetLabel8.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel8.IsDerivedStyle = true; this._metroSetLabel8.Location = new System.Drawing.Point(305, 254); this._metroSetLabel8.Name = "_metroSetLabel8"; this._metroSetLabel8.Size = new System.Drawing.Size(138, 23); this._metroSetLabel8.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel8.StyleManager = this.styleManager1; this._metroSetLabel8.TabIndex = 2; this._metroSetLabel8.Text = "Normal ComboBox"; this._metroSetLabel8.ThemeAuthor = "Narwin"; this._metroSetLabel8.ThemeName = "MetroLite"; // // _metroSetLabel9 // this._metroSetLabel9.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel9.IsDerivedStyle = true; this._metroSetLabel9.Location = new System.Drawing.Point(635, 55); this._metroSetLabel9.Name = "_metroSetLabel9"; this._metroSetLabel9.Size = new System.Drawing.Size(138, 23); this._metroSetLabel9.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel9.StyleManager = this.styleManager1; this._metroSetLabel9.TabIndex = 2; this._metroSetLabel9.Text = "Normal ListBox"; this._metroSetLabel9.ThemeAuthor = "Narwin"; this._metroSetLabel9.ThemeName = "MetroLite"; // // _metroSetLabel6 // this._metroSetLabel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel6.IsDerivedStyle = true; this._metroSetLabel6.Location = new System.Drawing.Point(305, 55); this._metroSetLabel6.Name = "_metroSetLabel6"; this._metroSetLabel6.Size = new System.Drawing.Size(138, 23); this._metroSetLabel6.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel6.StyleManager = this.styleManager1; this._metroSetLabel6.TabIndex = 2; this._metroSetLabel6.Text = "Normal RichTextBox"; this._metroSetLabel6.ThemeAuthor = "Narwin"; this._metroSetLabel6.ThemeName = "MetroLite"; // // _metroSetLabel7 // this._metroSetLabel7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel7.IsDerivedStyle = true; this._metroSetLabel7.Location = new System.Drawing.Point(15, 388); this._metroSetLabel7.Name = "_metroSetLabel7"; this._metroSetLabel7.Size = new System.Drawing.Size(114, 23); this._metroSetLabel7.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel7.StyleManager = this.styleManager1; this._metroSetLabel7.TabIndex = 2; this._metroSetLabel7.Text = "Normal Numeric"; this._metroSetLabel7.ThemeAuthor = "Narwin"; this._metroSetLabel7.ThemeName = "MetroLite"; // // _metroSetLabel5 // this._metroSetLabel5.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel5.IsDerivedStyle = true; this._metroSetLabel5.Location = new System.Drawing.Point(15, 55); this._metroSetLabel5.Name = "_metroSetLabel5"; this._metroSetLabel5.Size = new System.Drawing.Size(114, 23); this._metroSetLabel5.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel5.StyleManager = this.styleManager1; this._metroSetLabel5.TabIndex = 2; this._metroSetLabel5.Text = "Normal TextBox"; this._metroSetLabel5.ThemeAuthor = "Narwin"; this._metroSetLabel5.ThemeName = "MetroLite"; // // _metroSetSetTabPage4 // this._metroSetSetTabPage4.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage4.Controls.Add(this._metroSetSwitch4); this._metroSetSetTabPage4.Controls.Add(this._metroSetSwitch3); this._metroSetSetTabPage4.Controls.Add(this._metroSetSwitch2); this._metroSetSetTabPage4.Controls.Add(this._metroSetSwitch1); this._metroSetSetTabPage4.Controls.Add(this._metroSetLabel12); this._metroSetSetTabPage4.Controls.Add(this._metroSetRadioButton4); this._metroSetSetTabPage4.Controls.Add(this._metroSetRadioButton3); this._metroSetSetTabPage4.Controls.Add(this._metroSetRadioButton2); this._metroSetSetTabPage4.Controls.Add(this._metroSetRadioButton1); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox5); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox4); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox3); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox2); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox6); this._metroSetSetTabPage4.Controls.Add(this._metroSetCheckBox1); this._metroSetSetTabPage4.Controls.Add(this._metroSetLabel11); this._metroSetSetTabPage4.Controls.Add(this._metroSetLabel10); this._metroSetSetTabPage4.Font = null; this._metroSetSetTabPage4.ImageIndex = 0; this._metroSetSetTabPage4.ImageKey = null; this._metroSetSetTabPage4.IsDerivedStyle = true; this._metroSetSetTabPage4.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage4.Name = "_metroSetSetTabPage4"; this._metroSetSetTabPage4.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage4.StyleManager = this.styleManager1; this._metroSetSetTabPage4.TabIndex = 3; this._metroSetSetTabPage4.Text = "Switchery"; this._metroSetSetTabPage4.ThemeAuthor = "Narwin"; this._metroSetSetTabPage4.ThemeName = "MetroLite"; this._metroSetSetTabPage4.ToolTipText = null; // // _metroSetSwitch4 // this._metroSetSwitch4.BackColor = System.Drawing.Color.Transparent; this._metroSetSwitch4.BackgroundColor = System.Drawing.Color.Empty; this._metroSetSwitch4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(165)))), ((int)(((byte)(159)))), ((int)(((byte)(147))))); this._metroSetSwitch4.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch4.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetSwitch4.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetSwitch4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch4.DisabledCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch4.DisabledUnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch4.Enabled = false; this._metroSetSwitch4.IsDerivedStyle = true; this._metroSetSwitch4.Location = new System.Drawing.Point(635, 220); this._metroSetSwitch4.Name = "_metroSetSwitch4"; this._metroSetSwitch4.Size = new System.Drawing.Size(58, 22); this._metroSetSwitch4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSwitch4.StyleManager = this.styleManager1; this._metroSetSwitch4.Switched = true; this._metroSetSwitch4.SymbolColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); this._metroSetSwitch4.TabIndex = 8; this._metroSetSwitch4.Text = "_metroSetSwitch1"; this._metroSetSwitch4.ThemeAuthor = "Narwin"; this._metroSetSwitch4.ThemeName = "MetroLite"; this._metroSetSwitch4.UnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); // // _metroSetSwitch3 // this._metroSetSwitch3.BackColor = System.Drawing.Color.Transparent; this._metroSetSwitch3.BackgroundColor = System.Drawing.Color.Empty; this._metroSetSwitch3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(165)))), ((int)(((byte)(159)))), ((int)(((byte)(147))))); this._metroSetSwitch3.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch3.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetSwitch3.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetSwitch3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch3.DisabledCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch3.DisabledUnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch3.Enabled = false; this._metroSetSwitch3.IsDerivedStyle = true; this._metroSetSwitch3.Location = new System.Drawing.Point(635, 179); this._metroSetSwitch3.Name = "_metroSetSwitch3"; this._metroSetSwitch3.Size = new System.Drawing.Size(58, 22); this._metroSetSwitch3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSwitch3.StyleManager = this.styleManager1; this._metroSetSwitch3.Switched = false; this._metroSetSwitch3.SymbolColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); this._metroSetSwitch3.TabIndex = 7; this._metroSetSwitch3.Text = "_metroSetSwitch1"; this._metroSetSwitch3.ThemeAuthor = "Narwin"; this._metroSetSwitch3.ThemeName = "MetroLite"; this._metroSetSwitch3.UnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); // // _metroSetSwitch2 // this._metroSetSwitch2.BackColor = System.Drawing.Color.Transparent; this._metroSetSwitch2.BackgroundColor = System.Drawing.Color.Empty; this._metroSetSwitch2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(165)))), ((int)(((byte)(159)))), ((int)(((byte)(147))))); this._metroSetSwitch2.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch2.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetSwitch2.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetSwitch2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch2.DisabledCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch2.DisabledUnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch2.IsDerivedStyle = true; this._metroSetSwitch2.Location = new System.Drawing.Point(635, 134); this._metroSetSwitch2.Name = "_metroSetSwitch2"; this._metroSetSwitch2.Size = new System.Drawing.Size(58, 22); this._metroSetSwitch2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSwitch2.StyleManager = this.styleManager1; this._metroSetSwitch2.Switched = true; this._metroSetSwitch2.SymbolColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); this._metroSetSwitch2.TabIndex = 7; this._metroSetSwitch2.Text = "_metroSetSwitch1"; this._metroSetSwitch2.ThemeAuthor = "Narwin"; this._metroSetSwitch2.ThemeName = "MetroLite"; this._metroSetSwitch2.UnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetSwitch2.SwitchedChanged += new MetroSet_UI.Controls.MetroSetSwitch.SwitchedChangedEventHandler(this.MetroSetSwitch2_SwitchedChanged); // // _metroSetSwitch1 // this._metroSetSwitch1.BackColor = System.Drawing.Color.Transparent; this._metroSetSwitch1.BackgroundColor = System.Drawing.Color.Empty; this._metroSetSwitch1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(165)))), ((int)(((byte)(159)))), ((int)(((byte)(147))))); this._metroSetSwitch1.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch1.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetSwitch1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetSwitch1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch1.DisabledCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetSwitch1.DisabledUnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetSwitch1.IsDerivedStyle = true; this._metroSetSwitch1.Location = new System.Drawing.Point(635, 99); this._metroSetSwitch1.Name = "_metroSetSwitch1"; this._metroSetSwitch1.Size = new System.Drawing.Size(58, 22); this._metroSetSwitch1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSwitch1.StyleManager = this.styleManager1; this._metroSetSwitch1.Switched = false; this._metroSetSwitch1.SymbolColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); this._metroSetSwitch1.TabIndex = 7; this._metroSetSwitch1.Text = "_metroSetSwitch1"; this._metroSetSwitch1.ThemeAuthor = "Narwin"; this._metroSetSwitch1.ThemeName = "MetroLite"; this._metroSetSwitch1.UnCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); // // _metroSetLabel12 // this._metroSetLabel12.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel12.IsDerivedStyle = true; this._metroSetLabel12.Location = new System.Drawing.Point(635, 55); this._metroSetLabel12.Name = "_metroSetLabel12"; this._metroSetLabel12.Size = new System.Drawing.Size(130, 23); this._metroSetLabel12.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel12.StyleManager = this.styleManager1; this._metroSetLabel12.TabIndex = 6; this._metroSetLabel12.Text = "Switches"; this._metroSetLabel12.ThemeAuthor = "Narwin"; this._metroSetLabel12.ThemeName = "MetroLite"; // // _metroSetRadioButton4 // this._metroSetRadioButton4.BackgroundColor = System.Drawing.Color.White; this._metroSetRadioButton4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRadioButton4.Checked = true; this._metroSetRadioButton4.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetRadioButton4.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetRadioButton4.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetRadioButton4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetRadioButton4.Enabled = false; this._metroSetRadioButton4.Font = new System.Drawing.Font("Segoe UI", 10F); this._metroSetRadioButton4.Group = 0; this._metroSetRadioButton4.IsDerivedStyle = true; this._metroSetRadioButton4.Location = new System.Drawing.Point(305, 219); this._metroSetRadioButton4.Name = "_metroSetRadioButton4"; this._metroSetRadioButton4.Size = new System.Drawing.Size(145, 17); this._metroSetRadioButton4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetRadioButton4.StyleManager = this.styleManager1; this._metroSetRadioButton4.TabIndex = 5; this._metroSetRadioButton4.Text = "Disabled Checked"; this._metroSetRadioButton4.ThemeAuthor = "Narwin"; this._metroSetRadioButton4.ThemeName = "MetroLite"; // // _metroSetRadioButton3 // this._metroSetRadioButton3.BackgroundColor = System.Drawing.Color.White; this._metroSetRadioButton3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRadioButton3.Checked = true; this._metroSetRadioButton3.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetRadioButton3.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetRadioButton3.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetRadioButton3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetRadioButton3.Font = new System.Drawing.Font("Segoe UI", 10F); this._metroSetRadioButton3.Group = 0; this._metroSetRadioButton3.IsDerivedStyle = true; this._metroSetRadioButton3.Location = new System.Drawing.Point(305, 139); this._metroSetRadioButton3.Name = "_metroSetRadioButton3"; this._metroSetRadioButton3.Size = new System.Drawing.Size(145, 17); this._metroSetRadioButton3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetRadioButton3.StyleManager = this.styleManager1; this._metroSetRadioButton3.TabIndex = 5; this._metroSetRadioButton3.Text = "Normal Checked"; this._metroSetRadioButton3.ThemeAuthor = "Narwin"; this._metroSetRadioButton3.ThemeName = "MetroLite"; // // _metroSetRadioButton2 // this._metroSetRadioButton2.BackgroundColor = System.Drawing.Color.White; this._metroSetRadioButton2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRadioButton2.Checked = false; this._metroSetRadioButton2.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetRadioButton2.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetRadioButton2.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetRadioButton2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetRadioButton2.Enabled = false; this._metroSetRadioButton2.Font = new System.Drawing.Font("Segoe UI", 10F); this._metroSetRadioButton2.Group = 0; this._metroSetRadioButton2.IsDerivedStyle = true; this._metroSetRadioButton2.Location = new System.Drawing.Point(305, 179); this._metroSetRadioButton2.Name = "_metroSetRadioButton2"; this._metroSetRadioButton2.Size = new System.Drawing.Size(145, 17); this._metroSetRadioButton2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetRadioButton2.StyleManager = this.styleManager1; this._metroSetRadioButton2.TabIndex = 5; this._metroSetRadioButton2.Text = "Disabled Unchecked"; this._metroSetRadioButton2.ThemeAuthor = "Narwin"; this._metroSetRadioButton2.ThemeName = "MetroLite"; // // _metroSetRadioButton1 // this._metroSetRadioButton1.BackgroundColor = System.Drawing.Color.White; this._metroSetRadioButton1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetRadioButton1.Checked = false; this._metroSetRadioButton1.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetRadioButton1.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetRadioButton1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetRadioButton1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetRadioButton1.Font = new System.Drawing.Font("Segoe UI", 10F); this._metroSetRadioButton1.Group = 0; this._metroSetRadioButton1.IsDerivedStyle = true; this._metroSetRadioButton1.Location = new System.Drawing.Point(305, 99); this._metroSetRadioButton1.Name = "_metroSetRadioButton1"; this._metroSetRadioButton1.Size = new System.Drawing.Size(145, 17); this._metroSetRadioButton1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetRadioButton1.StyleManager = this.styleManager1; this._metroSetRadioButton1.TabIndex = 5; this._metroSetRadioButton1.Text = "Normal Unchecked"; this._metroSetRadioButton1.ThemeAuthor = "Narwin"; this._metroSetRadioButton1.ThemeName = "MetroLite"; // // _metroSetCheckBox5 // this._metroSetCheckBox5.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox5.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox5.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox5.Checked = true; this._metroSetCheckBox5.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox5.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetCheckBox5.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox5.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox5.Enabled = false; this._metroSetCheckBox5.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox5.IsDerivedStyle = true; this._metroSetCheckBox5.Location = new System.Drawing.Point(15, 300); this._metroSetCheckBox5.Name = "_metroSetCheckBox5"; this._metroSetCheckBox5.SignStyle = MetroSet_UI.Enums.SignStyle.Shape; this._metroSetCheckBox5.Size = new System.Drawing.Size(197, 16); this._metroSetCheckBox5.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox5.StyleManager = this.styleManager1; this._metroSetCheckBox5.TabIndex = 4; this._metroSetCheckBox5.Text = "Disabled Checked With Shape"; this._metroSetCheckBox5.ThemeAuthor = "Narwin"; this._metroSetCheckBox5.ThemeName = "MetroLite"; // // _metroSetCheckBox4 // this._metroSetCheckBox4.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox4.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox4.Checked = true; this._metroSetCheckBox4.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox4.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetCheckBox4.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox4.Enabled = false; this._metroSetCheckBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox4.IsDerivedStyle = true; this._metroSetCheckBox4.Location = new System.Drawing.Point(15, 260); this._metroSetCheckBox4.Name = "_metroSetCheckBox4"; this._metroSetCheckBox4.SignStyle = MetroSet_UI.Enums.SignStyle.Sign; this._metroSetCheckBox4.Size = new System.Drawing.Size(187, 16); this._metroSetCheckBox4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox4.StyleManager = this.styleManager1; this._metroSetCheckBox4.TabIndex = 4; this._metroSetCheckBox4.Text = "Disabled Checked With Tick"; this._metroSetCheckBox4.ThemeAuthor = "Narwin"; this._metroSetCheckBox4.ThemeName = "MetroLite"; // // _metroSetCheckBox3 // this._metroSetCheckBox3.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox3.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox3.Checked = true; this._metroSetCheckBox3.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox3.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetCheckBox3.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox3.IsDerivedStyle = true; this._metroSetCheckBox3.Location = new System.Drawing.Point(15, 180); this._metroSetCheckBox3.Name = "_metroSetCheckBox3"; this._metroSetCheckBox3.SignStyle = MetroSet_UI.Enums.SignStyle.Shape; this._metroSetCheckBox3.Size = new System.Drawing.Size(197, 16); this._metroSetCheckBox3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox3.StyleManager = this.styleManager1; this._metroSetCheckBox3.TabIndex = 4; this._metroSetCheckBox3.Text = "Normal Checked With Shape"; this._metroSetCheckBox3.ThemeAuthor = "Narwin"; this._metroSetCheckBox3.ThemeName = "MetroLite"; // // _metroSetCheckBox2 // this._metroSetCheckBox2.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox2.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox2.Checked = true; this._metroSetCheckBox2.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox2.CheckState = MetroSet_UI.Enums.CheckState.Checked; this._metroSetCheckBox2.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox2.IsDerivedStyle = true; this._metroSetCheckBox2.Location = new System.Drawing.Point(15, 140); this._metroSetCheckBox2.Name = "_metroSetCheckBox2"; this._metroSetCheckBox2.SignStyle = MetroSet_UI.Enums.SignStyle.Sign; this._metroSetCheckBox2.Size = new System.Drawing.Size(187, 16); this._metroSetCheckBox2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox2.StyleManager = this.styleManager1; this._metroSetCheckBox2.TabIndex = 4; this._metroSetCheckBox2.Text = "Normal Checked With Tick"; this._metroSetCheckBox2.ThemeAuthor = "Narwin"; this._metroSetCheckBox2.ThemeName = "MetroLite"; // // _metroSetCheckBox6 // this._metroSetCheckBox6.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox6.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox6.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox6.Checked = false; this._metroSetCheckBox6.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox6.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetCheckBox6.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox6.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox6.Enabled = false; this._metroSetCheckBox6.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox6.IsDerivedStyle = true; this._metroSetCheckBox6.Location = new System.Drawing.Point(15, 220); this._metroSetCheckBox6.Name = "_metroSetCheckBox6"; this._metroSetCheckBox6.SignStyle = MetroSet_UI.Enums.SignStyle.Sign; this._metroSetCheckBox6.Size = new System.Drawing.Size(148, 16); this._metroSetCheckBox6.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox6.StyleManager = this.styleManager1; this._metroSetCheckBox6.TabIndex = 4; this._metroSetCheckBox6.Text = "Disabled Unchecked"; this._metroSetCheckBox6.ThemeAuthor = "Narwin"; this._metroSetCheckBox6.ThemeName = "MetroLite"; // // _metroSetCheckBox1 // this._metroSetCheckBox1.BackColor = System.Drawing.Color.Transparent; this._metroSetCheckBox1.BackgroundColor = System.Drawing.Color.White; this._metroSetCheckBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetCheckBox1.Checked = false; this._metroSetCheckBox1.CheckSignColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetCheckBox1.CheckState = MetroSet_UI.Enums.CheckState.Unchecked; this._metroSetCheckBox1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetCheckBox1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetCheckBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetCheckBox1.IsDerivedStyle = true; this._metroSetCheckBox1.Location = new System.Drawing.Point(15, 100); this._metroSetCheckBox1.Name = "_metroSetCheckBox1"; this._metroSetCheckBox1.SignStyle = MetroSet_UI.Enums.SignStyle.Sign; this._metroSetCheckBox1.Size = new System.Drawing.Size(148, 16); this._metroSetCheckBox1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetCheckBox1.StyleManager = this.styleManager1; this._metroSetCheckBox1.TabIndex = 4; this._metroSetCheckBox1.Text = "Normal Unchecked"; this._metroSetCheckBox1.ThemeAuthor = "Narwin"; this._metroSetCheckBox1.ThemeName = "MetroLite"; // // _metroSetLabel11 // this._metroSetLabel11.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel11.IsDerivedStyle = true; this._metroSetLabel11.Location = new System.Drawing.Point(305, 55); this._metroSetLabel11.Name = "_metroSetLabel11"; this._metroSetLabel11.Size = new System.Drawing.Size(145, 23); this._metroSetLabel11.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel11.StyleManager = this.styleManager1; this._metroSetLabel11.TabIndex = 3; this._metroSetLabel11.Text = "Normal RadioButton"; this._metroSetLabel11.ThemeAuthor = "Narwin"; this._metroSetLabel11.ThemeName = "MetroLite"; // // _metroSetLabel10 // this._metroSetLabel10.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel10.IsDerivedStyle = true; this._metroSetLabel10.Location = new System.Drawing.Point(15, 55); this._metroSetLabel10.Name = "_metroSetLabel10"; this._metroSetLabel10.Size = new System.Drawing.Size(130, 23); this._metroSetLabel10.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel10.StyleManager = this.styleManager1; this._metroSetLabel10.TabIndex = 3; this._metroSetLabel10.Text = "Normal CheckBox"; this._metroSetLabel10.ThemeAuthor = "Narwin"; this._metroSetLabel10.ThemeName = "MetroLite"; // // _metroSetSetTabPage5 // this._metroSetSetTabPage5.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage5.Controls.Add(this._metroSetTrackBar2); this._metroSetSetTabPage5.Controls.Add(this._metroSetTrackBar1); this._metroSetSetTabPage5.Controls.Add(this._metroSetProgressBar4); this._metroSetSetTabPage5.Controls.Add(this._metroSetProgressBar3); this._metroSetSetTabPage5.Controls.Add(this._metroSetLabel14); this._metroSetSetTabPage5.Controls.Add(this._metroSetLabel15); this._metroSetSetTabPage5.Controls.Add(this._metroSetLabel13); this._metroSetSetTabPage5.Controls.Add(this._metroSetProgressBar2); this._metroSetSetTabPage5.Controls.Add(this._metroSetProgressBar1); this._metroSetSetTabPage5.Font = null; this._metroSetSetTabPage5.ImageIndex = 0; this._metroSetSetTabPage5.ImageKey = null; this._metroSetSetTabPage5.IsDerivedStyle = true; this._metroSetSetTabPage5.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage5.Name = "_metroSetSetTabPage5"; this._metroSetSetTabPage5.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage5.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage5.StyleManager = this.styleManager1; this._metroSetSetTabPage5.TabIndex = 4; this._metroSetSetTabPage5.Text = "Progress"; this._metroSetSetTabPage5.ThemeAuthor = "Narwin"; this._metroSetSetTabPage5.ThemeName = "MetroLite"; this._metroSetSetTabPage5.ToolTipText = null; // // _metroSetTrackBar2 // this._metroSetTrackBar2.BackColor = System.Drawing.Color.Transparent; this._metroSetTrackBar2.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetTrackBar2.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetTrackBar2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this._metroSetTrackBar2.DisabledBorderColor = System.Drawing.Color.Empty; this._metroSetTrackBar2.DisabledHandlerColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); this._metroSetTrackBar2.DisabledValueColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetTrackBar2.Enabled = false; this._metroSetTrackBar2.HandlerColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); this._metroSetTrackBar2.IsDerivedStyle = true; this._metroSetTrackBar2.Location = new System.Drawing.Point(494, 147); this._metroSetTrackBar2.Maximum = 100; this._metroSetTrackBar2.Minimum = 0; this._metroSetTrackBar2.Name = "_metroSetTrackBar2"; this._metroSetTrackBar2.Size = new System.Drawing.Size(241, 16); this._metroSetTrackBar2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTrackBar2.StyleManager = this.styleManager1; this._metroSetTrackBar2.TabIndex = 4; this._metroSetTrackBar2.Text = "_metroSetTrackBar1"; this._metroSetTrackBar2.ThemeAuthor = "Narwin"; this._metroSetTrackBar2.ThemeName = "MetroLite"; this._metroSetTrackBar2.Value = 45; this._metroSetTrackBar2.ValueColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); // // _metroSetTrackBar1 // this._metroSetTrackBar1.BackColor = System.Drawing.Color.Transparent; this._metroSetTrackBar1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetTrackBar1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetTrackBar1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this._metroSetTrackBar1.DisabledBorderColor = System.Drawing.Color.Empty; this._metroSetTrackBar1.DisabledHandlerColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); this._metroSetTrackBar1.DisabledValueColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(205)))), ((int)(((byte)(205))))); this._metroSetTrackBar1.HandlerColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); this._metroSetTrackBar1.IsDerivedStyle = true; this._metroSetTrackBar1.Location = new System.Drawing.Point(494, 102); this._metroSetTrackBar1.Maximum = 100; this._metroSetTrackBar1.Minimum = 0; this._metroSetTrackBar1.Name = "_metroSetTrackBar1"; this._metroSetTrackBar1.Size = new System.Drawing.Size(241, 16); this._metroSetTrackBar1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetTrackBar1.StyleManager = this.styleManager1; this._metroSetTrackBar1.TabIndex = 4; this._metroSetTrackBar1.Text = "_metroSetTrackBar1"; this._metroSetTrackBar1.ThemeAuthor = "Narwin"; this._metroSetTrackBar1.ThemeName = "MetroLite"; this._metroSetTrackBar1.Value = 75; this._metroSetTrackBar1.ValueColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); // // _metroSetProgressBar4 // this._metroSetProgressBar4.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar4.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar4.DisabledProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar4.Enabled = false; this._metroSetProgressBar4.IsDerivedStyle = true; this._metroSetProgressBar4.Location = new System.Drawing.Point(144, 289); this._metroSetProgressBar4.Maximum = 100; this._metroSetProgressBar4.Minimum = 0; this._metroSetProgressBar4.Name = "_metroSetProgressBar4"; this._metroSetProgressBar4.Orientation = MetroSet_UI.Enums.ProgressOrientation.Vertical; this._metroSetProgressBar4.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar4.Size = new System.Drawing.Size(30, 211); this._metroSetProgressBar4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetProgressBar4.StyleManager = this.styleManager1; this._metroSetProgressBar4.TabIndex = 3; this._metroSetProgressBar4.Text = "_metroSetProgressBar3"; this._metroSetProgressBar4.ThemeAuthor = "Narwin"; this._metroSetProgressBar4.ThemeName = "MetroLite"; this._metroSetProgressBar4.Value = 30; // // _metroSetProgressBar3 // this._metroSetProgressBar3.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar3.DisabledProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar3.IsDerivedStyle = true; this._metroSetProgressBar3.Location = new System.Drawing.Point(15, 289); this._metroSetProgressBar3.Maximum = 100; this._metroSetProgressBar3.Minimum = 0; this._metroSetProgressBar3.Name = "_metroSetProgressBar3"; this._metroSetProgressBar3.Orientation = MetroSet_UI.Enums.ProgressOrientation.Vertical; this._metroSetProgressBar3.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar3.Size = new System.Drawing.Size(30, 211); this._metroSetProgressBar3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetProgressBar3.StyleManager = this.styleManager1; this._metroSetProgressBar3.TabIndex = 3; this._metroSetProgressBar3.Text = "_metroSetProgressBar3"; this._metroSetProgressBar3.ThemeAuthor = "Narwin"; this._metroSetProgressBar3.ThemeName = "MetroLite"; this._metroSetProgressBar3.Value = 70; // // _metroSetLabel14 // this._metroSetLabel14.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel14.IsDerivedStyle = true; this._metroSetLabel14.Location = new System.Drawing.Point(15, 209); this._metroSetLabel14.Name = "_metroSetLabel14"; this._metroSetLabel14.Size = new System.Drawing.Size(159, 23); this._metroSetLabel14.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel14.StyleManager = this.styleManager1; this._metroSetLabel14.TabIndex = 2; this._metroSetLabel14.Text = "Vertical ProgressBar"; this._metroSetLabel14.ThemeAuthor = "Narwin"; this._metroSetLabel14.ThemeName = "MetroLite"; // // _metroSetLabel15 // this._metroSetLabel15.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel15.IsDerivedStyle = true; this._metroSetLabel15.Location = new System.Drawing.Point(494, 59); this._metroSetLabel15.Name = "_metroSetLabel15"; this._metroSetLabel15.Size = new System.Drawing.Size(159, 23); this._metroSetLabel15.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel15.StyleManager = this.styleManager1; this._metroSetLabel15.TabIndex = 2; this._metroSetLabel15.Text = "Horizontal ProgressBar"; this._metroSetLabel15.ThemeAuthor = "Narwin"; this._metroSetLabel15.ThemeName = "MetroLite"; // // _metroSetLabel13 // this._metroSetLabel13.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel13.IsDerivedStyle = true; this._metroSetLabel13.Location = new System.Drawing.Point(15, 59); this._metroSetLabel13.Name = "_metroSetLabel13"; this._metroSetLabel13.Size = new System.Drawing.Size(159, 23); this._metroSetLabel13.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel13.StyleManager = this.styleManager1; this._metroSetLabel13.TabIndex = 2; this._metroSetLabel13.Text = "Horizontal ProgressBar"; this._metroSetLabel13.ThemeAuthor = "Narwin"; this._metroSetLabel13.ThemeName = "MetroLite"; // // _metroSetProgressBar2 // this._metroSetProgressBar2.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar2.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar2.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar2.DisabledProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar2.Enabled = false; this._metroSetProgressBar2.IsDerivedStyle = true; this._metroSetProgressBar2.Location = new System.Drawing.Point(15, 147); this._metroSetProgressBar2.Maximum = 100; this._metroSetProgressBar2.Minimum = 0; this._metroSetProgressBar2.Name = "_metroSetProgressBar2"; this._metroSetProgressBar2.Orientation = MetroSet_UI.Enums.ProgressOrientation.Horizontal; this._metroSetProgressBar2.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar2.Size = new System.Drawing.Size(323, 23); this._metroSetProgressBar2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetProgressBar2.StyleManager = this.styleManager1; this._metroSetProgressBar2.TabIndex = 0; this._metroSetProgressBar2.Text = "_metroSetProgressBar1"; this._metroSetProgressBar2.ThemeAuthor = "Narwin"; this._metroSetProgressBar2.ThemeName = "MetroLite"; this._metroSetProgressBar2.Value = 40; // // _metroSetProgressBar1 // this._metroSetProgressBar1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar1.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar1.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetProgressBar1.DisabledProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar1.IsDerivedStyle = true; this._metroSetProgressBar1.Location = new System.Drawing.Point(15, 102); this._metroSetProgressBar1.Maximum = 100; this._metroSetProgressBar1.Minimum = 0; this._metroSetProgressBar1.Name = "_metroSetProgressBar1"; this._metroSetProgressBar1.Orientation = MetroSet_UI.Enums.ProgressOrientation.Horizontal; this._metroSetProgressBar1.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(177)))), ((int)(((byte)(225))))); this._metroSetProgressBar1.Size = new System.Drawing.Size(323, 23); this._metroSetProgressBar1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetProgressBar1.StyleManager = this.styleManager1; this._metroSetProgressBar1.TabIndex = 0; this._metroSetProgressBar1.Text = "_metroSetProgressBar1"; this._metroSetProgressBar1.ThemeAuthor = "Narwin"; this._metroSetProgressBar1.ThemeName = "MetroLite"; this._metroSetProgressBar1.Value = 60; // // _metroSetSetTabPage6 // this._metroSetSetTabPage6.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage6.Controls.Add(this._metroSetLink2); this._metroSetSetTabPage6.Controls.Add(this._metroSetLink1); this._metroSetSetTabPage6.Controls.Add(this._metroSetLabel17); this._metroSetSetTabPage6.Controls.Add(this._metroSetLabel16); this._metroSetSetTabPage6.Font = null; this._metroSetSetTabPage6.ImageIndex = 0; this._metroSetSetTabPage6.ImageKey = null; this._metroSetSetTabPage6.IsDerivedStyle = true; this._metroSetSetTabPage6.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage6.Name = "_metroSetSetTabPage6"; this._metroSetSetTabPage6.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage6.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage6.StyleManager = this.styleManager1; this._metroSetSetTabPage6.TabIndex = 5; this._metroSetSetTabPage6.Text = "Labels"; this._metroSetSetTabPage6.ThemeAuthor = "Narwin"; this._metroSetSetTabPage6.ThemeName = "MetroLite"; this._metroSetSetTabPage6.ToolTipText = null; // // _metroSetLink2 // this._metroSetLink2.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetLink2.Enabled = false; this._metroSetLink2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLink2.IsDerivedStyle = true; this._metroSetLink2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this._metroSetLink2.Location = new System.Drawing.Point(309, 110); this._metroSetLink2.Name = "_metroSetLink2"; this._metroSetLink2.Size = new System.Drawing.Size(100, 23); this._metroSetLink2.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLink2.StyleManager = this.styleManager1; this._metroSetLink2.TabIndex = 5; this._metroSetLink2.TabStop = true; this._metroSetLink2.Text = "Disabled Link"; this._metroSetLink2.ThemeAuthor = "Narwin"; this._metroSetLink2.ThemeName = "MetroLite"; this._metroSetLink2.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(157)))), ((int)(((byte)(205))))); // // _metroSetLink1 // this._metroSetLink1.Cursor = System.Windows.Forms.Cursors.Hand; this._metroSetLink1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLink1.IsDerivedStyle = true; this._metroSetLink1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this._metroSetLink1.Location = new System.Drawing.Point(309, 59); this._metroSetLink1.Name = "_metroSetLink1"; this._metroSetLink1.Size = new System.Drawing.Size(100, 23); this._metroSetLink1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLink1.StyleManager = this.styleManager1; this._metroSetLink1.TabIndex = 5; this._metroSetLink1.TabStop = true; this._metroSetLink1.Text = "Normal Link"; this._metroSetLink1.ThemeAuthor = "Narwin"; this._metroSetLink1.ThemeName = "MetroLite"; this._metroSetLink1.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(157)))), ((int)(((byte)(205))))); // // _metroSetLabel17 // this._metroSetLabel17.Enabled = false; this._metroSetLabel17.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel17.IsDerivedStyle = true; this._metroSetLabel17.Location = new System.Drawing.Point(15, 110); this._metroSetLabel17.Name = "_metroSetLabel17"; this._metroSetLabel17.Size = new System.Drawing.Size(108, 23); this._metroSetLabel17.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel17.StyleManager = this.styleManager1; this._metroSetLabel17.TabIndex = 3; this._metroSetLabel17.Text = "Disabled Label"; this._metroSetLabel17.ThemeAuthor = "Narwin"; this._metroSetLabel17.ThemeName = "MetroLite"; // // _metroSetLabel16 // this._metroSetLabel16.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel16.IsDerivedStyle = true; this._metroSetLabel16.Location = new System.Drawing.Point(15, 59); this._metroSetLabel16.Name = "_metroSetLabel16"; this._metroSetLabel16.Size = new System.Drawing.Size(100, 23); this._metroSetLabel16.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel16.StyleManager = this.styleManager1; this._metroSetLabel16.TabIndex = 4; this._metroSetLabel16.Text = "Normal Label"; this._metroSetLabel16.ThemeAuthor = "Narwin"; this._metroSetLabel16.ThemeName = "MetroLite"; // // _metroSetSetTabPage7 // this._metroSetSetTabPage7.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage7.Controls.Add(this._metroSetButton7); this._metroSetSetTabPage7.Controls.Add(this._metroSetButton6); this._metroSetSetTabPage7.Controls.Add(this._metroSetButton5); this._metroSetSetTabPage7.Controls.Add(this._metroSetButton4); this._metroSetSetTabPage7.Controls.Add(this._metroSetButton3); this._metroSetSetTabPage7.Controls.Add(this._metroSetLabel18); this._metroSetSetTabPage7.Font = null; this._metroSetSetTabPage7.ImageIndex = 0; this._metroSetSetTabPage7.ImageKey = null; this._metroSetSetTabPage7.IsDerivedStyle = true; this._metroSetSetTabPage7.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage7.Name = "_metroSetSetTabPage7"; this._metroSetSetTabPage7.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage7.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage7.StyleManager = this.styleManager1; this._metroSetSetTabPage7.TabIndex = 6; this._metroSetSetTabPage7.Text = "Message"; this._metroSetSetTabPage7.ThemeAuthor = "Narwin"; this._metroSetSetTabPage7.ThemeName = "MetroLite"; this._metroSetSetTabPage7.ToolTipText = null; // // _metroSetButton7 // this._metroSetButton7.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton7.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetButton7.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetButton7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton7.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton7.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton7.HoverTextColor = System.Drawing.Color.White; this._metroSetButton7.IsDerivedStyle = true; this._metroSetButton7.Location = new System.Drawing.Point(506, 111); this._metroSetButton7.Name = "_metroSetButton7"; this._metroSetButton7.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton7.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetButton7.NormalTextColor = System.Drawing.Color.Black; this._metroSetButton7.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton7.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton7.PressTextColor = System.Drawing.Color.White; this._metroSetButton7.Size = new System.Drawing.Size(167, 40); this._metroSetButton7.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton7.StyleManager = this.styleManager1; this._metroSetButton7.TabIndex = 2; this._metroSetButton7.Text = "Question Message"; this._metroSetButton7.ThemeAuthor = "Narwin"; this._metroSetButton7.ThemeName = "MetroLite"; this._metroSetButton7.Click += new System.EventHandler(this.MetroSetButton7_Click_1); // // _metroSetButton6 // this._metroSetButton6.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton6.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetButton6.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetButton6.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton6.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton6.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton6.HoverTextColor = System.Drawing.Color.White; this._metroSetButton6.IsDerivedStyle = true; this._metroSetButton6.Location = new System.Drawing.Point(258, 183); this._metroSetButton6.Name = "_metroSetButton6"; this._metroSetButton6.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton6.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetButton6.NormalTextColor = System.Drawing.Color.Black; this._metroSetButton6.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton6.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton6.PressTextColor = System.Drawing.Color.White; this._metroSetButton6.Size = new System.Drawing.Size(167, 40); this._metroSetButton6.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton6.StyleManager = this.styleManager1; this._metroSetButton6.TabIndex = 1; this._metroSetButton6.Text = "Warning Message"; this._metroSetButton6.ThemeAuthor = "Narwin"; this._metroSetButton6.ThemeName = "MetroLite"; this._metroSetButton6.Click += new System.EventHandler(this.MetroSetButton6_Click); // // _metroSetButton5 // this._metroSetButton5.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton5.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetButton5.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetButton5.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton5.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton5.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton5.HoverTextColor = System.Drawing.Color.White; this._metroSetButton5.IsDerivedStyle = true; this._metroSetButton5.Location = new System.Drawing.Point(258, 111); this._metroSetButton5.Name = "_metroSetButton5"; this._metroSetButton5.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton5.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetButton5.NormalTextColor = System.Drawing.Color.Black; this._metroSetButton5.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton5.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton5.PressTextColor = System.Drawing.Color.White; this._metroSetButton5.Size = new System.Drawing.Size(167, 40); this._metroSetButton5.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton5.StyleManager = this.styleManager1; this._metroSetButton5.TabIndex = 1; this._metroSetButton5.Text = "Info Message"; this._metroSetButton5.ThemeAuthor = "Narwin"; this._metroSetButton5.ThemeName = "MetroLite"; this._metroSetButton5.Click += new System.EventHandler(this.MetroSetButton5_Click); // // _metroSetButton4 // this._metroSetButton4.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton4.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetButton4.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetButton4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton4.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton4.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton4.HoverTextColor = System.Drawing.Color.White; this._metroSetButton4.IsDerivedStyle = true; this._metroSetButton4.Location = new System.Drawing.Point(15, 183); this._metroSetButton4.Name = "_metroSetButton4"; this._metroSetButton4.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton4.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetButton4.NormalTextColor = System.Drawing.Color.Black; this._metroSetButton4.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton4.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton4.PressTextColor = System.Drawing.Color.White; this._metroSetButton4.Size = new System.Drawing.Size(167, 40); this._metroSetButton4.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton4.StyleManager = this.styleManager1; this._metroSetButton4.TabIndex = 1; this._metroSetButton4.Text = "Stop Message"; this._metroSetButton4.ThemeAuthor = "Narwin"; this._metroSetButton4.ThemeName = "MetroLite"; this._metroSetButton4.Click += new System.EventHandler(this.MetroSetButton4_Click); // // _metroSetButton3 // this._metroSetButton3.DisabledBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton3.DisabledBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155))))); this._metroSetButton3.DisabledForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); this._metroSetButton3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetButton3.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton3.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this._metroSetButton3.HoverTextColor = System.Drawing.Color.White; this._metroSetButton3.IsDerivedStyle = true; this._metroSetButton3.Location = new System.Drawing.Point(15, 111); this._metroSetButton3.Name = "_metroSetButton3"; this._metroSetButton3.NormalBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetButton3.NormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetButton3.NormalTextColor = System.Drawing.Color.Black; this._metroSetButton3.PressBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton3.PressColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this._metroSetButton3.PressTextColor = System.Drawing.Color.White; this._metroSetButton3.Size = new System.Drawing.Size(167, 40); this._metroSetButton3.Style = MetroSet_UI.Enums.Style.Light; this._metroSetButton3.StyleManager = this.styleManager1; this._metroSetButton3.TabIndex = 1; this._metroSetButton3.Text = "Normal Message"; this._metroSetButton3.ThemeAuthor = "Narwin"; this._metroSetButton3.ThemeName = "MetroLite"; this._metroSetButton3.Click += new System.EventHandler(this.MetroSetButton3_Click); // // _metroSetLabel18 // this._metroSetLabel18.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this._metroSetLabel18.IsDerivedStyle = true; this._metroSetLabel18.Location = new System.Drawing.Point(15, 59); this._metroSetLabel18.Name = "_metroSetLabel18"; this._metroSetLabel18.Size = new System.Drawing.Size(100, 23); this._metroSetLabel18.Style = MetroSet_UI.Enums.Style.Light; this._metroSetLabel18.StyleManager = this.styleManager1; this._metroSetLabel18.TabIndex = 0; this._metroSetLabel18.Text = "MessageBox"; this._metroSetLabel18.ThemeAuthor = "Narwin"; this._metroSetLabel18.ThemeName = "MetroLite"; // // _metroSetSetTabPage8 // this._metroSetSetTabPage8.BaseColor = System.Drawing.Color.White; this._metroSetSetTabPage8.Font = null; this._metroSetSetTabPage8.ImageIndex = 0; this._metroSetSetTabPage8.ImageKey = null; this._metroSetSetTabPage8.IsDerivedStyle = true; this._metroSetSetTabPage8.Location = new System.Drawing.Point(4, 42); this._metroSetSetTabPage8.Name = "_metroSetSetTabPage8"; this._metroSetSetTabPage8.Size = new System.Drawing.Size(1106, 570); this._metroSetSetTabPage8.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetTabPage8.StyleManager = null; this._metroSetSetTabPage8.TabIndex = 8; this._metroSetSetTabPage8.Text = "DataGrid"; this._metroSetSetTabPage8.ThemeAuthor = "Narwin"; this._metroSetSetTabPage8.ThemeName = "MetroLite"; this._metroSetSetTabPage8.ToolTipText = null; // // _metroSetControlBox1 // this._metroSetControlBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._metroSetControlBox1.BackColor = System.Drawing.Color.Transparent; this._metroSetControlBox1.CloseHoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(183)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); this._metroSetControlBox1.CloseHoverForeColor = System.Drawing.Color.White; this._metroSetControlBox1.CloseNormalForeColor = System.Drawing.Color.Gray; this._metroSetControlBox1.DisabledForeColor = System.Drawing.Color.DimGray; this._metroSetControlBox1.IsDerivedStyle = true; this._metroSetControlBox1.Location = new System.Drawing.Point(1026, 13); this._metroSetControlBox1.MaximizeBox = true; this._metroSetControlBox1.MaximizeHoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetControlBox1.MaximizeHoverForeColor = System.Drawing.Color.Gray; this._metroSetControlBox1.MaximizeNormalForeColor = System.Drawing.Color.Gray; this._metroSetControlBox1.MinimizeBox = true; this._metroSetControlBox1.MinimizeHoverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238))))); this._metroSetControlBox1.MinimizeHoverForeColor = System.Drawing.Color.Gray; this._metroSetControlBox1.MinimizeNormalForeColor = System.Drawing.Color.Gray; this._metroSetControlBox1.Name = "_metroSetControlBox1"; this._metroSetControlBox1.Size = new System.Drawing.Size(100, 25); this._metroSetControlBox1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetControlBox1.StyleManager = this.styleManager1; this._metroSetControlBox1.TabIndex = 1; this._metroSetControlBox1.Text = "_metroSetControlBox1"; this._metroSetControlBox1.ThemeAuthor = "Narwin"; this._metroSetControlBox1.ThemeName = "MetroLite"; // // _metroSetSetToolTip1 // this._metroSetSetToolTip1.BackColor = System.Drawing.Color.White; this._metroSetSetToolTip1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204))))); this._metroSetSetToolTip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(170)))), ((int)(((byte)(170))))); this._metroSetSetToolTip1.IsDerivedStyle = true; this._metroSetSetToolTip1.OwnerDraw = true; this._metroSetSetToolTip1.Style = MetroSet_UI.Enums.Style.Light; this._metroSetSetToolTip1.StyleManager = null; this._metroSetSetToolTip1.ThemeAuthor = "Narwin"; this._metroSetSetToolTip1.ThemeName = "MetroLite"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1138, 698); this.Controls.Add(this._metroSetControlBox1); this.Controls.Add(this._metroSetTabControl1); this.Name = "Form1"; this.SmallRectThickness = 2; this.StyleManager = this.styleManager1; this.Text = "METROSET UI"; this._metroSetTabControl1.ResumeLayout(false); this._metroSetSetTabPage2.ResumeLayout(false); this._metroSetSetTabPage1.ResumeLayout(false); this._metroSetSetTabPage3.ResumeLayout(false); this._metroSetContextMenuStrip1.ResumeLayout(false); this._metroSetSetTabPage4.ResumeLayout(false); this._metroSetSetTabPage5.ResumeLayout(false); this._metroSetSetTabPage6.ResumeLayout(false); this._metroSetSetTabPage7.ResumeLayout(false); this.ResumeLayout(false); } #endregion private MetroSet_UI.Controls.MetroSetTabControl _metroSetTabControl1; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage2; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage3; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage4; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage5; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage6; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage7; private MetroSet_UI.Controls.MetroSetControlBox _metroSetControlBox1; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetDefaultButton1; private MetroSet_UI.Controls.MetroSetBadge _metroSetBadge1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel2; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel1; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetDefaultButton2; private MetroSet_UI.Controls.MetroSetBadge _metroSetBadge2; private MetroSet_UI.Controls.MetroSetEllipse _metroSetEllipse3; private MetroSet_UI.Controls.MetroSetEllipse _metroSetEllipse2; private MetroSet_UI.Controls.MetroSetEllipse _metroSetEllipse1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel3; private MetroSet_UI.Controls.MetroSetTextBox _metroSetTextBox1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel5; private MetroSet_UI.Controls.MetroSetTextBox _metroSetTextBox2; private MetroSet_UI.Controls.MetroSetNumeric _metroSetNumeric2; private MetroSet_UI.Controls.MetroSetTextBox _metroSetTextBox3; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel6; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel7; private MetroSet_UI.Controls.MetroSetNumeric _metroSetNumeric3; private MetroSet_UI.Controls.MetroSetComboBox _metroSetComboBox2; private MetroSet_UI.Controls.MetroSetComboBox _metroSetComboBox1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel8; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel9; private MetroSet_UI.Controls.MetroSetListBox _metroSetListBox2; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox5; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox4; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox3; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox2; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel10; private MetroSet_UI.Controls.MetroSetCheckBox _metroSetCheckBox6; private MetroSet_UI.Controls.MetroSetRadioButton _metroSetRadioButton4; private MetroSet_UI.Controls.MetroSetRadioButton _metroSetRadioButton3; private MetroSet_UI.Controls.MetroSetRadioButton _metroSetRadioButton2; private MetroSet_UI.Controls.MetroSetRadioButton _metroSetRadioButton1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel11; private MetroSet_UI.Controls.MetroSetSwitch _metroSetSwitch3; private MetroSet_UI.Controls.MetroSetSwitch _metroSetSwitch2; private MetroSet_UI.Controls.MetroSetSwitch _metroSetSwitch1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel12; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel13; private MetroSet_UI.Controls.MetroSetProgressBar _metroSetProgressBar2; private MetroSet_UI.Controls.MetroSetProgressBar _metroSetProgressBar1; private MetroSet_UI.Controls.MetroSetProgressBar _metroSetProgressBar3; private MetroSet_UI.Controls.MetroSetProgressBar _metroSetProgressBar4; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel14; private MetroSet_UI.Controls.MetroSetTrackBar _metroSetTrackBar2; private MetroSet_UI.Controls.MetroSetTrackBar _metroSetTrackBar1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel15; private MetroSet_UI.Controls.MetroSetLink _metroSetLink2; private MetroSet_UI.Controls.MetroSetLink _metroSetLink1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel17; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel16; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetButton6; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetButton5; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetButton4; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetButton3; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel18; private MetroSet_UI.Controls.MetroSetDefaultButton _metroSetButton7; private MetroSet_UI.Controls.MetroSetSwitch _metroSetSwitch4; private MetroSet_UI.Controls.MetroSetTextBox _metroSetTextBox4; private MetroSet_UI.Controls.MetroSetButton _metroSetButton2; private MetroSet_UI.Controls.MetroSetButton _metroSetButton1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel19; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage1; private MetroSet_UI.Controls.MetroSetTile _metroSetTile4; private MetroSet_UI.Controls.MetroSetTile _metroSetTile2; private MetroSet_UI.Controls.MetroSetTile _metroSetTile3; private MetroSet_UI.Controls.MetroSetTile _metroSetTile1; private MetroSet_UI.Controls.MetroSetLabel _metroSetLabel4; private MetroSet_UI.Controls.MetroSetTile _metroSetTile8; private MetroSet_UI.Controls.MetroSetTile _metroSetTile7; private MetroSet_UI.Controls.MetroSetTile _metroSetTile6; private MetroSet_UI.Controls.MetroSetTile _metroSetTile5; private StyleManager styleManager1; private MetroSet_UI.Components.MetroSetSetToolTip _metroSetSetToolTip1; private MetroSet_UI.Controls.MetroSetContextMenuStrip _metroSetContextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem textBoxToolStripMenuItem; private MetroSet_UI.Controls.MetroSetRichTextBox _metroSetRichTextBox1; private MetroSet_UI.Child.MetroSetSetTabPage _metroSetSetTabPage8; } } ================================================ FILE: MetroSet UI Example/Form1.cs ================================================ using System; using System.Windows.Forms; using MetroSet_UI.Enums; using MetroSet_UI.Forms; namespace MetroSet_UI_Example { public partial class Form1 : MetroSetForm { public Form1() { InitializeComponent(); } private void MetroSetSwitch2_SwitchedChanged(object sender) { if (styleManager1.Style == Style.Light) { styleManager1.Style = Style.Dark; } else { styleManager1.Style = Style.Light; } } private void MetroSetButton3_Click(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "A new update available, do you want to update it now ?", "Available Update", MessageBoxButtons.YesNo); } private void MetroSetButton4_Click(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "A new update available, do you want to update it now ?", "Available Update", MessageBoxButtons.YesNo, MessageBoxIcon.Stop); } private void MetroSetButton5_Click(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "A new update available, do you want to update it now ?", "Available Update", MessageBoxButtons.YesNo, MessageBoxIcon.Information); } private void MetroSetButton6_Click(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "A new update available, do you want to update it now ?", "Available Update", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); } private void MetroSetButton7_Click_1(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "A new update available, do you want to update it now ?", "Available Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question); } private void MetroSetDefaultButton1_Click(object sender, EventArgs e) { styleManager1.OpenTheme(); } private void metroSetListBox2_SelectedIndexChanged(object sender) { MetroSetMessageBox.Show(this, _metroSetListBox2.SelectedText); } } } ================================================ FILE: MetroSet UI Example/Form1.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 356, 17 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 149, 17 ================================================ FILE: MetroSet UI Example/MetroSet UI Example.csproj ================================================  WinExe True Properties MetroSet_UI_Example MetroSet UI Example False net45;netcoreapp3.1 True True Resources.resx ResXFileCodeGenerator Resources.Designer.cs ================================================ FILE: MetroSet UI Example/Program.cs ================================================ using System; using System.Windows.Forms; namespace MetroSet_UI_Example { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } ================================================ FILE: MetroSet UI Example/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("MetroSet UI Example")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MetroSet UI Example")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0686644c-b939-4e46-b942-d01d81b4c6a7")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: MetroSet UI Example/Properties/Resources.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace MetroSet_UI_Example.Properties { using System; /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MetroSet_UI_Example.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _111201 { get { object obj = ResourceManager.GetObject("111201", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _372649 { get { object obj = ResourceManager.GetObject("372649", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _475841 { get { object obj = ResourceManager.GetObject("475841", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _542249 { get { object obj = ResourceManager.GetObject("542249", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _579840 { get { object obj = ResourceManager.GetObject("579840", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap _579841 { get { object obj = ResourceManager.GetObject("579841", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap filter { get { object obj = ResourceManager.GetObject("filter", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap icons8_double_right { get { object obj = ResourceManager.GetObject("icons8_double_right", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized string similar to Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.. /// internal static string metroSetTextBox3_Text { get { return ResourceManager.GetString("metroSetTextBox3.Text", resourceCulture); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap monochrome_square_pattern { get { object obj = ResourceManager.GetObject("monochrome_square_pattern", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap monochrome_square_pattern_background_1164_1345 { get { object obj = ResourceManager.GetObject("monochrome-square-pattern-background_1164-1345", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } } } ================================================ FILE: MetroSet UI Example/Properties/Resources.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\542249.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\579841.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\579840.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-double-right.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\372649.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\475841.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\filter.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\111201.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\monochrome-square-pattern-background_1164-1345.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\monochrome-square-pattern.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ================================================ FILE: MetroSet UI Example/Properties/Settings.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace MetroSet_UI_Example.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } } ================================================ FILE: MetroSet UI Example/Properties/Settings.settings ================================================  ================================================ FILE: MetroSet UI.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26228.4 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetroSet UI", "MetroSet UI\MetroSet UI.csproj", "{246951DC-5E33-4A86-9498-A03F9D784EFA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetroSet UI Example", "MetroSet UI Example\MetroSet UI Example.csproj", "{0686644C-B939-4E46-B942-D01D81B4C6A7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {246951DC-5E33-4A86-9498-A03F9D784EFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {246951DC-5E33-4A86-9498-A03F9D784EFA}.Debug|Any CPU.Build.0 = Debug|Any CPU {246951DC-5E33-4A86-9498-A03F9D784EFA}.Release|Any CPU.ActiveCfg = Release|Any CPU {246951DC-5E33-4A86-9498-A03F9D784EFA}.Release|Any CPU.Build.0 = Release|Any CPU {0686644C-B939-4E46-B942-D01D81B4C6A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0686644C-B939-4E46-B942-D01D81B4C6A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {0686644C-B939-4E46-B942-D01D81B4C6A7}.Release|Any CPU.ActiveCfg = Release|Any CPU {0686644C-B939-4E46-B942-D01D81B4C6A7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3F6BC7EC-455F-4145-B584-4ED1E3EDBCAC} EndGlobalSection EndGlobal ================================================ FILE: README.md ================================================

MetroSet-UI

MetroSet UI Framework

Windows Forms Metro Skin Style, Make The .NET Applications With Metro Styles.

##

Install via NuGet

Install-Package MetroSet_UI ##

Direct to NuGet

> [Link](https://www.nuget.org/packages/MetroSet_UI/) ##

Supported platforms

:arrow_right: Windows XP SP1/SP2/SP3 :arrow_right: Windows Vista :arrow_right: Windows 7 :arrow_right: Windows 8 :arrow_right: Windows 10 ##

Dependency

:arrow_right_hook: .NET Framework 2.0 or higher. ##

Components Available

:arrow_down: | Components | Skin Support | Custom Theme Support | Animation | Disabling | Custom Smart Tags :---:|:---|:---:|:---:|:---:|:---:|:---:| :arrow_right: | StyleManager |:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark: :arrow_right: | MetroSetToolTip |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark:

Forms Available

:arrow_down: | Forms | Skin Support | Custom Theme Support | Animation | Disabling | Custom Smart Tags :---:|:---|:---:|:---:|:---:|:---:|:---:| :arrow_right: | MetroSetForm |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x: :arrow_right: | MetroSetMessageBox |:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:

Controls Available

:arrow_down: | Controls | Skin Support | Custom Theme Support | Animation | Disabling | Custom Smart Tags :---:|:---|:---:|:---:|:---:|:---:|:---:| :arrow_right: | MetroSetBadge |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetButton |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetDefaultButton |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetCheckBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetComboBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetContextMenuStrip |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetControlBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetDevider|:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark: :arrow_right: | MetroSetEllipse |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetLabel |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark: :arrow_right: | MetroSetLink |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark: :arrow_right: | MetroSetListBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetNumeric |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetPanel |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_multiplication_x: :arrow_right: | MetroSetProgress |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetRadioButton |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetRichTextBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetScrollBar |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetSwitch |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetTabControl |:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x: :arrow_right: | MetroSetTextBox |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetTile |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_check_mark:|:heavy_check_mark: :arrow_right: | MetroSetTrackBar |:heavy_check_mark:|:heavy_check_mark:|:heavy_multiplication_x:|:heavy_multiplication_x:|:heavy_check_mark:

Demonstration

Light

MetroSet-UI

Dark

MetroSet-UI

Custom

MetroSet-UI

Custom

MetroSet-UI

Using MetroSetForm

C#.NET

```cs using MetroSet_UI.Forms; public partial class Form1 : MetroSetForm { public Form1() { InitializeComponent(); } } ```

VB.NET

```vb Imports MetroSet_UI.Forms public class Form1 : Inherits MetroSetForm Sub New() End Sub End Class ```

MetroSetMessageBox Example

C#.NET

```cs using System; using MetroSet_UI.Forms; using System.Windows.Forms; namespace MetroSet_UI_Example { public partial class MetroSetForm1 : MetroSetForm { public MetroSetForm1() { InitializeComponent(); } private void MetroSetButton1_Click(object sender, EventArgs e) { MetroSetMessageBox.Show(this, "Content", "Caption", MessageBoxButtons.OK, MessageBoxIcon.Question); } } } ```

VB.NET

```vb Imports MetroSet_UI.Forms public class Form1 : Inherits MetroSetForm Private Sub MetroSetButton1_Click(sender As Object, e As EventArgs) MetroSetMessageBox.Show(Me, "Content", "Caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) End Sub End Class ```

Credits

> MCF.Goodwin : [Form Fading](https://www.codeproject.com/Articles/30255/C-Fade-Form-Effect-With-the-AnimateWindow-API-Func) > Burak Ozdiken : [TabControlDesigner](https://github.com/N-a-r-w-i-n/MetroSet-UI/blob/master/MetroSet%20UI/Design/MetroSetTabControlDesigner.cs) > Mavamaarten : [TabControl Transition Method](https://github.com/N-a-r-w-i-n/MetroSet-UI/blob/29e65d1d2e4d12105f9b9639e9def96af0b93da2/MetroSet%20UI/Controls/MetroSetTabControl.cs#L363-L463)

License

> [MIT License](https://github.com/N-a-r-w-i-n/MetroSet-UI/blob/master/LICENSE)