Tải bản đầy đủ (.pptx) (30 trang)

Wpf 02 basic controls

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (854.91 KB, 30 trang )

Basic controls
Windows Presentation Foundation


Label
 Provide feedforward information
 Target: intended control that get focus.

2


TextBox
 AcceptsReturn = True: edit multiple lines

3


Button
 Derive from ButtonBase
 Basic control, user can click

4


Activity
 Write XAML code for login screen with
Username and Password.

5



ToggleButton

 3 events

 Checked when IsChecked is True
 Unchecked when IsChecked is False
 Indeterminate when IsChecked is null

6


CheckBox & RadioButton
 Derives from: ToggleButton -> ButtonBase
 Main property: IsChecked

 Normally Checkbox is just ToggleButton
with different appearance

7


RadioButton – Grouping by
name

8


Activity 1 – Problems?

9



Activity 2 - Improvement
Text properties
Family
Courier
Helvetica

12 CPI

Sans serif

15 CPI

Times

Proportional

Size

Border

Pitch
10 CPI

Style

Color

Small


Bold

Medium

Italic

Large

Underline

OK

Black
Blue
Green
Red

Apply

Cancel

Help

10


ComboBox
 Enables users to select one item from a list


 ComboBox can contain complex items

11


ComboBox – List of
string

12


ComboBox - Complex

13


ListView
 The ListView control derives from ListBox
 It uses the Extended SelectionMode by
default

14


Normal ListView with
class

15



ListView ItemTemplate

16


TreeView
 Presents a hierarchical view
 Data with nodes that can be expanded and
collapsed
 Important events:





Expanded
Collapsed
Selected
Unselected

17


GroupBox & Expander
 Both provide a container for arbitrary
content and a place for a header on top
 Expander can be expanded and collapsed
 GroupBox always shows its content

 Both controls derive from

HeaderedContentControl

18


Menu

19


 MenuItem is a headered items control
 The Header is actually the main object
 MenuItem contains properties for
customizing
 Icon
 IsCheckable
 InputGestureText

 Can handle events or assign a command to
MenuItem’s Command property
20



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×