{"id":15091060,"url":"https://github.com/lukewait/my-messagebox","last_synced_at":"2026-01-04T21:47:20.119Z","repository":{"id":245369612,"uuid":"818050917","full_name":"LukeWait/my-messagebox","owner":"LukeWait","description":"A custom C# class that replicates the functionality of the built-in MessageBox, with the addition of parent-relative positioning and enhanced UI customization options.","archived":false,"fork":false,"pushed_at":"2024-07-28T07:19:11.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T10:46:23.598Z","etag":null,"topics":["csharp","custom-class","dialogbox","dotnet","messagebox","ui-component","windows-forms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeWait.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-06-21T02:05:46.000Z","updated_at":"2024-07-28T07:19:15.000Z","dependencies_parsed_at":"2024-07-28T08:44:10.128Z","dependency_job_id":null,"html_url":"https://github.com/LukeWait/my-messagebox","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"4e2c2bafdb64fe21cbf54bb45f9ce73c313aeaac"},"previous_names":["lukewait/my-messagebox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeWait%2Fmy-messagebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeWait%2Fmy-messagebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeWait%2Fmy-messagebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeWait%2Fmy-messagebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeWait","download_url":"https://codeload.github.com/LukeWait/my-messagebox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945595,"owners_count":20536295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csharp","custom-class","dialogbox","dotnet","messagebox","ui-component","windows-forms"],"created_at":"2024-09-25T10:35:18.392Z","updated_at":"2026-01-04T21:47:20.080Z","avatar_url":"https://github.com/LukeWait.png","language":"C#","readme":"# Custom C# MessageBox\n\n## Description\nA C# class that extends the functionality of the built-in MessageBox, providing enhanced customization options and allowing for parent-relative positioning. This makes it ideal for Windows Forms applications where a more flexible dialog box solution is needed, particularly in multi-form solutions/testing where having the MessageBox appear over the parent is essential.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/LukeWait/my-messagebox/raw/main/screenshots/my-messagebox-example.png\" alt=\"MessageBox Screenshot\" width=\"250\"\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development](#development)\n- [License](#license)\n- [Source Code](#source-code)\n\n## Installation\n\n### From Source\nTo install and use the MyMessageBox class in your project:\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/LukeWait/my-messagebox.git\n    cd my-messagebox\n    ```\n\n2. Include the `MyMessageBox.cs` file in your C# project directory.\n\n## Usage\nThe `MyMessageBox` class allows you to display a custom message box in your Windows Forms application. \n\n### Parameters\nThe `Show` method requires the following parameters to control its appearance and behavior:\n```csharp\nMyMessageBox.Show(Form parentForm, string message, string title, MessageBoxButtons buttons, MessageBoxIcon icon)\n```\n\n- **parentForm**: The parent form that the message box will appear over. This should be an instance of a `Form` that is currently displayed on the screen. In most cases, you can use `this` to refer to the current form.\n- **message**: The message to display in the message box. Any string value is acceptable.\n- **title**: The text to display in the title bar of the message box. Any string value is acceptable.\n- **buttons**: The combination of buttons to display. Acceptable values include:\n  - `MessageBoxButtons.OK`\n  - `MessageBoxButtons.OKCancel`\n  - `MessageBoxButtons.AbortRetryIgnore`\n  - `MessageBoxButtons.YesNoCancel`\n  - `MessageBoxButtons.YesNo`\n  - `MessageBoxButtons.RetryCancel`\n- **icon**: The icon to display in the message box. Acceptable values include:\n  - `MessageBoxIcon.Error`\n  - `MessageBoxIcon.Information`\n  - `MessageBoxIcon.Question`\n  - `MessageBoxIcon.Warning`\n  - `MessageBoxIcon.None`\n\n### Example Usage\nImport the class in the global namespace:\n```csharp\nusing CustomMessageBox;\n```\n\nTo display a custom message box, use the following call:\n```csharp\nMyMessageBox.Show(this, \"This is a custom message box.\", \"Custom MessageBox\", MessageBoxButtons.OK, MessageBoxIcon.Information);\n```\n\n## Development\nThe `MyMessageBox` class is designed to be customizable. Here are some areas of the code that you can alter to fit your preferences:\n\n### Panel Colors\n```csharp\n// Lines 45-48\nPanel bodyPanel = new Panel();\nbodyPanel.Dock = DockStyle.Top;\nbodyPanel.BackColor = Color.White; // Change this color\n\n// Lines 50-53\nPanel footerPanel = new Panel();\nfooterPanel.Height = 49;\nfooterPanel.Dock = DockStyle.Bottom;\nfooterPanel.BackColor = Color.CornflowerBlue; // Change this color\n```\n\n### Icon Sizes and Positions\n```csharp\n// Lines 71-72\niconBox.Location = new Point(20, 20); // Change the position\niconBox.Size = new Size(32, 32); // Change the size\n```\n\n### Font and Text Styles\n```csharp\n// Line 85\nmessageLabel.Font = new Font(\"Microsoft Sans Serif\", 8); // Change the font and size\n```\n\n### Button Styles\n```csharp\n// Lines 159-163\nbutton.BackColor = SystemColors.Control;\nbutton.FlatAppearance.BorderColor = SystemColors.Control;\nbutton.FlatStyle = FlatStyle.System;\n```\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Source Code\nThe source code for this project can be found in the GitHub repository: [https://github.com/LukeWait/my-messagebox](https://www.github.com/LukeWait/my-messagebox).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukewait%2Fmy-messagebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukewait%2Fmy-messagebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukewait%2Fmy-messagebox/lists"}