Siticone Email Box Advanced
The SiticoneEmailTextBoxAdvanced is a purpose-built control for capturing and validating email addresses.
Unlike standard textboxes, it includes built-in email format validation, domain blacklisting capabilities, and a rich set of visual customization options to match any UI theme.
Email Validation Features
Ensure data quality at the source with integrated validation logic.
| Property | Type | Description & Usage Example |
|---|---|---|
ValidationEnabled |
bool | emailBox.ValidationEnabled = true; Toggles the internal validation engine. When enabled, the control automatically checks for valid email syntax (e.g., user@domain.com). |
RejectedDomains |
string | emailBox.RejectedDomains = "gmail.com, yahoo.com"; A comma-separated list of domains that should be marked as invalid. Useful for B2B applications requiring business emails. |
ErrorColor |
Color | emailBox.ErrorColor = Color.Crimson; The text color applied when the input is invalid. |
Appearance & Visual Style
Customize the control to fit seamlessly into your application's design language.
| Property | Type | Description |
|---|---|---|
TextBoxType |
Enum |
Default (4-sided border) or Material (Bottom border only).
|
BorderColor |
Color | The color of the border in its idle state. |
FocusBorderColor |
Color | The border color when the control has focus. |
HoverBorderColor |
Color | The border color when the mouse hovers over the control. |
CornerRadius... |
int | Individual radius settings for TopLeft, TopRight, BottomLeft, and BottomRight corners. |
MakeRadial |
bool | Automatically sets all corner radii to create a pill-shaped control. |
Interaction & Feedback
Features to improve user experience during data entry.
| Property | Type | Description |
|---|---|---|
PlaceholderText |
string | Text displayed when the control is empty (e.g., "name@example.com"). |
PlaceholderColor |
Color | Color of the placeholder text. |
ShowClearButton |
bool | Shows a clickable 'X' button to clear input when focused and not empty. |
IsReadOnly |
bool | Prevents editing while maintaining a distinct visual style defined by ReadOnlyColors. |
UltraFastPerformance |
bool | Disables animations for maximum responsiveness in data-heavy forms. |
Images & Icons
Add context with integrated icons that react to state changes.
| Property | Type | Description |
|---|---|---|
IdleImage |
Image | Icon shown by default (e.g., an envelope icon). |
HoverImage |
Image | Icon shown on hover. |
FocusImage |
Image | Icon shown when focused. |
ImagePosition |
Enum | Left or Right alignment for the image. |
Events
Advanced events allow you to react to validity changes and extract domain information.
// Fired when text changes.
Provides validation status and extracted domain.
emailBox.TextContentChangedEnhanced += (s, e) =>
{
if (e.IsValid)
{
Console.WriteLine($"Valid email from domain: {e.Domain}");
// Example: Auto-detect company based on domain
if (e.Domain == "microsoft.com")
{
lblCompany.Text = "Microsoft Corp";
}
}
};
// Fired when the validation state flips (Valid <-> Invalid).
emailBox.ValidationChangedEnhanced += (s, e) =>
{
if (!e.IsValid)
{
// Access specific validation errors
lblError.Text = e.Errors[0];
lblError.Visible = true;
}
else
{
lblError.Visible = false;
}
};
// Fired when Enter is pressed. Suppresses the default sound.
// Provides instant access to pre-calculated properties.
emailBox.EnterKeyPressed += (s, e) =>
{
if (e.IsValid)
{
// Use properties without querying the control again
Console.WriteLine($"Logging in user: {e.UserPart}");
Console.WriteLine($"Domain: {e.Domain}");
Login(e.Email);
}
else
{
MessageBox.Show($"Please fix: {e.ValidationErrors[0]}");
}
};
Designer Support
The control includes a comprehensive Smart Tag menu in Visual Studio for rapid configuration.
| Category | Features |
|---|---|
Theme Presets |
One-click application of themes like Light, Dark, Corporate Blue, Success Green, etc. |
Settings Management |
Copy style settings from one email box and paste them to another. |
Validation |
Quick access to Rejected Domains and Validation Enabled toggle. |
Usage Examples
Example 1: Corporate Validator
Configuring the control to reject public email domains for a B2B signup form.
private void SetupCorporateEmail()
{
// Reject common public domains
emailBox.RejectedDomains = "gmail.com,yahoo.com,hotmail.com,outlook.com";
// Visual Feedback
emailBox.ErrorColor = Color.DarkRed;
emailBox.PlaceholderText = "Enter work email";
// Handle validation result
emailBox.ValidationChangedEnhanced += (s, e) =>
{
btnSubmit.Enabled = e.IsValid;
};
}
Example 2: Material Design Style
Applying a modern Material Design look with a bottom border and custom colors.
private void ApplyMaterialStyle()
{
emailBox.TextBoxType = EmailTextBoxType.Material;
// Modern colors
emailBox.BackgroundColor = Color.WhiteSmoke;
emailBox.BorderColor = Color.Gray;
emailBox.FocusBorderColor = Color.FromArgb(33, 150, 243); // Material Blue
// Remove rounding for Material feel
emailBox.CornerRadius = 0;
}
Example 3: Read-Only Display
Using the control to display a saved email address securely.
private void DisplaySavedEmail(string email)
{
emailBox.TextContent = email;
emailBox.IsReadOnly = true;
// Customize read-only colors to look like a label/display
emailBox.ReadOnlyColors.BackgroundColor = Color.White;
emailBox.ReadOnlyColors.BorderColor = Color.Transparent;
emailBox.ReadOnlyColors.TextColor = Color.DarkSlateGray;
}
Example 4: Quick Submit on Enter
Triggering a submission immediately when the user presses Enter, using the EnterKeyPressed event to bypass manual property queries.
private void SetupQuickSubmit()
{
emailBox.EnterKeyPressed += (s, e) =>
{
if (e.IsValid)
{
// Proceed immediately without clicking a button
SubscribeUser(e.Email, e.Domain);
}
else
{
// Show errors found in the event args
MessageBox.Show($"Error: {e.ValidationErrors[0]}");
}
};
}