VB.NET Additional Topics

Slides:



Advertisements
Similar presentations
14-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Advertisements

COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Making a cartoon or slideshow. Aside VB comments An apostrophe starts a comment to end of line Some of the following slides have code with comments in.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Chapter 14 Additional Topics in Visual Basic Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
Odds and Ends Component Tray Menu and contextmenu Splash Screen.
Multiple-Document-Interface (MDI) Windows MDI programs enable users to edit multiple documents at once. MDI programs enable users to edit multiple documents.
MDI windows Single-document-interface (SDI)
Crystal Reports Programming In Visual Basic.NET. © 2001 by The McGraw-Hill Companies, Inc. All rights reserved Crystal Reports Gallery contains.
MENUS AND THE MENU EDITOR Elements of a Menu Menu bar Menu title Separator bar Menu items.
Multiple Document Interface (MDI) application
1 Multiple Document Interface (MDI) Windows. Single Document Interface (SDI) A program that can only support one open window or a document For Example,
Apply Sub Procedures/Methods and User Defined Functions
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
CHAPTER SIX Reducing Program Complexity General Sub Procedures and Developer-defined Functions.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 6 Multiple Forms.
Multiple Forms, Standard Modules, And Menus
CSCI 3327 Visual Basic Chapter 10: Windows Forms GUI: A Deeper Look UTPA – Fall 2011.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Lecture 8 Visual Basic (2).
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.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 8: Chapter 5: Slide 1 Unit 8 List Boxes and the Do While Looping Structure.
Tutorial 6 The Repetition Structure
Chapter 6 OOP: Creating Object-Oriented Programs Programming In Visual Basic.NET.
3.2 VB.NET Events An Event Procedure Properties and Event Procedures of the Form Tab Order of Controls Exercises.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Lesson 3 — Menus, MDIs, and Simple Loops Microsoft Visual Basic.NET, Introduction to Programming.
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.
Chapter 5 Menus, Sub Procedures and Sub Functions Programming In Visual Basic.NET.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Practical Programming COMP153-08S Lecture: Repetition.
CECS 5020 Computers in Education Forms and Menus.
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.
DateTime, Code Regions, and Multiple Form Applications Part13dbg.
Understanding Desktop Applications Lesson 5. Understanding Windows Forms Applications Windows Forms applications are smart client applications consisting.
Basic GUI VISUAL BASIC. BASIC GUI Slide 2 of 53 Topic & Structure of the lesson Introduction Data Validation Use controls for making choices Write Pull.
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.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
SDI & MDI SDI -> Single Document Interface
Computer Programming I
Chapter 1: An Introduction to Visual Basic 2015
Introduction to VB programming
Windows Forms GUI: A Deeper Look
Additional Topics in VB.NET
Chapter 13 Additional Topics in Visual Basic
Presentation transcript:

VB.NET Additional Topics Programming In Visual Basic.NET

Timer Control Place the control from the Toolbox on the form Appears in the Component Tray Prefix – tmr Interval property Between 0 and 65,535 milliseconds 1,000 milliseconds = 1 second Enabled property False (default) ==> Do not run Tick event True ==> Run Tick event at designated interval Tick event Runs as a loop, with iterations repeated every time the designated Interval elapses © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Moving Controls with Timer Use SetBounds to move or change size of a control Example: Moving control with Timer ctrName.SetBounds(intX, intY, intWidth, intHeight) Private Sub tmrMove_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrMove.Tick Const intSHIFT As Integer = 3I If mintX <= 400 And mintY <= 400 Then mintX += intSHIFT : mintY += intSHIFT picPlane.SetBounds(mintX, mintY, 30, 30) Else mintX = 0 : mintY = 0 tmrMove.Enabled = False End If End Sub © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

MDI versus SDI SDI = Single-Document Interface All we have created thus far Each form is in a separate window that acts independently form the other forms MDI = Multiple-Document Interface Like Word, Excel, etc. Forms display within the window of other forms © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Examining an MDI Application © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

MDI (Multiple-Document Interface) Parent form (main window) which "contains" other windows Many Child forms (document windows) "contained within" Parent window Parent and and active Child share menus Window menu Tile, Cascade, Arrange Icons, and Window List © 2001 by The McGraw-Hill Companies, Inc. All rights reserved. 4

MDI Environments Close Parent and all Child forms close also Child forms not allowed to "wander" out of the Parent's area; Child ALWAYS inside Parent Can combine MDI and SDI in VB Splash forms are usually not child forms Can have several documents open at one time accessible from Window menu © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Creating MDI Projects At design time designate a form as Parent IsMdiContainer property = True At run time designate Child forms Before displaying the Child form from the Parent set the Child's MdiParent property to the parent form Add a Window menu frmChildOne.MdiParent = Me © 2001 by The McGraw-Hill Companies, Inc. All rights reserved. 5

Designating Child Form Private Sub mnuDisplayChildOne_Click(ByVal sender _ As System.Object, ByVal e As System.EventArgs) _ Handles mnuDisplayChildOne.Click 'Display Child One Dim frmChildOne As New frmChildOne( ) frmChildOne.MdiParent = Me frmChildOne.Show End Sub © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Adding a Window Menu Parent form should include a Window menu to Allow the user to arrange multiple Child forms Allow the user to switch between windows Lists open Child forms set menu's MdiList Property to True © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Window Menu Arrange Options Use the LayoutMdi method to set the type of layout Examples Me.LayoutMdi(MdiLayout.TileHorizontal) Me.LayoutMdi(MdiLayout.TileVertical) Me.LayoutMdi(MdiLayout.Cascade) © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Displaying the Date and Time Now property holds system date and time Use DateTime methods: Generally set initial values in Form_load and use Timer to update the time Now.ToShortDateString Now.ToLongDateString Now.ToShortTimeString Now.ToLongTimeString lblDate.Text = Now.ToShortDateString lblTime.Text = Now.ToShortTimeString © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

Calendar Controls DateTimePicker MonthCalendar © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.

DateTimePicker Control Value Property Contains the date Initially set to current date User can select a date or your program can assign a date ValueChanged Event Prefix - dtm © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.