Using String Functions Left(str, nchars) - extract left nchars Right(str, nchars) - extract right nchars Mid(str,start,[nchars]) - get middle chars.

Slides:



Advertisements
Similar presentations
MS-Word XP Lesson 7.
Advertisements

Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
To open a new document, double click Word from the programs – or from an existing document, go to the file menu at the top left, and click new. Also from.
Microsoft Expression Web-Illustrated Unit L: Using Code Tools.
1 Visual Basic Programming II Lecture 3 MIS233 Instructor – Larry Langellier.
1 Lab6 Lab6 ComboBox Control Properties, Methods and Events.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-
Lab4 ListBox Control Properties, Methods and Events.
Microsoft Office 2007 Word Chapter 1 Creating and Editing a Word Document.
VB Default Controls List Box, Combo Box
Introduction to Computing Dr. Nadeem A Khan. Lecture 11.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab5 ListBox Control Properties, Methods and Events.
EXCEL BASICS WELCOME  TODAY’S CLASS WILL COVER :  Moving Around Excel – CELLS  Highlighting, Editing, Formatting.
Other Features Index and table of contents Macros and VBA.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
October 2003Bent Thomsen - FIT 3-21 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
Teach Yourself Windows 98 Module 2: Working with Files, Folders, and the Desktop.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter 7 Lists, Loops, and Printing Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
© 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 21 Fields and Forms.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
110 M - 1 ListBoxes & ComboBoxes Provide a list for the user to select from Various styles, choose based on –Amount of data to be displayed –Space available.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Tutorial 61 List Box Control Can be used to display a set of choices from which the user can select only one You also can create multi-selection list boxes.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Seven More on the Repetition Structure.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
6.3 List Boxes and Loops Some Properties, Methods, and Events of List Boxes List Boxes Populated with Strings List Boxes Populated with Numbers Searching.
MAT Meyer Week 2 Programming VB: ‘basics’ Review & preview: Events, variables, statements, etc. Images, Control arrays, For/Next Assignment: read.
Copyright © 2001 by Wiley. All rights reserved. Chapter 5: The Repetition Process in Visual Basic Event Driven Loops Determinate Loops Indeterminate Loops.
The Repetition Process in Visual Basic. The Repetition Process The capability to repeat one or more statements as many times as necessary is what really.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
ListBox, ComboBox, Menu Chapter 5.4, ComboBox Control: Properties & Methods u Combines TextBox features with a short drop- down list  cboOne.AddItem(string)
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
© 1999, by Que Education and Training, Appendix A, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
1 Project 7: Northwind Traders Order Entry. 2 Northwind Order Entry Extend the Select Customer program from Project 6 to permit the user to enter orders.
Basic Editing Lesson 2.
Microsoft Outlook 2010 Chapter 3 Managing Contacts and Personal Contact Information with Outlook.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab9 Control Array Print Method Printing VB Output.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Chapter 7 P 1 Lists and Loops List boxes and combo boxes List box - list of items - useful for a list which does not change Combo box - list of items -
Chapter 7 - Lists, loops and printing w List boxes and combo boxes several types can add items at design time or during run time user select from predefined.
Chapter 8.  Visual Basic includes several built-in mathematical functions ◦ Abs ◦ Sqr ◦ Sgn ◦ IsNumeric ◦ Round ◦ Format ◦ Pmt ◦ PV ◦ FV.
7-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
Microsoft Word 2010 Chapter 2 Creating a Research Paper with Citations and References.
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code that may be executed several times. Fixed-count (definite) loops repeat a fixed.
List Boxes and Combo Boxes Provides a list of items to select from Various styles — choose based on Space available Need to select from an existing list.
Unit 6 Repetition Processing Instructor: Brent Presley.
Microsoft Visual Basic 2012 CHAPTER FIVE Decision Structures.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code (loop body) that may be executed several times. Fixed-count (definite) loops repeat.
Chapter 5 Working with Multiple Worksheets and Workbooks Microsoft Excel 2013.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
ELECTRONIC GRADE GATHERING “EGG”. A COMPUTER RUNNING WINDOWS XP and Microsoft EXCEL SYSTEM REQUIREMENTS:
Microsoft Visual Basic 2008: Reloaded Third Edition
PDS OFFICE: STANDARD REPORTS & BEGINNING SELECTIONS
The List Box Control Items can be placed into the list at design time or run time The Sorted property causes items in the list to be sorted automatically.
Shelly Cashman: Microsoft Excel 2016
Learning the Basics of Microsoft Word 2010 for Microsoft Windows
Bent Thomsen Institut for Datalogi Aalborg Universitet
Presentation transcript:

