Bài giảng Lập trình trên Windows với Microsoft.NET - Phần 8
Main Menu
Displays a menu at runtime
MainMenu can be created in two ways:
Using the MainMenu control, and menu designer at design time
Creating an instance of the MainMenu class at runtime
MainMenu myMainMenu = new MainMenu();
this.Menu = myMainMenu;
ToolBar
It is situated immediately below the menu bar
The buttons in a ToolBar are analogous to the items in a menu
Different button appearance options:
DropDownButton
Separator
ToggleButton
Trang 1
Trang 2
Trang 3
Trang 4
Trang 5
Trang 6
Trang 7
Trang 8
Trang 9
Trang 10
Tải về để xem bản đầy đủ
Bạn đang xem 10 trang mẫu của tài liệu "Bài giảng Lập trình trên Windows với Microsoft.NET - Phần 8", để tải tài liệu gốc về máy hãy click vào nút Download ở trên
Tóm tắt nội dung tài liệu: Bài giảng Lập trình trên Windows với Microsoft.NET - Phần 8
Lập trình trên Windows với Microsoft® .NET Giảng viên : Hồ Hoàn Kiếm SDI Application SDI (1) New Document An SDI application can have only one active window at a time Active Window Closed MDI Application MDI (2) Inner Window (or) Child Window Outer Window (or) Parent Window MDI Application Designing an MDI application IsMdiContainer = true MDI Application Activating and Deactivating Windows Deactivate child window Active child window MDI Application Types of Menu MainMenu ContextMenu As in MDI form during design As with the control at runtime Main Menu Displays a menu at runtime MainMenu can be created in two ways: Using the MainMenu control, and menu designer at design time Creating an instance of the MainMenu class at runtime 1 2 MainMenu myMainMenu = new MainMenu(); this.Menu = myMainMenu; Main Menu PROPERTIES EVENTS Select Popup Click Text ShortCut PerformSelect Parent PerformClick METHODS Index ShowShortCut MenuItems Context Menu Context menus give users access to frequently used commands by clicking the right mouse button Context menus are created with the help of the ContextMenu control ToolBar It is situated immediately below the menu bar The buttons in a ToolBar are analogous to the items in a menu Different button appearance options: DropDownButton Separator ToggleButton ToolBar control icon as in ToolBox Form Level and Control Level Validations Validate data in all the fields in the form Enable and Disable controls based on user input Main Events KeyPress KeyDown KeyUp Errors Description Syntax Error Occurs when we enter an incorrect line of code such as a mistake in typing a keyword, missing punctuation, or an incorrectly specified variable. Run-time Error Occurs when a command attempts to perform an invalid action. Logic Error Occurs when an application executes without syntax errors or run-time errors, but the results are not which were intended. Types of Errors ErrorProvider Control Properties Methods BlinkRate GetError BlinkStyle SetError ContainerControl Icon ErrorProvider control can be used to display an error icon when the user enters invalid data. Exception Handling throw try catch finally Exceptions can be handled with the help of :
File đính kèm:
- bai_giang_lap_trinh_tren_windows_voi_microsoft_net_phan_8.ppt