DateTime, Code Regions, and Multiple Form Applications Part13dbg.

Slides:



Advertisements
Similar presentations
14-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Advertisements

Home This training presentation is designed to introduce the Residency Management Suite to new users. This presentation covers the following topics: Login.
GoldSim Technology Group LLC, 2006 Slide 1 Advanced Container Options.
Excel Tutorial 6 Managing Multiple Worksheets and Workbooks
XP New Perspectives on Microsoft Access 2002 Tutorial 61 Microsoft Access 2002 Tutorial 6 – Creating Custom Reports.
© by Pearson Education, Inc. All Rights Reserved.
Chapter 6 Multiform Projects Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents.
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
MDI windows Single-document-interface (SDI)
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Multiple Document Interface (MDI) application
Chapter 8: String Manipulation
Excel 2007 Part (2) Dr. Susan Al Naqshbandi
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Visual Basic Chapter 1 Mr. Wangler.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Microsoft Office 2003 Illustrated Introductory with Programs, Files, and Folders Working.
Multiple Forms, Standard Modules, And Menus
Multiple Forms and Standard Modules
Chapter 6 Understanding the Structure of an Application: Procedures, Modules, and Classes.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
CSCI 3327 Visual Basic Chapter 10: Windows Forms GUI: A Deeper Look UTPA – Fall 2011.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI.
Lập trình trên Windows với Microsoft®.NET Giảng viên : Hồ Hoàn Kiếm.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
CST238 Week 4 Questions / Concerns? Announcements – Start thinking about project ideas – Test#1 next Monday, 4/28/14 Recap Check-off Take Home Lab#3 New.
JavaScript, Fourth Edition
Overview Introduction to Managing User Environments Introduction to Administrative Templates Using Administrative Templates in Group Policy Assigning Scripts.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
VB.NET Additional Topics
Lesson 11: Looking at Files and Folders what a file or folder is on the computer how to recognize a file or folder on the desktop how to recognize the.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Adobe Photoshop CS Design Professional WITH LAYERS WORKING.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
© 2008 General Parts International, Inc. Written permission is required to copy or forward to anyone other than the intended recipient. 1 © 2008 General.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Lesson 3 — Menus, MDIs, and Simple Loops Microsoft Visual Basic.NET, Introduction to Programming.
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
Understanding Desktop Applications Lesson 5. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Windows Forms Applications Understand.
6-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Project 5: Using Pop-Up Windows Essentials for Design JavaScript Level One Michael Brooks.
Unit 6 Repetition Processing Instructor: Brent Presley.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
Overview of Previous Lesson(s) Over View 3 Program.
Compound Data Types Part13dbg. 2 Point A Point is a simple built-in struct that stores a pair of screen coordinates. Instantiate a Point: Point aPoint.
Object-Oriented Programming: Inheritance and Polymorphism.
Understanding Desktop Applications Lesson 5. Understanding Windows Forms Applications Windows Forms applications are smart client applications consisting.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
SDI & MDI SDI -> Single Document Interface
14 Shipping Time App Using Dates and Timers
Standard Operating Procedure
Tutorial 9 Sequential Access Files and Printing
Object-Oriented Programming: Inheritance and Polymorphism
CIS 199 Final Review.
Chapter 13 Additional Topics in Visual Basic
Presentation transcript:

DateTime, Code Regions, and Multiple Form Applications Part13dbg

2 DateTime DateTime is used for storing and converting time and date values. The Now property of the DateTime object delivers the present time and date from the system clock. DateTime currentDateTime = DateTime.Now; The Today property of DateTime object is the date portion only. DateTime currentDate = DateTime.Today;

3 Working With DateTime Declare a DateTime object: DateTime myDT = new DateTime(); Get present time and date: myDT = DateTime.Now; Extract time or date value: lblDay.Text = myDT.DayOfWeek.ToString(); DayOfWeek, DayofYear, Day, Hour, Second, Month, Year properties allow access to various parts of DateTime.  DateTimeStruct

4 Formatting DateTime output Use Format Specifiers with ToString() or use ToLongDateString(), ToLongTimeString(), ToShortDateString(), or ToShortTimeString() methods. dDtTfFdDtTfF 6/4/2007 Monday, June 04, :00 AM 12:00:00 AM Monday, June 04, :00 AM Monday, June 04, :00:00 AM

