{"id":30663311,"url":"https://github.com/russdev7/csharp-roundedformsclass","last_synced_at":"2026-04-15T16:03:06.351Z","repository":{"id":307187513,"uuid":"1026397564","full_name":"RussDev7/CSharp-RoundedFormsClass","owner":"RussDev7","description":"Drop‑in, Flat, themeable WinForms title‑bar with rounded corners, custom buttons, dark/light mode \u0026 live style updates.","archived":false,"fork":false,"pushed_at":"2025-07-30T18:33:26.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T17:13:07.292Z","etag":null,"topics":["borderless-form","csharp","custom-window-chrome","dark-theme","dotnet","gpl-v3","light-theme","rounded-corners","titlebar","winforms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RussDev7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-25T20:19:04.000Z","updated_at":"2025-07-30T18:33:29.000Z","dependencies_parsed_at":"2025-07-29T23:54:04.207Z","dependency_job_id":null,"html_url":"https://github.com/RussDev7/CSharp-RoundedFormsClass","commit_stats":null,"previous_names":["russdev7/csharp-roundedformsclass"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RussDev7/CSharp-RoundedFormsClass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RussDev7%2FCSharp-RoundedFormsClass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RussDev7%2FCSharp-RoundedFormsClass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RussDev7%2FCSharp-RoundedFormsClass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RussDev7%2FCSharp-RoundedFormsClass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RussDev7","download_url":"https://codeload.github.com/RussDev7/CSharp-RoundedFormsClass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RussDev7%2FCSharp-RoundedFormsClass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31848664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["borderless-form","csharp","custom-window-chrome","dark-theme","dotnet","gpl-v3","light-theme","rounded-corners","titlebar","winforms"],"created_at":"2025-08-31T17:04:59.227Z","updated_at":"2026-04-15T16:03:06.331Z","avatar_url":"https://github.com/RussDev7.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CustomFormStyler (TitleBarManager)\n\nA lightweight helper that replaces WinForms’ classic window chrome with a **flat, theme‑able title‑bar, rounded corners, and fully‑custom minimise / maximise / close buttons**. Drop it into any `Form`, call one line of code, and instantly modernise your UI.\n\n- It’s part of **[Core Keepers Workshop](https://github.com/RussDev7/CoreKeepersWorkshop)** and is released under the **GNU GPL v3**.\n  - Also check out the [BorderlessTabControl](https://github.com/RussDev7/CSharp-BorderlessTabControl).\n\n![CustomGUIUpdateRaw](https://github.com/user-attachments/assets/af62700a-807c-40a3-aabc-e5c669be9049)\n\n---\n\n## ✨ Key Features\n\n| Feature                       | Details                                                                                                               |\n|-------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| **Flat Title‑Bar**            | Removes the native chrome and draws a sleek, minimal bar that blends with your app theme.                             |\n| **Dark / Light Themes**       | One‑liner switch between dark and light palettes.                                                                     |\n| **Rounded Corners**           | Pick any combination (`Corner` flag enum) and radius—independent of OS support.                                       |\n| **Custom Buttons**            | Built‑in Min, Max, Close _(and optional Help)_ buttons with glyphs you can restyle.                                   |\n| **Border Options**            | Draw borders _inside_ (**Grow In**) or _outside_ (**Grow Out**) of the client area; choose size \u0026 colour.             |\n| **Runtime Updates**           | Call `UpdateStyle(...)` to tweak theme, radius, border, etc. without recreation.                                      |\n| **Drag Anywhere**             | Drag the window by the custom bar—implemented via a tiny Win32 interop helper.                                        |\n| **Extension Helpers**         | `Form.ApplyTheme()` \u0026 `RefreshAllThemes()` wire everything up and keep multiple windows in sync.                      |\n\n---\n\n## 📥 Installation\n1. Copy **`TitleBarManager.cs`** (or rename) into your WinForms project.\n2. Change the namespace if necessary.\n3. Re‑build; no designer support is needed—the styler is code‑only.\n\n\u003e ℹ️ No NuGet package (yet) – just a single self‑contained file.\n\n---\n\n## 🚀 Quick Start\n\n```csharp\npublic partial class MainForm : Form\n{\n    private CustomFormStyler _styler;\n\n    public MainForm()\n    {\n        InitializeComponent();\n\n        _styler = new CustomFormStyler(this);\n        _styler.Enable(); // Apply the custom chrome.\n    }\n}\n```\n\n### The One‑liner Extension\n\n```csharp\n// Using the helper in FormStylingExtensions:\nLoad += (_, __) =\u003e this.ApplyTheme();\n```\n\n---\n\n## 🛠️ Public API (Core Class)\n\n| Member                   | Description                                                                               |\n|--------------------------|-------------------------------------------------------------------------------------------|\n| `Enable()` / `Disable()` | Replace or restore the native window chrome.                                              |\n| `Toggle()`               | Convenience wrapper that flips the state.                                                 |\n| `IsEnabled`              | `bool` – current state of the styler.                                                     |\n| `UpdateStyle(...)`       | Change any subset of options at runtime (theme, border size, radius, etc.).               |\n| `CloseButtonPressed`     | `bool` – becomes `true` the moment the user presses Close (handy for confirmation logic). |\n\n### Style Parameters\n\n| Parameter (UpdateStyle) | Type         | Notes                                           |\n|-------------------------|--------------|-------------------------------------------------|\n| `theme`                 | `ThemeMode`  | `Dark` / `Light`.                               |\n| `borderMode`            | `BorderMode` | `GrowOut` (outside) or `GrowIn` (inside).       |\n| `roundedCorners`        | `Corner`     | Flag enum (`TopLeft`, `BottomRight`, … `All`).  |\n| `borderColor`           | `Color?`     | `null` ➜ auto (white on dark, black on light). |\n| `titleBarHeight`        | `int`        | Pixel height of the bar.                        |\n| `cornerRadius`          | `int`        | Radius in pixels. 0 ➜ square.                  |\n| `borderSize`            | `int`        | Stroke width in pixels. 0 ➜ no border.         |\n| `showIcon`              | `bool`       | Show/hide the small window icon.                |\n\n---\n\n## 🎨 Theming \u0026 Styling Tips\n\n* **Change theme at runtime** – flip a checkbox, then call `RefreshAllThemes()` to apply the new dark/light palette across every open window.\n* **Per‑window overrides** – call `UpdateStyle()` on a specific styler to deviate from global settings.\n* **Help button behaviour** – if your form’s `HelpButton` property is `true` _and_ both maximise \u0026 minimise are hidden, a “?” glyph appears automatically.\n* **Corner selection UI** – expose four checkboxes and build a `Corner` mask on the fly (see `MainForm.SelectedCorners`).\n* **Border insets** – remember: `GrowOut` changes overall form size, while `GrowIn` eats into the client area; pick what suits your layout.\n\n---\n\n## ⚙️ How It Works (Under the Hood)\n\n1. **`FormBorderStyle = None`** – strips the OS frame so we get a blank canvas.\n2. **Client‑area expansion** – compensates for the new title‑bar height (and optional GrowOut border) to keep your existing controls untouched.\n3. **Wrapper panel** – all pre‑existing controls are moved into a `_contentPanel` so resizing the bar never upsets user content.\n4. **Drag support** – a quick call to `ReleaseCapture()` + `SendMessage(WM_NCLBUTTONDOWN, HTCAPTION)` makes the new bar draggable.\n5. **Rounded corners** – `GraphicsPath` + `Region` let us clip the rectangle to any combination of rounded edges.\n6. **Custom border paint** – drawn in `Form_Paint`; half‑pixel offsets ensure crisp strokes at any width.\n\n---\n\n## 📝 License\n\n`TitleBarManager.cs` / `CustomFormStyler` is licensed under **GNU General Public License v3.0**.  \nSee the root `LICENSE` file for the full text.\n\n---\n\n## 🙏 Credits\n\nOriginal author: **RussDev7**  \nInspired by countless WinForms custom‑chrome experiments shared by the community.\n\n---\n\n## 📷 Screenshots\n\n![RoundedFormsExample](https://github.com/user-attachments/assets/e597cf53-7532-4eb6-8353-b939d383d198)\n\n---\n\n\u003e Found a bug or have an idea? Open an issue or pull request—contributions welcome!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussdev7%2Fcsharp-roundedformsclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frussdev7%2Fcsharp-roundedformsclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussdev7%2Fcsharp-roundedformsclass/lists"}