Window (further define the behaviour of objects)

Similar documents
CT862 Section 1 Introduction

Agenda. First Example 24/09/2009 INTRODUCTION TO VBA PROGRAMMING. First Example. The world s simplest calculator...

INTRODUCTION TO VISUAL BASIC 2010

CS 150 Lab 3 Arithmetic and the Debugger. Lab 3.0 We are going to begin using the Visual Studio 2017 debugger to aid with debugging programs.

Extending the Unit Converter

Text box. Command button. 1. Click the tool for the control you choose to draw in this case, the text box.

Using Visual Basic Studio 2008

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Skill Area 336 Explain Essential Programming Concept. Programming Language 2 (PL2)

FOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources

Computer Science Lab Exercise 2

Creating a Text Frame. Create a Table and Type Text. Pointer Tool Text Tool Table Tool Word Art Tool

Update Service for EASY-SOFT

FIT 100. Lab 8: Writing and Running Your First Visual Basic Program Spring 2002

Display Input and Output (I/O)

Two scenarios are presented to illustrate updating the future year 2040 network. They are:

More Skills 11 Capture a Screen with the Snipping Tool

Boolean Expressions. So, for example, here are the results of several simple Boolean expressions:

Hands-on Lab 1: LabVIEW NI-DAQ Basics 1

CS 105 Lab As a review of what we did last week a. What are two ways in which the Python shell is useful to us?

PROGRAMMING LANGUAGE 2 (SPM3112) NOOR AZEAN ATAN MULTIMEDIA EDUCATIONAL DEPARTMENT UNIVERSITI TEKNOLOGI MALAYSIA

Exercise 5: Basic LabVIEW Programming

A Hands-on Experience with Arc/Info 8 Desktop

Visual C# Program: Temperature Conversion Program

Learn the three palettes. Learn how data is passed in LabVIEW. Create a subvi using two different methods.

Lecture 7: Functions. CS1068+ Introductory Programming in Python. Dr Kieran T. Herley 2018/19. Department of Computer Science University College Cork

END-TERM EXAMINATION

GETTING STARTED WITH MAPOBJECTS LT USING VISUAL BASIC

To complete this project, you will need the following folder:

Spring CS Homework 3 p. 1. CS Homework 3

To learn more about the Milestones window choose: Help Help Topics Select the Index tab and type in the feature. For Example toolbox.

TFA. KlimaLogg Pro. User Manual. Revision: 1.1

17. Introduction to Visual Basic Programming

Exercise 2b: Applying Entity Attributes, Masking, and Creating Groups

GRAPHIC WEB DESIGNER PROGRAM

182 Introduction to Microsoft Visual InterDev 6 Chapter 7

Application Note. PowerStar 5/6 - LabView VI Integration

Quick Trial Balance Pro - Accounting Cycle. Accounting Cycle: Home Screen

Lab 2: Introduction to mydaq and LabView

Experiment 8 SIMULINK

Microsoft Visual Basic 2005: Reloaded


Virtual Desktop Infrastructure Setup for Android

GIS LAB 1. Basic GIS Operations with ArcGIS. Calculating Stream Lengths and Watershed Areas.

OpenStax-CNX module: m Thermometer VI * National Instruments

Web Services Introduction to Web Services Web Services can convert your applications into Web-applications. Web Services are published, found, and

Modification of an Existing Workflow

The New Enhancements in ModelBuilder in ArcGIS 10

2 USING VB.NET TO CREATE A FIRST SOLUTION

Visual Studio.NET enables quick, drag-and-drop construction of form-based applications

LESSON A. The Splash Screen Application

The LabVIEW Programming Environment and Basic Operations

Interaction Style Categories. COSC 3461 User Interfaces. Windows. Window Manager

10.4 Inputs without Waiting

1) Log on to the computer using your PU net ID and password.

Create a worksheet that collects, displays and saves temperature data

How to import a WSDL Data Source and Prepare it for Use in Framework Manager

The first program we write will display a picture on a Windows screen, with buttons to make the picture appear and disappear.

LESSON B. The Toolbox Window

Free Microsoft Office 2010 training from MedCerts. Course Outline

CUSTOMISE FIELDS AND LAYOUTS 2010

Setup Examples. RTPView Project Program

igrafx Self-Paced Training Companion

AEMLog users guide V User Guide - Advanced Engine Management 2205 West 126 th st Hawthorne CA,

The File menu contains all the operations that we will discuss in this lesson: New, Open, Close, Save and Save As.

Tutorial 1 Exploring ArcGIS

Introduction to LabVIEW Exercise-1

Viewer. Quick Reference Guide

Activity Graphical Analysis with Excel and Logger Pro

introduction Objective Modelling the cover

Introduction to the Visual Studio.NET Integrated Development Environment IDE. CSC 211 Intermediate Programming

Nikon Capture NX "How To..." Series

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

SYSTEM DESIGN SPECIFICATIONS ZIGBEE BASIC SYSTEM

Word 2016 Advanced. North American Edition SAMPLE

PDU Utility. User Manual

