YOMEDIA
Lecture Windows programming: Chapter 3(3) - Châu Thị Bảo Hà
Chia sẻ: Kiếp Này Bình Yên
| Ngày:
| Loại File: PPTX
| Số trang:74
54
lượt xem
5
download
Download
Vui lòng tải xuống để xem tài liệu đầy đủ
Chapter 3 (Cont’d) introduction to the Windows programming. In this chapter present the some advanced controls as: DomainUpDown, NumericUpDown; MonthCalendar, DateTimePicker; Timer, TrackBar, ProgressBar; Timer, TrackBar, ProgressBar;... Inviting you to refer.
AMBIENT/
Chủ đề:
Nội dung Text: Lecture Windows programming: Chapter 3(3) - Châu Thị Bảo Hà
- Chapter 3
Windows
Programming
Cont’d
1
- Contents
•
Introduction to Windows Form Application
•
Introduction to Form
•
Introduction to Control
•
Events
•
Some common Controls
•
Some advanced Controls
Slide 2
- Some advanced controls
1. DomainUpDown,
NumericUpDown
2. MonthCalendar,
DateTimePicker
3. Timer, TrackBar,
ProgressBar
4. MenuStrip,
ContextMenuStrip
5. ToolStrip
6. StatusStrip
Slide 3
- NumericUpDown,
DomainUpDown
•
NumericUpDown
– Minimum property
– Maximum property
– Increment property
– Value property
– ValueChanged event
•
DomainUpDown
– Items property
– Sorted property
– SelectedIndex property Slide 4
- DomainUpDown example
5
- MonthCalendar, DateTimePicker
MonthCalendar DateTimePicker
•
SelectionStart property •
Format property
•
SelectionEnd property •
Value property
•
SelectionRange property •
MaxDate property
•
MinDate property
Slide 6
- Timer
•
Timer: is a component that raises an event
at regular intervals
– Interval property
– Enabled property
– Start() method
– Stop() method
– Tick event
Slide 7
- Timer example
8
- Timer example
•
How to do?
- Timer example
•
How to do?
Khai báo
trình xử lý sự
kiện Tick
- TrackBar
•
Properties
– Minimum
– Maximum
– Orientation
– TickFrequency
– TickStyle
– Value
•
Exent
– Scroll: occurs when the slider moves
– ValueChanged Slide 11
- TrackBar example
TrackBar1.Minimum = 0;
TrackBar1.Maximum = 100;
Số vị trí di chuyển khi dùng phím mũi
TrackBar1.SmallChange = 1; tên
TrackBar1.LargeChange = 5; Số vị trí di chuyển khi dùng phím Page
TrackBar1.TickStyle = TickStyle.BottomRight;
TrackBar1.TickFrequency = 10; Số khoảng cách giữa các tick mark
TrackBar1.Value = 10;
- ProgressBar
•
Properties
– Minimum
– Maximum
– Value
– Step
– Style
•
Methods
– PerformStep()
– Increment(int value)
Slide 13
- ProgressBar example
- ProgressBar example
•
How to do?
Max = 100
Min = 0
Step = 10
- ProgressBar example
•
How to do?
- MenuStrip
•
How to create menus manually? (p.499)
•
Properties:
– Checked: True/False
– ShortcutKeys
– ShowShortcutKeys: True/False
– Text
•
Events:
– Click: default event
– CheckedChanged
•
How to reuse the handler of the button?
Slide 17
- ContextMenuStrip
•
Similar to the MenuStrip control
•
The main difference
– ContextMenuStrip control does not have a top-
level menu
– Not visible at run time unless invoked by right-
clicking the control that it is associated with
•
Associating a ContextMenuStrip property
with a control
– using ContextMenuStrip property of a control
or
Slide 18
- ContextMenuStrip example
Slide 19
- ToolStrip
•
ToolStrip (p.503): A toolbar provides one-
click access to such frequently used
functionalities
•
A toolbar can hold: labels, buttons,
textboxes, comboboxes
•
A button on a toolbar usually displays a
picture and no text
•
How to create toolbar manually?
•
How to reuse the handler of the button or
the menu? Slide 20
Thêm tài liệu vào bộ sưu tập có sẵn:
Báo xấu
LAVA
ERROR:connection to 10.20.1.101:9315 failed (errno=111, msg=Connection refused)
ERROR:connection to 10.20.1.101:9315 failed (errno=111, msg=Connection refused)
Đang xử lý...