tailieunhanh - Visual studio 2010 part 25
Sử dụng điều khiển WPF WPF bao gồm nhiều điều khiển để giúp bạn xây dựng giao diện người dùng. Phần này nhóm các điều khiển vào các mục, bao gồm văn bản, lựa chọn, bình chứa, thông tin, hình dạng, và trang trí. kiểm soát dữ liệu này không bao gồm mục đích, vì phần sau điều khiển là "Làm việc với dữ liệu trong WPF." Trước khi lặn vào từng điều khiển, chúng ta hãy làm một tổng quan về môi trường VS liên quan đến công tác kiểm soát | 226 Microsoft Visual Studio 2010 A Beginner s Guide Figure 8-7 The Canvas Layout control Now that you know how to use the layout controls the next section takes a closer look at WPF controls in general giving you tips on how to use them in your application. Using WPF Controls WPF includes many controls for helping you build user interfaces. This section groups the controls into categories including text selection containers information shapes and decorators. Data controls are excluded on purpose because the section following controls is Working with Data in WPF. Before diving into each control let s do an overview of the VS environment associated with control work. Managing Windows for Controls When working with controls you ll be working with four different windows Toolbox Solution Explorer Designer and Properties. You learned how to access each of these windows in earlier chapters but as a convenience Table 8-1 gives you a quick summary on how to open these windows. Chapter 8 Building Desktop Applications with WPF 227 Window Menu Keystroke Toolbox View Toolbox CTRL-W X Solution Explorer View Solution Explorer CTRL-W L Designer Double-click .xaml file in Solution Explorer SHIFT-F7 Properties Window View Properties window CTRL-W P Table 8-1 Primary Windows for Working with Controls You ll find all of the available controls on the Toolbox divided into panels where the top panel is Common WPF controls which makes it easy to find the controls you use the most. The All WPF Controls tab includes the complete list of WPF controls. You ve seen how the Designer can be used in the preceding section which discussed layout controls. You can open the Designer by double-clicking a .xaml file in Solution Explorer. To add a control to the Designer select the control in the Toolbox and drag the control onto the Designer. Figure 8-8 shows a Button that has been dragged and dropped onto the Designer. Figure 8-8 Adding a control to the VS Designer 228 Microsoft Visual Studio 2010 A .
đang nạp các trang xem trước