CPE 101, reusing/mod slides from a UW course (used by permission) Lecture 5: Input and Output (I/O)

ACCOUNT MANAGEMENT IN COLOR iqc / imatch

DW DIGs Model Windows Tricks

Quick Start Guide for. uezgui wqs. Copyright 2010, Future Designs, Inc., All Rights Reserved, Rev 1.0

CENTURION Pro Diagnostic Motorcycle Scan Tool USER S GUIDE. Version 1.0

This section provides an overview of the features available within the Standard, Align, and Text Toolbars.

About Boxoft All to AMR Converter

Procedures. This is a common situation -- there is some functionality that computers should have that the do not the solution is to write a procedure

Chapter 1 GUI Applications

Connecting OSI PI Client to Top Server

Quick Reference Card. GeneChip Sequence Analysis Software 4.1. I. GSEQ Introduction

CS 115 Exam 1, Fall 2015 Thu. 09/24/2015

Paint Tutorial (Project #14a)

Thermacam Reporter 2000 Professional Template Building Tutorial

Windows 2000 Safe Mode

AEMLog Users Guide. Version 1.01

KingSCADA Quick Start Manual How to create a new project

LAB: INTRODUCTION TO FUNCTIONS IN C++

Linux Command Homework Individual/Team (1-2 Persons) Homework Assignment Turn In One Copy Per Person 5 Points

1. Brief introduction of PDF Pinter

NI LabView READ THIS DOCUMENT CAREFULLY AND FOLLOW THE INSTRIUCTIONS IN THE EXERCISES

Getting Started. Microsoft QUICK Source 7

Operating Manual SMMS WAVE TOOL FILE CONVERTER

Import and preprocessing of raw spectrum data

Transcription:

Introduction to Visual Basic Visual Basic offers a very comprehensive programming environment that can be a bit overwhelming at the start. The best rule is to ignore all that you do not need until you need it! Make sure that you get help from the lab tutors if you are unsure. When you startup Visual Basic, you are presented with a New Project and a default option to Open a Standard EXE application. Choose Open. The VB environment looks like this: Menus (some choices must be further specified through dialog boxes) Toolbar (quick access to some commands) Project Window (display a form in the form design window, or its code in the code window) Properties Window (change the appearance and/or behaviour of objects) Toolbox (create objects) Code Form design window (design the appearance of objects on your forms) Window (further define the behaviour of objects)

Terminology Project: Collection of forms, code modules. Project Window lists all the files in the application. Form: Window that displays controls and graphics useful to the overall project. Can be private (normal) or public. Code Window: To make application respond to events, code is written for the required events eg. click command button (click event) or enter text (keypress event) Properties Window: Allows programmer to set the properties of each object eg. name, caption etc.. Toolbox: Allows programmer to easily create the desired GUI by selecting the appropriate controls. A First Application: A VB application to convert temperatures between Fahrenheit and Celsius. The Temperature Conversion application consists of these elements: Recall the steps to creating an application: 1. Design the interface. 2. Plan properties. 3. Plan code. 4. Implement each of the above 1. Create the interface. To create an application, you first need to open a new project: choose the New Project command from the File menu. Every new project automatically contains one form. (You can add as many additional forms as your application needs.) The Temperature Conversion application requires only one form:

Next, you can select the tools you need from the Toolbox to draw the controls you want on the form. In this application, 2 text boxes will accept user input and display text. To create a control, select the tool from the Toolbox, and then hold down the left mouse button while dragging out an area on the form. For this application, you will require 2 text boxes and 2 labels. 2. Set properties. You set the properties of a control in the Properties window. When you select a form or control, its properties and their settings are displayed in the Properties window. You use the Name property to refer to a control in code. In this case, we'll make txtcels the name of this text box.

The Caption property specifies the text that is displayed in the control. We'll change the label's Caption property to "Celsius". We'll also change the Name property of the other text box to txtfahr and the Caption property of its label to "Fahrenheit". 3. Write code. We now need to add code to make the application respond to the user's actions. As with any programming language, you need to develop your algorithm at this stage before attempting to enter code. When you double-click a control, the focus shifts to the Code window. The name of the control appears in the Object list box. The Procedure list box contains a list of events for the control. Since we want to run the code in this application when a user presses a key, we'll select the KeyPress event from the Procedures list box.

We'll use the following formulae to convert the temperatures: Cels = (Fahr - 32) * 5/9 Fahr = (Cels * 9/5) + 32 We'll enter the code for the event procedure: (Recall ASCII codes) We must also attach a similar event procedure to the other text box, which will update the Celsius text when Fahrenheit is changed by the user (cf Lab Assignment) Saving Your Work Please ensure that you save your work correctly on the Network Drive (Not the local hard drive). Create a separate directory/folder for each of your assignments and use this directory/folder for your work. Use Save Project As..from the File menu to save the finished project It will ask you to save your forms first. Make sure you select the correct folder in which to save your work. It will then ask you to save the overall project. Choose an appropriate name. Running your application To run your application use Start from the Run menu.