1. Trang chủ
  2. » Công Nghệ Thông Tin

Session 4: MDI Applications doc

29 165 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Slide 1

  • Review

  • Review Contd…

  • Objectives

  • SDI

  • Drawbacks of using SDI

  • MDI

  • MDI Contd…

  • Design an MDI application

  • Characteristics of MDI Components

  • Characteristics of MDI Components Contd…

  • Activating and Deactivating Windows

  • Arranging Child Windows

  • Menus

  • Types of Menus

  • MainMenu Control

  • Slide 17

  • Slide 18

  • ContextMenu

  • Adding and Removing Menu Items

  • Menu-A Programmer’s Viewpoint

  • ToolBar

  • ToolBar Contd…

  • Mouse Events

  • Status Bar

  • Slide 26

  • User Defined Dialog boxes

  • FolderBrowserDialog Component

  • Summary

Nội dung

Session 4 MDI Applications Windows Forms / Session 4 / 2 of 29 Review  Different Print support controls supported by Win Forms are:  PrintDocument  PrintPreviewControl  A Dialog box is a temporary window that contains controls to display information or accept choices from use.  Depending on the nature of behavior, a dialog box may be classified as: Modal and Modeless  OpenFileDialog : Used to open files.  PageSetUpDialog : Used to set the Page options such as Paper size, Left margin and Right margin.  FontDialog : Used to specify the font specifications such as the font name, size and color. Windows Forms / Session 4 / 3 of 29 Review Contd…  ColorDialog : Used to select a color. Displays a wide variety of colors and allows us to select from those displayed colors.  SaveFileDialog : Used to specify the filename and save files.  PrintPreviewDialog : Used to view how the document would look after printing.  PrintDialog : Used to set print specifications such as number of copies, the printer and what is to be printed.  The MessageBox dialog is used to display messages.  Some of the Visual Effects supported in WinForms :  Transparent Forms  Control Docking  Control Anchoring  Visual Inheritance Windows Forms / Session 4 / 4 of 29 Objectives  Differentiate between SDI and MDI  Create an MDI application  Create Menus and Menu Components  Discuss the ToolBar and StatusBar controls  Create User defined dialog boxes Windows Forms / Session 4 / 5 of 29 SDI FileNew Document An SDI application can have only one active window at a time Windows Forms / Session 4 / 6 of 29 Drawbacks of using SDI  Cannot handle multiple forms at the same time  Multiple copies of the application have to be opened to handle multiple forms at the same time Windows Forms / Session 4 / 7 of 29 MDI Multiple documents MDI applications group multiple documents as a single unit  A window is the base for all interfaces  MDI applications handle multiple windows simultaneously Windows Forms / Session 4 / 8 of 29 MDI Contd… New Document Inner Window (or) Child Window Outer Window (or) Parent Window Windows Forms / Session 4 / 9 of 29 Design an MDI application IsMdiContainer = true To add a child form to the MDI form:  Add a new form  Add the code to call the child form Windows Forms / Session 4 / 10 of 29 Characteristics of MDI Components  Features of the Parent Form :  Displayed as soon as the MDI application is started  Acts as the container for other windows  Menus of the child form are displayed on the parent form  Can be only one MDI parent form in an application  Multiple child forms can be open at a time [...]... RootFolder Property is used to set the topmost folder in the hierarchy Windows Forms / Session 4 / 28 of 29 Summary        Single Document Interface (SDI) is made up of a single document or form, or multiple forms that are not grouped together Multiple Document Interface (MDI) is made up of multiple documents and all the documents are grouped together under a common interface The MainMenu control displays... window is the same as that of the MDI window Windows Forms / Session 4 / 12 of 29 Arranging Child Windows Cascade Tile Windows Forms / Session 4 / 13 of 29 Menus Main Menu Option Menu bar Sub Menu Option Windows Forms / Session 4 / 14 of 29 Types of Menus As in Toolbox icon As in Toolbox icon As in MDI form during design As with the control at run time Windows Forms / Session 4 / 15 of 29 MainMenu Control...Characteristics of MDI Components Contd…   The Child forms cannot be moved out of the MDI frame area Closing the MDI form automatically closes all open MDI child forms Child Form opened Controls, other than Menus, ToolBar and StatusBar, placed on the MDI form, overlap the child form Windows Forms / Session 4 / 11 of 29 Activating and Deactivating Windows Inactive... class at run time Windows Forms / Session 4 / 16 of 29 MainMenu Control Contd… Properties Methods GetForm IsParent GetContextMenu MdiListItem GetMainMenu MenuItems MergeMenu Windows Forms / Session 4 / 17 of 29 MenuItem Properties Methods Index Text ShowShortCut Checked PerformSelect Parent PerformClick MdiList DefaultItem ShortCut Events Select Click Popup Windows Forms / Session 4 / 18 of 29 ContextMenu... control icon as in StatusBox Windows Forms / Session 4 / 25 of 29 StatusBar Contd… StatusBar Properties ShowPanels Panels Panel Properties Parent Style BorderStyle Windows Forms / Session 4 / 26 of 29 User Defined Dialog boxes Add a new form to the project MaximizeBox MinimizeBox ControlBox FormBorderStyle = false = false = false = Fixeddialog Windows Forms / Session 4 / 27 of 29 FolderBrowserDialog Component... ToggleButton Windows Forms / Session 4 / 22 of 29 ToolBar Contd… Properties ToolBar buttons Properties ToolTipText ButtonSize Parent DropDownArrows PartialPush ShowToolTips Buttons Wrappable EVENTS ButtonClick ButtonDropDown Style ImageIndex DropDownMenu Windows Forms / Session 4 / 23 of 29 Mouse Events MouseEnter Mouse Down MouseMove MouseUp MouseHover MouseLeave Windows Forms / Session 4 / 24 of 29 Status... if(Convert.ToString(preference1)=="Yes") { mainMenu1.MenuItems.RemoveAt(2); / }Session 4 / 20 of 29 Windows Forms } Menu-A Programmer’s Viewpoint     A menu is a control There is no standard “look” associated with a menu A name is associated with each menu item The name is specified at the time of creating the menu Windows Forms / Session 4 / 21 of 29 ToolBar   It is situated immediately below the menu... display it ContextMenu ContextMenu1 = new ContextMenu(); this.ContextMenu = ContextMenu1; The ContextMenu control supports all the properties, methods and events of the MainMenu control Windows Forms / Session 4 / 19 of 29 Adding and Removing Menu Items MainMenu mainMenu1=new MainMenu(); MenuItem addItem = new MenuItem(); MenuItem removeItem = new MenuItem(); addItem.Text = "&Add"; removeItem.Text =... user of the status of an application FolderBrowserDialog component provides a modal dialog box to browse through and select folders You can also create new folders using this component Windows Forms / Session 4 / 29 of 29 . Windows Forms / Session 4 / 7 of 29 MDI Multiple documents MDI applications group multiple documents as a single unit  A window is the base for all interfaces  MDI applications handle. Forms / Session 4 / 8 of 29 MDI Contd… New Document Inner Window (or) Child Window Outer Window (or) Parent Window Windows Forms / Session 4 / 9 of 29 Design an MDI application IsMdiContainer =. Session 4 MDI Applications Windows Forms / Session 4 / 2 of 29 Review  Different Print support controls supported by Win Forms are:  PrintDocument  PrintPreviewControl  A

Ngày đăng: 09/07/2014, 17:20