Appearance Customization
This feature allows developers to adjust the visual presentation of the card number control—including borders, fill, corners, placeholder and cursor settings—to seamlessly integrate with their app UI.
Overview
The Appearance Customization feature exposes several public properties that let you control the look and feel of the SiticoneCardNumberBox. You can modify the border’s size, color, style, and gradient; set solid or gradient fills; define custom corner radii; configure placeholder animations; and tailor the cursor appearance. The following sections provide detailed guidance, code samples, and integration examples.
Property Details
The table below summarizes key properties associated with Appearance Customization.
BorderSize
Sets the thickness of the control’s border.
1
BorderColor1
Primary border color when not focused or hovered.
Configurable; typically LightSlateGray
BorderColor2
Secondary border color (used for gradients).
Same as BorderColor1 by default
BorderFocusColor1
Primary border color when the control has focus.
Customizable (e.g., Blue tone)
BorderFocusColor2
Secondary border color for focused state.
Customizable
HoverBorderColor1
Primary border color when the control is hovered.
Customizable (e.g., Gray)
HoverBorderColor2
Secondary border color for hovered state.
Customizable
UseBorderGradient
Boolean to enable/disable border gradient.
false
BorderGradientMode
Direction of the border gradient (e.g., Horizontal, Vertical).
Horizontal by default
SolidFillColor
Sets the solid background fill color.
White
UseFillGradient
Boolean to enable/disable a gradient fill.
false
FillColor1
Primary fill color when using gradient fill.
White
FillColor2
Secondary fill color when using gradient fill.
White
FillGradientMode
Direction of the fill gradient (e.g., Horizontal, Vertical).
Horizontal by default
CornerRadiusTopLeft
Radius of the top-left corner.
0
CornerRadiusTopRight
Radius of the top-right corner.
0
CornerRadiusBottomLeft
Radius of the bottom-left corner.
0
CornerRadiusBottomRight
Radius of the bottom-right corner.
0
PlaceholderText
Text shown when no user input is present.
"Enter card number..." (example)
PlaceholderColor
Color of the placeholder text.
Gray
PlaceholderFadeInterval
Interval (in ms) for placeholder fade animation.
20
PlaceholderFadeStep
Step increment for placeholder fade (0.0 to 1.0).
0.05
CursorColor
Color of the blinking cursor.
Black
CursorWidth
Thickness of the cursor line.
1
CursorHeight
Height of the cursor.
26 or derived from Font.Height
CursorOffset
Horizontal offset for cursor positioning.
0
CursorStyle
Style/dash pattern for the cursor (using SiticoneDrawingStyle).
Solid by default
Code Examples
Example 1: Setting Up a Custom Border and Fill
Below is an example of how to set custom border and fill properties in your WinForms application:
Example 2: Customizing Corners and Placeholder Appearance
The following code demonstrates how to adjust corner radii and modify the placeholder settings:
Example 3: Customizing the Cursor
Customize the cursor appearance for a unique text entry feel:
Key Points
The following table summarizes the key points for Appearance Customization:
Border Customization
Modify thickness, color, gradient and style to match your UI.
Fill Customization
Choose solid or gradient backgrounds using defined color properties.
Corner Customization
Set individual corner radii for rounded control edges.
Placeholder & Cursor
Animate placeholder text and customize cursor attributes for clarity.
Best Practices
The table below outlines recommended practices when customizing appearance:
Set both primary and secondary colors for gradients
Ensures a smooth visual gradient effect.
Use non-zero corner radii sparingly
Excessive rounding may affect the control's readability.
Test cursor visibility on different backgrounds
Guarantee proper contrast for better user experience.
Adjust placeholder fade settings for optimal timing
Creates a natural feel without distracting the user.
Common Pitfalls
The table below lists common pitfalls and how to avoid them:
Overlapping gradient and solid fill settings
Use one fill style at a time (solid or gradient).
Inconsistent border colors when switching states
Ensure focus and hover colors are distinct and tested.
Incorrect corner radii causing visual glitches
Test with different sizes and adjust gradually.
Misconfigured placeholder fade causing flicker
Fine-tune the fade interval and step for smooth transitions.
Usage Scenarios
The table below describes several scenarios where Appearance Customization is essential:
Theming an application
Match the control’s appearance with your application’s color scheme.
Accessibility adjustments
Increase border thickness and contrast for better readability.
Branding
Apply custom gradients and corner styles to align with brand identity.
Real Life Usage Scenarios
Financial application UI customization
Use a blue-focused border when a card field is active to guide user input.
Mobile banking application with dark/light modes
Toggle between different fill gradients to complement the system theme.
E-commerce checkout page with brand colors
Customize corners and border styles to mirror the company’s design language.
Troubleshooting Tips
Border does not appear as expected
Conflicting property values or gradient settings
Verify that UseBorderGradient is set appropriately and check color values.
Placeholder text flickers
Incorrect fade interval or step settings
Adjust PlaceholderFadeInterval and PlaceholderFadeStep values.
Cursor is not visible
CursorColor blending with background
Choose a contrasting CursorColor and test on different backgrounds.
Review
Flexibility
The control provides extensive customization of appearance.
Integration
Properties are simple to set, allowing for quick integration.
User Experience
Customization options help enhance both aesthetics and usability.
Summary
The Appearance Customization feature of the SiticoneCardNumberBox control empowers developers to tailor the visual aspects of the card number input field. Through configurable border, fill, corner, placeholder, and cursor settings, you can achieve a seamless integration with your application’s design. Always test your appearance settings in different states (focused, hovered, read-only) and on various themes to ensure consistency and optimal user experience.
Additional Integration Example
Below is a complete integration example demonstrating multiple appearance customizations in one form:
This example illustrates how to combine multiple appearance settings to produce a refined, professional look for the card number input control.
By following this documentation, developers can leverage the Appearance Customization feature to create controls that match their application's design standards while ensuring an excellent user experience.
Last updated