Implementing controls in the main window.