1. Custom Control with 2 Textboxes
Publicly define Int Sum = textbox1 + textbox2 values
2. A new Form and Add the Custrom Control created
A third Textbox which will take value from CustromControl.Sum
The Tricky issue is , Event Should Occur when ever the Textbox1 and Textbox2 values are changed in the Form . and Textbox 3 should get automatically updated.
can anyone who's done this help me with this ?? Its something I've tried using A delegates and events but its never getting invoked in the main form .
Any Help would be appreciated
Thanks
Loading

Vivek Sampara11 reputationPosted Apr 13, 2011, 1:11 AM EDT
Vivek Sampara11 reputationPosted Apr 13, 2011, 10:05 PM EDT
FroglegRank #1,020 · 1.9K reputationPosted Apr 14, 2011, 1:01 AM EDT
Vivek Sampara11 reputationPosted Apr 14, 2011, 2:49 AM EDT
As you have used the object in the same object you dont have to make any delegates .
FroglegRank #1,020 · 1.9K reputationPosted Apr 15, 2011, 4:06 PM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 16, 2011, 2:47 PM EDT
I am not sure if you are saying that there is just one form or two forms. Is it one form with a UserControl and a textbox in it and the UserControl has two textboxes?
Vivek Sampara11 reputationPosted Apr 16, 2011, 9:44 PM EDT
Frogleg , Thanks for you reply, It really helped me a lot but ,But I got it working in this method
Sam Hobbs, I put up the word as a challenge,
1. I've consulted a few very good .NET programmers and i dint find any results for that , so it would be something for the experts of C sharp corner can try.
2. Yes i my intend was to get the result as it would be very useful for me and others who are working on Custom Events and Delegates .
Thanks For the Reply Guys
--
And in the Form im using the custom Contol. I used this
this.newControl11.MyEvent += new NewControl1.TextBoxControl_TextChangedEventHandler(CustomNewChange);
Sam HobbsRank #107 · 20.5K reputationPosted Apr 16, 2011, 10:08 PM EDT
Beginners tend to talk in terms of projects. Experienced Windows developers don't. In this context, a project can be another application and therefore some kind of inter-process communication is necessary. That is not a typical Windows Forms thing and is very different from an intra-process solution. A project could be a class library which executes within a process and would not need inter-process communication.
Vivek Sampara11 reputationPosted Apr 16, 2011, 10:39 PM EDT
So This custom control has 2 Text boxes. If there's any change of value in either of the textbox there should be an Event Triggered in the form we're using this custom control.
So Event For Textbox.TextChanged doesn't exist for custom Control, To trigger the main form. So i've used the code i've mentioned . So when event the textbox value is changed , the main form gets triggerd
Hope you understood now .
Sam HobbsRank #107 · 20.5K reputationPosted Apr 17, 2011, 8:23 PM EDT
Mayur GujrathiRank #666 · 3.6K reputationPosted Apr 17, 2011, 9:26 PM EDT
FroglegRank #1,020 · 1.9K reputationPosted Apr 17, 2011, 11:22 PM EDT
http://www.cultiv.nl/blog/2010/3/16/convert-between-vs2008-and-2010-projects,-automatically