Designing Menu/tool bar system takes action depending on control displayed
-
I have created an application and I am using a panel to load and display custom user controls. In all these custom controls, there is need save data or cancel changes. I want to design a menu or a tool bar with the save and cancel commands such that changes are saved or cancel depending on the control currently displayed. The save changes command is a little complex for me because the code for saving data would be different for each control. How can I design my menu/tool bar such that the right code executes depending on the displayed control? Secondly, in my display panel how can I get a "reference" ton the currently displayed/visible control. There could be other controls in the back ground hidden by the current control but I just to be able to reference only the top-most control. NB When I load a control, set I it to fill up the entire panel space which hides any control that may have been visible before but I suppose that does not necessarilly set the visible flag of the previous control to false so. So I can't use the Visible property to check for the "visible" control. Thanks for you help.