MsgBox Function Displays one of Visual Basic’s predefined dialog boxes, which contains a message, one or more command buttons, and an icon After displaying.

Slides:



Advertisements
Similar presentations
VB Data Validation Unit 4. Input Validation Validating user input before it is written can improve the quality of the data stored. Good validation schemes.
Advertisements

Operational & Function Keys Notes 2
Microsoft Office XP Microsoft Excel
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
Using Macros and Visual Basic for Applications (VBA) with Excel
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
The Web Warrior Guide to Web Design Technologies
Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
1.
Form’s Events ISYS 562. Form Events Opening & closing form:Open, Close, Load, Unload Moving to and from the form: Activate, deactivate Moving from control.
Exploring Office Grauer and Barber 1 Creating More Powerful Applications: Introduction to VBA(Wk9)
CSC110 Fall Chapter 5: Decision Visual Basic.NET.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 4 Decisions and Conditions.
Using the Visual Basic Editor Visual Basic for Applications 1.
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.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Chapter 8: String Manipulation
Programming with Microsoft Visual Basic th Edition
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
© 1999, by Que Education and Training, Chapter 5, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
Using the Select Case Statement and the MsgBox Function (Unit 8)
Lab 9 – User Forms Design. User Forms What are user forms? –Known as dialog boxes –Major ways for getting user input An example of using user forms: Monthly.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Five More on the Selection Structure.
Get to Know Your Keyboard. Operational Keys Escape (Esc) – allows you to exit unwanted menus and dialog boxes Tab – used to indent; moves the cursor 5.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Productivity Programs Common Features and Commands.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Five More on the Selection Structure.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Working with option button, check box, and list box controls Visual Basic for Applications 13.
Tutorial 51 Programming Structures Sequence - program instructions are processed, one after another, in the order in which they appear in the program Selection.
IS437: Spring 2006 Instructor: Dr. Boris Jukic Controls.
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
BIM211 – Visual Programming Interacting with Users Graphics 1.
1.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
Computer-made Decisions Chapter 3 & 4. Overview u Variable Scope u Conditionals  Relational Operators  AND, OR, NOT u If Statements u MsgBox function.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
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.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Visual Basic. The Close Method The Close method is used to close a form. To close a form use the keyword Me to refer to the form. Me.Close()
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
ME 142 Engineering Computation I Interacting with Spreadsheets.
MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M. Romi: PPU- IT Dept.
Chapter 6 - Visual Basic Schneider1 Chapter 6 Repetition.
Implement User Input Windows Development Fundamentals LESSON 2.4A.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Custom Dialog Box Alternatives And Dealing with FileNames Joanna Wyrobek.
Palitha Baddegama. Divisional Computer Resource Centre Hingurakgoda Visual basic 6.0.
Topics Graphical User Interfaces Using the tkinter Module
Variables and Arithmetic Operations
Predefined Dialog Boxes
WEB PROGRAMMING JavaScript.
Introduction to Programming
MsgBox, InputBox, and other Day 7 stuff.
Presentation transcript:

MsgBox Function Displays one of Visual Basic’s predefined dialog boxes, which contains a message, one or more command buttons, and an icon After displaying the dialog box, the MsgBox function waits for the user to choose a button, then returns a value that indicates which button the user selected

MsgBox Function Syntax: MsgBox(prompt[, buttons][, title][,helpfile, context]) prompt is the message you want displayed buttons is a numeric expression that specifies the number and type of buttons, the icon, the default button, and the modality title is a string expression displayed in the title bar

buttons Argument ConstantValueDescription vbOKOnly0Display OK button only. vbOKCancel1Display OK and Cancel buttons. vbAbortRetryIgnore2Display Abort, Retry, and Ignore buttons. vbYesNoCancel3Display Yes, No, and Cancel buttons. vbYesNo4Display Yes and No buttons. vbRetryCancel5Display Retry and Cancel buttons. vbCritical16Display Critical Message icon. vbQuestion32Display Warning Query icon. vbExclamation48Display Warning Message icon. vbInformation64Display Information Message icon. vbDefaultButton10First button is default. vbDefaultButton2256Second button is default. vbDefaultButton3512Third button is default. vbDefaultButton4768Fourth button is default. vbApplicationModal0Application modal; the user must respond to the message box before continuing work in the current application. vbSystemModal4096System modal; all applications are suspended until the user responds to the message box.

