What should you do?

You are creating a Windows application by using the .NET Framework 3.5. The application will be used to manage records of patients at the hospital. Each application form contains a TreeView control that displays a hierarchical list of patients. Items from the TreeView controls can be dragged to other controls on the form. Each form has a different layout. You discover that items from the TreeView controls of 10 forms cannot be dragged to other forms. You need to ensure that the TreeView controls across all forms in the application function appropriately. You want to achieve this goal by using minimum development effort. What should you do?

You are creating a Windows application by using the .NET Framework 3.5. The application will be used to manage records of patients at the hospital. Each application form contains a TreeView control that displays a hierarchical list of patients. Items from the TreeView controls can be dragged to other controls on the form. Each form has a different layout. You discover that items from the TreeView controls of 10 forms cannot be dragged to other forms. You need to ensure that the TreeView controls across all forms in the application function appropriately. You want to achieve this goal by using minimum development effort. What should you do?

A.
Create a user control that contains the TreeView control.Replace the TreeView control on each form in the application with the TreeView user control.

B.
Create a single base form that inherits the System.Windows.Forms.Form class.Add a TreeView control to the base form.Modify each form in the application to inherit the base form.

C.
Create a static class that contains a single method to create and return a TreeView control.Modify each form in the application to call the method.Add the TreeView control that is returned by the method to the controls collection of the forms.

D.
Use the Singleton pattern to create a class that contains all events to be raised by each TreeView control in the application.Modify each application form to subscribe to the events on the Singleton class instead of the TreeView controls.Set the TreeView controls to use the Singleton class to raise events.



Leave a Reply 0

Your email address will not be published. Required fields are marked *