# Corner Radius

## Overview

The Corner Radius feature provides properties to individually adjust the curvature of the SiticoneTileButton's corners. Developers can specify distinct radius values for the top‑left, top‑right, bottom‑left, and bottom‑right corners. This flexibility allows the creation of buttons with varying shapes—from fully rounded to partially squared designs—thus aligning with diverse UI design requirements.

***

#### Feature Properties Table

| Property Name     | Type  | Default Value | Description                                                          |
| ----------------- | ----- | ------------- | -------------------------------------------------------------------- |
| TopLeftRadius     | float | 12f           | Sets the curvature radius for the top‑left corner of the button.     |
| TopRightRadius    | float | 12f           | Sets the curvature radius for the top‑right corner of the button.    |
| BottomLeftRadius  | float | 12f           | Sets the curvature radius for the bottom‑left corner of the button.  |
| BottomRightRadius | float | 12f           | Sets the curvature radius for the bottom‑right corner of the button. |

***

#### Key Points

| Aspect              | Details                                                                                                                          |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Customizable Layout | Allows separate configuration for each corner, enabling asymmetric or unique button shapes.                                      |
| Visual Appeal       | Rounded corners can soften the look of the UI and help buttons blend with modern design aesthetics.                              |
| Responsive Behavior | The control automatically adjusts corner radii to prevent exceeding half of the button’s width or height for optimal appearance. |

***

#### Best Practices

| Practice                                     | Explanation                                                                                                 |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Keep radii consistent with overall UI design | Use similar radius values across UI elements for a unified and professional appearance.                     |
| Experiment with asymmetric values            | For creative interfaces, try varying the radius for different corners to create distinctive shapes.         |
| Ensure readability and touch target size     | While rounded corners add style, maintain adequate button size and clarity to avoid compromising usability. |

***

#### Common Pitfalls

| Pitfall                                             | Recommendation                                                                                           |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Setting excessively high radius values              | Ensure the radius does not exceed half of the button’s dimensions to avoid distorted shapes.             |
| Inconsistent corner styling across similar controls | Standardize the radius settings across buttons to maintain a cohesive UI design.                         |
| Ignoring responsive layout adjustments              | Test how corner radii behave when the button is resized to ensure the design remains visually appealing. |

***

#### Usage Scenarios

| Scenario                             | Description                                                                                                                      |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| Modern and Minimalistic UIs          | Use uniform, subtle radii to create buttons that have a sleek, modern look.                                                      |
| Custom Themed Applications           | Adjust corner radii to match custom design themes or brand aesthetics, such as heavily rounded buttons for a friendly interface. |
| Dynamic Interfaces with Mixed Shapes | Use different radii on each corner to produce creative and visually engaging button designs in dynamic layouts.                  |

***

#### Code Examples

**Example 1: Basic Corner Radius Configuration**

This example demonstrates how to set the default rounded corners on the SiticoneTileButton with uniform radii.

```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;

namespace CornerRadiusDemo
{
    public class MainForm : Form
    {
        public MainForm()
        {
            // Initialize the SiticoneTileButton with default corner radii
            var roundedButton = new SiticoneTileButton
            {
                Text = "Rounded Button",
                Size = new Size(220, 150),
                Location = new Point(50, 50),
                
                // Corner Radius settings (all corners set to 12f by default)
                TopLeftRadius = 12f,
                TopRightRadius = 12f,
                BottomLeftRadius = 12f,
                BottomRightRadius = 12f
            };

            Controls.Add(roundedButton);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
        }
    }
}
```

**Example 2: Customized Asymmetric Corner Radius**

This example shows how to customize the corner radii to achieve an asymmetric design with varied curvature.

```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;

namespace AsymmetricCornerRadiusDemo
{
    public class MainForm : Form
    {
        public MainForm()
        {
            // Initialize the SiticoneTileButton with customized corner radii
            var customButton = new SiticoneTileButton
            {
                Text = "Custom Shape",
                Size = new Size(220, 150),
                Location = new Point(30, 30),
                
                // Customized Corner Radius settings
                TopLeftRadius = 20f,    // More rounded top‑left
                TopRightRadius = 5f,    // Slight rounding on top‑right
                BottomLeftRadius = 10f, // Moderate rounding on bottom‑left
                BottomRightRadius = 15f // Intermediate rounding on bottom‑right
            };

            Controls.Add(customButton);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
        }
    }
}
```

***

#### Review

| Aspect                       | Review Comments                                                                                                      |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Design Flexibility           | The ability to adjust each corner’s radius individually provides extensive design flexibility.                       |
| Ease of Integration          | Simple property assignments make it straightforward to integrate and customize the corner radii.                     |
| Consistency and Adaptability | Automatic limits on maximum radius ensure that the control remains visually balanced regardless of size adjustments. |

***

#### Summary

The Corner Radius feature of the SiticoneTileButton control allows developers to customize the curvature of each corner of the button, supporting both symmetric and asymmetric designs. By configuring properties such as TopLeftRadius, TopRightRadius, BottomLeftRadius, and BottomRightRadius, you can achieve a tailored, modern appearance that aligns with your application's overall design language. This feature enhances the aesthetic appeal and usability of the button in .NET WinForms applications.

***

#### Additional Resources

| Resource Category            | Description                                                                                                           |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Integration Tips             | Refer to the provided code examples to learn how to integrate and adjust corner radii effectively in your UI designs. |
| UI/UX Considerations         | Evaluate how varying corner radii interact with other UI elements to maintain a cohesive and balanced appearance.     |
| Responsive Design Strategies | Test the corner radius settings across different form sizes and resolutions to ensure consistent visual quality.      |

***

By following these guidelines and examples, developers can seamlessly integrate and customize the Corner Radius feature of the SiticoneTileButton control, creating visually appealing and modern buttons that enhance the overall user interface of their .NET WinForms applications.
