J
Jay Dee
Can anyone explain to me how to trigger events in a control.
I have overridden the text class of a control and stored the text as
List<char>.
Because I am not calling the base.Text method from within the
overridden method the TextChainged event is not being raised.
If I add OnTextChanged(new EventArgs()) to the overridden method then
this will call the text changed event, but then I am having trouble
when the control is first initialised as the OnTextChanged() event is
not normally triggered when the control is being initialised.
I am wondering weather this has something to do with the SuspendLayout
(); and ResumeLayout(false); calls that the designer adds to a control
that is used at design time but I don’t think it is relevant.
Another thought is weather it has something to do with the Events
property of the control If I am not mistaken the OnTextChanged is not
normally called until a call to Application.DoEvents() in witch case
the overridden property could be still adding the OnTextChanged method
to a list that is being called at the end of the initialize.
To be honest I don’t really have a clue, could someone point me in the
right direction.
Thanks
Jay Dee
I have overridden the text class of a control and stored the text as
List<char>.
Because I am not calling the base.Text method from within the
overridden method the TextChainged event is not being raised.
If I add OnTextChanged(new EventArgs()) to the overridden method then
this will call the text changed event, but then I am having trouble
when the control is first initialised as the OnTextChanged() event is
not normally triggered when the control is being initialised.
I am wondering weather this has something to do with the SuspendLayout
(); and ResumeLayout(false); calls that the designer adds to a control
that is used at design time but I don’t think it is relevant.
Another thought is weather it has something to do with the Events
property of the control If I am not mistaken the OnTextChanged is not
normally called until a call to Application.DoEvents() in witch case
the overridden property could be still adding the OnTextChanged method
to a list that is being called at the end of the initialize.
To be honest I don’t really have a clue, could someone point me in the
right direction.
Thanks
Jay Dee