tailieunhanh - Microsoft Visual C# 2010 Step by Step (P11)

Tham khảo sách 'microsoft visual c# 2010 step by step (p11)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 470 Part IV Building Windows Presentation Foundation Applications 10. Finally you need to arrange for the Reset method to be called when the form is first displayed. A good place to do this is in the MainWindow constructor. Insert a call to the Reset method after the statement that calls the InitializeComponent method as shown in bold type here public MainWindowO InitializeComponentO 11. On the Debug menu click Start Without Debugging to verify that the project builds and runs. 12. When the form opens click the Tower combo box. You will see the list of bell towers and you can select one of them. 13. Click the icon on the right side of the Member Since date time picker. You will be presented with a calendar of dates. The default value will be the current date. You can click a date and use the arrows to select a month. You can also click the month name to display the months as a list and you can also click the year to display a list of years. 14. Click each of the radio buttons in the Experience group box. Notice that you cannot select more than one radio button at a time. 15. In the Methods list box click some of the methods to select the corresponding check box. If you click a method a second time it clears the corresponding check box just as you would expect. 16. Click the Add and Clear buttons. Currently these buttons don t do anything. You will add this functionality in the final set of exercises in this chapter. 17. Close the form and return to Visual Studio 2010. Handling Events in a WPF Form If you are familiar with Microsoft Visual Basic Microsoft Foundation Classes MFC or any of the other tools available for building GUI applications for Windows you are aware that Windows uses an event-driven model to determine when to execute code. In Chapter 17 Interrupting Program Flow and Handling Events you saw how to publish your own events and subscribe to them. WPF forms and controls have their own predefined events that you can subscribe to and these .