Return Values ConstantValueDescription vbOK1OK vbCancel2Cancel vbAbort3Abort vbRetry4Retry vbIgnore5Ignore vbYes6Yes vbNo7No

Keyboard Processes

Low Level Keyboard Handlers Three events recognized by forms and any control that accepts keyboard input –KeyDown - As any key is pressed –KeyUp - as any key is released –KeyPress -When any ASCII Character key is pressed Only the object that has the focus can accept a key event A Form has the focus only if the form is active and no control on the form has the focus

KeyPress Event Is passed only the integer ASCII equivalent of the key pressed and no other information. Not all keys generate a KeyPress event - only those which have an ASCII equivalent –numbers, letters, punctuation, BACKSPACE, TAB, Ctrl-a through Ctrl-z, Ctrl-[, Ctrl-], Ctrl-BACKSPACE –ESC (unless there is a command button with Cancel = True) –ENTER (unless there is a command button with Default = True) For example, to force all characters in a textbox to be uppercase as entered: Private sub text1_keypress(KeyAscii as Integer) KeyAscii = Asc(Ucase(Chr(KeyAscii))) end Sub

KeyDown and KeyUp Events Different from keypress in a similar way that mouseup/down is different from the click event KeyUp/Down report the exact physical state of the keyboard itself You must interpret what that state represents –example: KeyPress treats a and A as two separate characters, returning different codes. The KeyUp/Down will return the same code for both. Exceptions –ESC if there is a command button with Cancel = True –ENTER if there is a command button with Default = True –TAB –Any key for which a menu Shortcut key has been defined

KeyDown and KeyUp Events (2) The KeyUp/Down events receive two arguments –keycode - indicates the physical key pressed a and A are the same Key and return the same code 2 on the typewriter keypad and 2 on the numeric keypad are different keys and return different codes Use the vbConstants to refer to them (use the Object Browser). For example: vbKey2, vbKeyHome, vbKeyNumpad2 keycodes for the letter keys are the same as the ANSI codes of the uppercase letter keycodes for the number and punctuation keys are the same as the ANSI code of the number on the key

KeyDown and KeyUp Events (3) –Shift - almost the same as Shift for mouse events with the value 1 indicating the Shift key was depressed 2 indicating the Ctrl key was pressed 4 indicating the Alt key was pressed All 8 combinations are possible (0-7)

Option Buttons Used in situations where you want to limit the user to only one of two or more related and mutually exclusive choices. Only one in a group can be selected (on) at any one time. When selected, an option button’s Value property contains the Boolean value True; otherwise it contains the Boolean value False.

Option Buttons Minimum number in an interface is two Recommended maximum number is seven Use sentence capitalization for the caption Assign a unique access key A default button should be selected when the interface first appears.

Option Buttons You must use a frame control if you want the interface to contain more than one group of option buttons Set the TabIndex property of the option buttons in each group so that the user can use the up and down arrow keys to select another button in the group.

Frame Control Acts as a container for other controls Used to visually separate controls from one another The frame and the controls contained within the frame are treated as one unit You must use a frame control if you want to have more than one group of option buttons Use sentence capitalization for the optional caption

Check Box Used in situations where you want to allow the user to select any number of choices from one or more independent and non-exclusive choices. Any number of check boxes can be selected at any one time. When selected, a check box’s Value property contains the number 1 (vbChecked). When unselected, it contains the number 0 (vbUnchecked).

Check Box Use sentence capitalization for the check box’s Caption Assign a unique access to each check box You also can use the spacebar to select/deselect a check box that has the focus