intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

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

42
lượt xem
4
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.

Chủ đề:
Lưu

Nội dung Text: Lecture Windows programming: Chapter 3(3) - Châu Thị Bảo Hà

  1. Chapter 3 Windows Programming Cont’d 1
  2. Contents • Introduction to Windows Form Application • Introduction to Form • Introduction to Control • Events • Some common Controls • Some advanced Controls Slide 2
  3. Some advanced controls 1. DomainUpDown, NumericUpDown 2. MonthCalendar, DateTimePicker 3. Timer, TrackBar, ProgressBar 4. MenuStrip, ContextMenuStrip 5. ToolStrip 6. StatusStrip Slide 3
  4. NumericUpDown, DomainUpDown • NumericUpDown – Minimum property – Maximum property – Increment property – Value property – ValueChanged event • DomainUpDown – Items property – Sorted property – SelectedIndex property Slide 4
  5. DomainUpDown example 5
  6. MonthCalendar, DateTimePicker MonthCalendar DateTimePicker • SelectionStart property • Format property • SelectionEnd property • Value property • SelectionRange property • MaxDate property • MinDate property Slide 6
  7. Timer • Timer: is a component that raises an event at regular intervals – Interval property – Enabled property – Start() method – Stop() method – Tick event Slide 7
  8. Timer example 8
  9. Timer example • How to do?
  10. Timer example • How to do? Khai báo  trình xử lý sự  kiện Tick
  11. TrackBar • Properties – Minimum – Maximum – Orientation – TickFrequency – TickStyle – Value • Exent – Scroll: occurs when the slider moves – ValueChanged Slide 11
  12. 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;
  13. ProgressBar • Properties – Minimum – Maximum – Value – Step – Style • Methods – PerformStep() – Increment(int value) Slide 13
  14. ProgressBar example
  15. ProgressBar example • How to do? Max = 100 Min = 0 Step = 10
  16. ProgressBar example • How to do?
  17. 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
  18. 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
  19. ContextMenuStrip example Slide 19
  20. 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
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2