5 Generate DateTime Values with DateTimePicker Control The DateTimePicker control furnishes a visible interface for selecting DateTime values. Dates are selected with a perpetual calendar display. Times and dates may be displayed in several formats. Use the TimeSpan class to manipulate and compare times and dates.  DatePicker

Code Regions Showing/Hiding and Creating Code Regions

7 Regions in Code We have seen before that the region, Windows Form Designer Generated Code, is a collapsible region. When we want to view the contents, we click the in front of region. To collapse the region, we click the in front of region.

8 Making Your Own Collapsible Regions in Code You can make your own collapsible region in code, for example, a region for the class-level variables. Type #region regionDescription above the class- level variable declarations. Type #endregion after the last line of class-level variable declarations. You will now have a user-defined region.

Multiple Form Applications Single Document Interface

10 Launching a Second Form Use the Add Windows Form… selection from the Project menu. A new form class is added to the project.

11 Launching a Second Form An instance of the second form must be created within the original application form. Once the form object is created, it may be displayed by running its Show() method. Multiple instances of the second form can be created and displayed.  SecondSDI

12 Startup Form as “Parent” Launching a second form in this way causes the second form to depend upon the first for survival. Closing the first form causes the second form to close as well.

13 Hiding a Form Run the Hide() method of the original form to remove it from view prior to showing the second form. Now the second form commands the application and can not lose focus unless it is closed. Closing the second form leaves the original form running, but not visible.  HideParent

14 Showing a Hidden Form We could run the Show() method of the original form from the second form—but only if the second form is aware of the first form If we created a new instance of the first form within the second form it would be different from the original. One way to solve the problem is to pass the identity of the original form to the second form as a constructor argument.

15 Identifying the Parent Form If the second form has a class scope variable of type Form, the constructor can use its argument to assign the identity of the “parent” form. This then allows the second form to run the Show() method of the “parent”.  FormConstructor

Multiple Form Applications Owned Forms

17 Owned Forms Subsequent SDI forms can be launched from a startup form as Owned Forms. Although these forms can transfer focus back to the startup form they remain on top of the startup form at all times. Add a new form to the Owned Forms collection of the startup form by setting its Owner property to the startup form.  OwnedForms

18 Owned Forms Potential uses for owned forms are as specialized help forms, customized “toolboxes” or overview maps. Use an owned form when you don’t want to lose sight of a form in a multiple SDI application, even if it loses focus.

Multiple Form Applications Multiple Document Interface

20 MDI Forms Standard Windows forms may exist as either MDI parents or MDI children. MDI children may only be displayed within the client area of their parent and may not be dragged outside that client area. Like owned forms, MDI children always remain on top of their parent form.

21 MDI Parent Forms Any standard Windows form can be converted to an MDI parent by setting its IsMdiContainer property to True. By convention, MDI parent forms have a dark gray client area. Because MDI parents are intended solely as containers for other forms, they should not include controls.

22 MDI Parent Forms Use menu items in the MenuStrip control of the MDI parent to control activities associated with displaying MDI child forms.  MDIParent

23 MDI Child Forms Forms destined to become children of an MDI parent should be instantiated within the MDI parent class. Any standard Windows form can become an MDI child. Set the MdiParent property of the child instance to the parent. Show the child form.  MDIChildren

24 MDI Child Form Menus When an MDI Child has focus within an MDI parent form, the menustrips of the Parent and Child are merged and menuitems from both are displayed. The merging of the menus to present a sensible display is coordinated by adjusting the MergeAction and MergeIndex properties of each menuitem. The Visible property of the child menustrip must be set to false if you do not wish to see both parent and child menustrips.

25 The Windows Menu By design convention the Menustrip of an MDI parent form has a Window menu item that lists the displayed child forms and indicates which has focus. The contents of this menuitem (mnuWindow) are automatically generated by simply setting the MdiWindowListItem property of the parent menustrip to the appropriate menuitem (mnuWindow).

26 The Window Menu Three different modes of display are available for child forms: cascade, horizontal tile, and vertical tile. These modes can be set with the LayoutMdi() method of the parent form. Use the foreach loop to close all forms in the child collection of the parent at once.  MDIWindows