EFileTahi-A
Contributor
I need o trigger events for my custom properties residing in a custom control.
Basically, I need a trigger for each property the control has and whenever they change. I've seen some examples on the web but I did not get a clear picture of how the whole thing works.
This is what I have so far:
What should I do from here? The Text property, in this case, is the one thing I need to trigger whenever it changes.
Basically, I need a trigger for each property the control has and whenever they change. I've seen some examples on the web but I did not get a clear picture of how the whole thing works.
This is what I have so far:
Code:
public partial class EFile_ComboBox : UserControl
{
public event EventHandler TextChanged;
[Category("Appearance")]
[Description("Specifies if a shadow should be draw for the button text.")]
[DisplayName("Text")]
[EditorBrowsable(EditorBrowsableState.Always), Browsable(true),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
Bindable(true)]
public override string Text
{
get
{
return sText;
}
set
{
sText = value;
this.Invalidate();
}
}
private void TextBox_Validated(object sender, EventArgs e)
{
// invoke UserControl event here
if (this.TextChanged != null) this.TextChanged(sender, e);
}
}
What should I do from here? The Text property, in this case, is the one thing I need to trigger whenever it changes.
Last edited: