Trigger Feedback
Manually invoke visual and auditory feedback when the Siticone CheckBox is in a read-only state, enhancing user interaction and accessibility.
Overview
Method Signature
public void TriggerReadOnlyFeedback()Detailed Description
Usage
Example
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;
public class ReadOnlyFeedbackForm : Form
{
private SiticoneCheckBox readOnlyCheckBox;
private Button validateButton;
public ReadOnlyFeedbackForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.readOnlyCheckBox = new SiticoneCheckBox();
this.validateButton = new Button();
this.SuspendLayout();
//
// readOnlyCheckBox
//
this.readOnlyCheckBox.Text = "Accept Terms and Conditions";
this.readOnlyCheckBox.Location = new Point(50, 50);
this.readOnlyCheckBox.Size = new Size(250, 35);
this.readOnlyCheckBox.IsReadOnly = true; // Set checkbox to read-only
this.readOnlyCheckBox.CanBeep = true; // Enable beep sound
this.readOnlyCheckBox.CanShake = true; // Enable shake animation
//
// validateButton
//
this.validateButton.Text = "Validate";
this.validateButton.Location = new Point(50, 100);
this.validateButton.Click += new EventHandler(this.ValidateButton_Click);
//
// ReadOnlyFeedbackForm
//
this.ClientSize = new Size(350, 200);
this.Controls.Add(this.readOnlyCheckBox);
this.Controls.Add(this.validateButton);
this.Text = "SiticoneCheckBox - TriggerReadOnlyFeedback Example";
this.ResumeLayout(false);
}
private void ValidateButton_Click(object sender, EventArgs e)
{
// Attempt to toggle the checkbox state
if (readOnlyCheckBox.IsReadOnly)
{
// Trigger read-only feedback to inform the user
readOnlyCheckBox.TriggerReadOnlyFeedback();
}
else
{
// Toggle the checkbox state if not read-only
readOnlyCheckBox.Checked = !readOnlyCheckBox.Checked;
}
}
}Best Practices
Common Pitfalls and Design Considerations
Design Considerations
Summary and Review
Last updated