Corner and Shape Config
This feature enables developers to adjust the curvature of the button’s corners to achieve a tailored, modern look—from subtle rounded edges to a fully circular (radial) shape.
Overview
The Corner Radius & Shape Customization feature provides a set of properties that allow developers to define individual corner radii and toggle a radial mode. This flexibility helps ensure that the button can conform to various design themes—from sharp-edged to pill-shaped or circular—depending on the application’s aesthetic and functional requirements.
Detailed Documentation
Properties & Settings
The table below outlines the customizable properties related to corner radii and shape:
TopLeftRadius
Sets the radius (in pixels) of the top-left corner; automatically limited based on control height.
19
int
copyButton.TopLeftRadius = 15;
TopRightRadius
Sets the radius (in pixels) of the top-right corner; automatically limited based on control height.
19
int
copyButton.TopRightRadius = 15;
BottomLeftRadius
Sets the radius (in pixels) of the bottom-left corner; automatically limited based on control height.
19
int
copyButton.BottomLeftRadius = 15;
BottomRightRadius
Sets the radius (in pixels) of the bottom-right corner; automatically limited based on control height.
19
int
copyButton.BottomRightRadius = 15;
MakeRadial
When enabled, this property adjusts all corner radii to create a circular or pill‑shaped button.
false
bool
copyButton.MakeRadial = true;
Code Examples and Integration Demos
Basic Integration Example
The following example demonstrates how to configure the individual corner radii for a standard copy button:
Advanced Customization Example
This example illustrates how to enable the radial mode so that the button automatically becomes circular or pill‑shaped based on its dimensions:
Key Points
Individual Customization
Developers can set the radius for each corner separately to achieve non-uniform curvature.
Automatic Radial Mode
The MakeRadial property simplifies the process of creating a circular or pill‑shaped button.
Dynamic Limitations
Corner radius values are automatically limited based on the control's height to maintain visual integrity.
Best Practices
Consistent UI Styling
Ensure that the corner radii settings match the overall design language of the application.
Use Radial Mode Judiciously
Enable MakeRadial only when the button’s dimensions support a clean circular or pill‑shaped appearance.
Validate on Resize
Since the control adjusts corner radii on size changes, test behavior when the control is resized dynamically.
Common Pitfalls
Oversized Radii
Setting a corner radius greater than half the control’s height might cause unexpected rendering.
Rely on the built‑in limitations or test with incremental adjustments.
Inconsistent Appearance with Manual Settings
Manually setting individual corner radii while also enabling MakeRadial can create conflicts.
Use one method consistently: either manual adjustments or MakeRadial.
Unexpected Changes on Resize
The control may update radii based on its new dimensions when resized.
Test the control under various window sizes to ensure stability.
Usage Scenarios
Standard Rounded Corners
For buttons that require subtle rounded edges to match a modern UI style.
Set TopLeftRadius, TopRightRadius, BottomLeftRadius, and BottomRightRadius to similar moderate values (e.g., 10–20).
Emphasized UI Elements
When a unique button design is desired, such as one with non-uniform corner radii.
Adjust individual corner properties to different values (e.g., TopLeft: 5, TopRight: 20, BottomLeft: 15, BottomRight: 20).
Circular/Pill-Shaped Buttons
When a completely rounded (or pill-shaped) button is needed for a specific design or mobile-style interface.
Enable MakeRadial (i.e., set MakeRadial = true) and adjust the control’s dimensions accordingly.
Review
Customization Flexibility
The feature provides granular control over each corner as well as an easy-to-use radial option.
Dynamic Adaptability
Automatic radius adjustments during resize events ensure that the button’s shape remains consistent and visually appealing.
Integration Ease
Code examples demonstrate straightforward integration into WinForms applications, allowing rapid styling changes.
Summary
Tailored Corner Customization
The Corner Radius & Shape Customization feature offers both individual corner control and an automatic radial mode for versatile button styling.
Visual Consistency
By automatically limiting corner values based on control size, the feature ensures a balanced, aesthetically pleasing appearance.
Seamless Integration
With detailed properties and clear integration examples, developers can easily adapt the button's shape to suit diverse design requirements.
Additional Useful Sections
Integration Checklist
Set Corner Radii
Confirm that TopLeftRadius, TopRightRadius, BottomLeftRadius, and BottomRightRadius are set appropriately.
Test MakeRadial Functionality
Enable MakeRadial and verify that the button automatically forms a circular or pill‑shaped appearance.
Verify Resize Behavior
Ensure that the control adjusts the radii correctly when its size changes.
Troubleshooting
Incorrect Curvature
Overriding MakeRadial with manual radius values can conflict with the automatic calculations.
Use either manual settings or MakeRadial consistently.
Visual Inconsistencies on Resize
Dynamic resizing might lead to unexpected rounding if not accounted for.
Test the control’s behavior in different window sizes and adjust accordingly.
By following this extensive documentation and using the provided code examples, developers can efficiently integrate and customize the Corner Radius & Shape Customization feature of the SiticoneCopyButton control. This ensures that buttons can be styled to match the precise visual design required for modern, responsive WinForms applications.
Last updated