Monitoring Changes on a Tab Page
Robert W.
http://pocketpollster.com
Robert W.
http://pocketpollster.com
WinForms questions are off topic for the Visual C# General forum. Your question is likely to be answered quicker in this forum, where experts in WinForms are likely to be reading questions.
I've moved this thread to WinForms General forum.
rwerner wrote:Is there an event, or a few events, of the tab page that I can monitor to see if any changes to any controls on the tab page have been made?
When tabs are changed there are no validation events that occur. When tabs change you get a series of events: Deselecting, Deselected, Selecting, then Selected. Both Deselecting and Selecting can be canceled, it is in one of these two event handlers where you'd want to check to see if your controls' data has been modified. Are you simply interested in data validation?
Robert
Also look into SetWindowsHookEx()...
As you're seen, there's nothing "built-in" like that. As nobugz mentioned, you could iterate all the contained controls and hooking in to each controls potentially distinct update event (almost like using Reflection on each control). Depending on you circumstances, I don't know if that would be worth the time and effort. Usually when you want to be informed of changes you do it for each control; usually in terms of validation where you have distinct logic that needs to be performed for each control.
rwerner wrote:
It is not the selecting of the tabs I'm interested in but the altering of controls on a tab page. I thought perhaps there was a "Parent Control" event that would be fired when anything happened to any control on a tab page. Apparently not.