Link to home
Start Free TrialLog in
Avatar of emsp
emspFlag for Norway

asked on

Overriding the TextChanged function of a RTB

I have a component that is made up of several different components, one of them being a RichTextBox. I've got an instance of that component in my program, and have now encountered a problem; I want to use the TextChanged function of the richTextBox object to modify other components within my program, but I cannot seem to find a way to override the function and let it run from my main program. I'm not sure I'm explaning this correctly, so let me try to illustrate it (too much code to paste);

MyRichTextBoxModifiedComponent.cs
 - TextChanged function

MyProgram.cs
 - MyRichTextBoxModifiedComponent - object
 - Label - object

I want the TextChanged function to set the Text property of the Label object.
Avatar of jandromeda
jandromeda
Flag of Sri Lanka image

Catch the TextChanged event inside your MyRichTextBoxModifiedComponent and make it fire it's own event. Then catch that new event in your MyProgram to chage the text of the label. Will give you a sample shortly.
ASKER CERTIFIED SOLUTION
Avatar of jandromeda
jandromeda
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial