Programming with Microsoft Visual Basic th Edition

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

Chapter 1: An Introduction to Visual Basic 2012
Using Multiple Forms! Creating a Splash Screen. Uses of Multiple Forms Includes: Dialog Boxes (appear often in Windows Programs) Splash Screen (a window.
Chapter 7: Sub and Function Procedures
Chapter 6 Multiform Projects 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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Seven Sub and Function Procedures.
Introduction to VB.NET Tonga Institute of Higher Education.
Microsoft Visual Basic 2005: Reloaded Second Edition
Multiple Forms, Standard Modules, And Menus
Multiple Forms and Standard Modules
Programming with Microsoft Visual Basic th Edition
IT 211 Project Integration and Deployment Lab #11.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Review for Mid-term! October 26, Review Homework Worksheet True or False Operators are symbols that perform specific operations in Visual Basic.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
6-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
2-1 Chapter 2 Using VB.NET to Create a First Solution.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
Chapter 4: Do-It-Yourself Designing (Designing Interfaces)
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Visual Basic Fundamental Concepts
Chapter 1: An Introduction to Visual Basic .NET
PictureBox, MessageBox, Multiple Forms, Splash Screens and Timers
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2012
Chapter 1: An Introduction to Visual Basic 2015
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming UTPA – Fall 2012 This set of slides is revised from lecture.
3.01 Apply Controls Associated With Visual Studio Form
Programming with Microsoft Visual Basic th Edition
3.01 Apply Controls Associated With Visual Studio Form
Chapter 1: An Introduction to Visual Basic 2015
Programming with Microsoft Visual Basic th Edition
Visual Basic..
Multi-form applications and dialogs
Chapter 6 Multiform Projects
CIS16 Application Development Programming with Visual Basic
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Programming with Microsoft Visual Basic 2012 6th Edition Create an Application with Multiple Forms

Adding an Existing Form to a Solution Add an existing form to Chap07/Harvey Industries Solution Make sure that added form uses a different form name from any form name of Harvey Industries Solution in Visual Studio (Use Windows Form Designer to change (Name) property) disk file system (xxx.vb) The splash screen for Country Charming Inn is to be integrated into Harvey Industries Solution The splash screen identifies the application’s author and copyright year, or shows welcome message 實作練習 : 需下載 Chap07/ Harvey Industries Solution Chap07/Splash Solution Chap07/Playtime Solution

Adding an Existing Form to a Solution Figure : Completed splash screen 3

Adding an Existing Form to a Solution Rename the form in Splash Solution Project->加入現有項目->Find Splash Form.vb to add Open a new form by Timer’s Tick event Add following codes in the Tick event of the timer tmrExit Me.Hide() tmrExit.Enabled = False frmMain.ShowDialog() Me.Close() Syntax used to instruct the computer to create an object from a class: Dim variablename As New classname , e.g., to create a form Dim mForm As New frmMain Otherwise, the form frmMain will show up many times. The name of the main form in Harvey Industries Solution 4

Include Image File for the Added Form VB doesn’t import image files automatically for the added form. You can do it by one of the following steps Make the statement Me.picCountry.Image = …… as a comment Click Splash Form’s PictureBox picCountry Use the task box of the PictureBox to set up its image file (image file is in the Resources folder of the Chap07/Splash Solution ) 5

Assigning the Startup Form When an application is started, VB.NET automatically invokes the form set as the Startup object of a project The setup steps for Startup object are as follows: Right click on the project in the Project Explorer Window to open the Properties Window Click the Application tab in Properties Window Click the Startup object ComboBox to set up the startup form → choose frmSplash 6

ShowDialog() vs. Show() Method A form object’s ShowDialog() method allows you to display the form object on the screen with focus transfer (dialog-style interaction) The syntax is: form.ShowDialog() The form object’s Show() method allows you to display a form object on the screen without focus transfer The syntax is: form.Show () 7

Show Another Form by a Button Download Chap07/Playtime Solution, Chap07/Harvey Industries Solution How to use a button to open a new form Project->加入現有項目->Find Playtime Form.vb to add Include Image File for the PictureBox PictureBox1 Add following codes in the Click event of a button Show Playtime on the Harvey Industries’ MainForm Me.Hide() frmPlaytime.ShowDialog() Me.txtName.Text = frmPlaytime. txtName.Text Me.Show() frmPlaytime.Show() or .ShowDialog() ‘Show 2 forms frmPlaytime.Focus() (when using frmPlaytime.Show() ) The name of main form in Playtime Solution Value passing between two forms 8 8