Using String Functions Left(str, nchars) - extract left nchars Right(str, nchars) - extract right nchars Mid(str,start,[nchars]) - get middle chars str is any string, nchars is integer, and start is integer number of starting position. Len(str) returns # chars in string

String Functions Example Suppose a text box named txtName contains the following: Left(txtName.Text, 3) is “Wha” (without the quotation marks) Right(txtName.Text, 3) is “ob?” (without the quotation marks) Mid(txtName.Text, 6, 5) is “about” (without the quotation marks) Mid (txtname.Text, 6) is “about Bob?” (without the quotation marks) What about Bob? Text property of textbox called txtName

Using String Functions (2) String functions and looping facilitate the “zooming” feature of many Microsoft list boxes and combo boxes. “Zooming” causes a search of the list, refining the search with each additional keystroke the user enters.

Sending Info. to the Printer Visual Basic’s Print method applies to a Form, a printer object, the Debug window, or a picture box Printer.Print — sends output to printer Print is a method of the Printer object Printing is somewhat difficult, because VB is designed to use with forms, not printers

Formatting Lines Printer.print x, y, z prints in three "zones" Printer.print x;y;z ignores zones Trailing comma or semicolon causes next print method to continue the line Each.print starts on a new line Printer.print (alone) prints blank line

Formatting Lines Tab(20) advances to 20th position: Printer.Print Tab(20); "Name:" Spc(17) inserts spaces (17) in line Numbers print with one space for sign of # Printer.NewPage sends page to printer & goes to new page Printer.EndDoc sends page to printer & halts print job

Printing to Picture Box You can use Print method with a picture box to avoid actually printing a result: picMyPictureBox.Print "howdy" prints to a picture box

List Boxes & Combo Boxes List/Combo boxes allow a list of items Types include –simple combo boxes –dropdown combo boxes –dropdown lists Combo box has style property; list does not Combo box has design-time text property; list box has only run-time text property. Combo box does not have a MaxLength property; a list box does.

If the list is empty, then the ListCount is zero You can deselect all items in a list by setting the ListIndex property to -1 Set the ListIndex property to 0 to select (highlight) the first item in the list--remember that indexes run from 0 to n-1 ListCount holds the number of items in a list. Remember that ListCount is always one higher than the highest ListIndex. Display one of the items in a list by selecting the list object and referring to the ListIndex value as an index: –lstBookTypes(iValue) Add items to the list in code with: –lstSchools.AddItem “Purdue” –lstSchools.AddItem “University of San Diego” The Sorted property of the list keeps items in alphabetic order. Copy selected list item to a text box: –txtSelection.text = cboFruit.List(3) –txtSelection.text = cboFruit.List(cboFruit.ListIndex) Setting a list index to a value selects—highlights—the list item: –lstCoffeeTypes.ListIndex = 3 ‘Highlight the 4th item in list –lstCoffeeTypes.ListIndex = -1 'Deselect all in list

list boxes simple combo box (style 1) dropdown combo box (style 1) dropdown list (style 2)

List property design-time contents of list Filling the List You can fill the list at design- or run-time Fill at design time if list rarely changes –Click List property, type entry, press Ctrl+Enter –Make Sorted property true to keep list in order Fill at run time if list is volatile –Use AddItem method to add items –Form: object.AddItem value [,Index] –Example: lstFruits.AddItem "Apple"

List/Combo Box Methods AddItem - Add item to list cboFruits.AddItem "Kiwi" cboFruits.AddItem cboFruits.Text Clear - Delete all items from the list cboFruits.Clear

List/Combo Box Properties Sorted maintains list in order (if true) ListIndex holds user-selected item index number (begins at zero, -1 if none selected) ListCount is number of items in list List object.List(index) extracts string value of list item Setting the ListIndex property highlights a selection in the list

List/Combo box Events Change Occurs when user types text into combo box (list box does not have this) GotFocus Occurs when control receives control LostFocus Occurs when control loses control