Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 4 text boxes and a function with in pagetab of tabcontrol during load i was able to call that function to get values of the 4 textboxes and save the result to a textbox. I want to do the same call the function and auto compute when any of the 4 textboxes has changed its value or after user enter a value to any of them. I was able to read delegation and event. I some one give a sample code that has this delegate and event which i might get idea with.

Thank you in advance
Posted
Comments
Sinisa Hajnal 3-Dec-14 2:06am    
Winforms?
JOEY G. MOYA 3-Dec-14 20:21pm    
Hi I was able to do it perfectly using your solution
Thank you very much
Sinisa Hajnal 4-Dec-14 2:20am    
No problem, glad to be of help.
BillWoodruff 3-Dec-14 5:48am    
What does "function with in pagetab of tabcontrol" mean ? A function (method we say in C# .NET) is code: a TabPage in a TabControl is a UI component; it doesn't contain code ... unless it's the case that you have sub-classed it.

Please clarify.

1 solution

Assuming WinForms:
There is Validated event that will trigger after changing focus and Validating event. In Validating you can cancel the change if someone enters invalid value, in Validated event you call whatever function you need.

No need for delegates or anything complex. Since you're not showing any code, this is the best I can do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900