These materials where developed by Martin Schray. Please feel free to use and modify them for non-commercial purposes. If you find them useful or would.

Slides:



Advertisements
Similar presentations
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 6- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
Advertisements

Chapter 6, Slide 1Starting Out with Visual Basic 3 rd Edition Chapter 6 Sub Procedures And Functions.
Practical Programming COMP153-08S Lecture: Repetition Continued.
Creating Custom Controls ISYS 512/812. Inheritance The process in which a new class can be based on an existing class, and will inherit that class’s interface.
VB.Net Loops.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
Visual Studio 2005 Using the DataGridView Control V. Matos Cleveland State University.
VB.NET Database Tools ISYS Net Applications OLE DB Provider OLE DB Data Source OLE DB Provider ODBC Data Source SQL Server Data Source SQL Server.Net.
.Net Overview Data Driven Desktop and Web Applications using VB.Net and ASP.Net, C#.Net or J#.Net.
Multiple Forms & Procedures. Form Methods: –Show, Hide, Activate, Close Events: –Load, Activated, Closing, Closed.
VB.NET Database Tools ISYS 573. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
More on lists, exceptions, loops and validation. You can use the exception to indicate the error that occurred Private Sub btnCheck_Click(ByVal sender.
Inheritance and User-Defined Controls. Inheritance The process in which a new class can be based on an existing class, and will inherit that class’s interface.
1 Multiple Document Interface (MDI) Windows. Single Document Interface (SDI) A program that can only support one open window or a document For Example,
110-C1 Chapter 2 of the text: _ text boxes, group boxes, check boxes, radio buttons, picture boxes _ defining access keys tab sequence setting the focus.
Chapter 8 Using Repetition with Loops and Lists. Class 8: Loops and Lists Write Do loops to execute statements repeatedly Write For loops to execute statements.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Directory and File. Access Files in a Directory Name space: System.IO The Directory and File classes contain only shared methods that set or return information.
Printer & Dialog boxes Engr. Faisal ur Rehman CE-105T Spring 2007.
Plus Series DLL Introduction. DLL Compare for Plus Series DLL Item EZ2000.dllEZWeb.dll (for.Net) OS supportWindow 98 or latest (32bits) Windows 98 or.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Lecture 8 Visual Basic (2).
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
1 CC111 Lec9 : Visual Basic Visual Basic (3) Lecture 9.
VB Procedures. Procedures. Sub procedure: Private/Public Sub SubName(Arguments) … End Sub Private: Can only be accessed by procedures in the same form.
使用 SQL 指令執行報表 不需設定 Crystal Report 連線.
VB.NET Additional Topics
Visual Basic.NET Windows Forms Hello World Homework Assignment.
COM148X1 Interactive Programming Lecture 7. Topics Today HCI Event Handling.
These materials where developed by Martin Schray. Please feel free to use and modify them for non-commercial purposes. If you find them useful or would.
1 COMP3100e Developing Microsoft.Net Applications for Windows (Visual Basic.Net) Class 6 COMP3100E.
IMS 3253: Subroutines 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Procedures Subroutines Parameters –By Value.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
ADO.NET Objects – Data Providers Dr. Ron Eaglin. Requirements Visual Studio 2005 Microsoft SQL Server 2000 or 2005 –Adventure Works Database Installed.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 10: Chapter 6: Slide 1 Unit 10 Sub Procedures and Functions Chapter 6 Sub.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
VB Classes ISYS 512/812. Object-Oriented Concepts Abstraction: –To create a model of an object, for the purpose of determining the characteristics (properties)
4-1 Chapter 4 The Selection Process in VB.NET. 4-2 Learning Objectives Understand the importance of the selection process in programming. Describe the.
Enumeration.
1 Project 3 The Kumquat Society Conference. 2 Conference Registration In this project you will write a program to handle a conference registration. The.
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
Week Procedures And Functions 7 A procedure is a collection of statements that performs a task.
6b – Sub Procedure With Parameters Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Using ADO.Net to Build a Login System Dr. Ron Eaglin.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
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()
Starting Out with Visual Basic.NET 2 nd Edition Chapter 6 Sub Procedures And Functions.
MIC305 Week 6 Beyond controls Review of properties Differences with VB6: using classes and instances Programming constructs.
T HE W ALKING FOR W ATER P ROJECT IE 2060 Katelyn Cockrell Alexis Duran Theresa Garcia.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 4: Intro to GUIs and the.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
These materials where developed by Martin Schray
Sub Procedures And Functions
Data Types, Arithmetic Operations
GUI Programming using Windows Form
Indexer AKEEL AHMED.
Introduction to VB programming
TreeView Control.
للمزيد زورونا على موقعنا الإلكتروني:
Boolean Expressions and If statements
1.الدوال Function 2.الاجراءاتSub Procedure 3.وحده نمطيه Add Module
Fundamentals of Programming in VB.Net
STARTING OUT WITH Visual Basic 2008
GUI Programming in Visual Studio .NET
Web Service.
Presentation transcript:

These materials where developed by Martin Schray. Please feel free to use and modify them for non-commercial purposes. If you find them useful or would like to suggest corrections or enhancements please drop me a note at Martin Schray

VB.NET - Enumerations Copyright Martin Schray

Enumerations Enumerations a simple way to strongly type – type information For example, the type of arguments for a messagebox or the types of loans available or any other argument type Good for when you a known list of aguments loans or messagebox icon types

Enumeration declaration Example Public Enum MessageTypes Informational Warning Emergency WorldEnding End Enum

Enum Use Example Public Class Form1 Inherits System.Windows.Forms.Form Public Enum MessageTypes Informational Warning Emergency WorldEnding End Enum Public Sub DisplayMessage(ByVal t As MessageTypes, ByVal s As String) If t.IsDefined(t.GetType, t) Then Debug.WriteLine(t) MessageBox.Show("Your message :" & s) Else ' display message, but probably should be an exception MessageBox.Show("Invalid Message Type :" & t) End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click DisplayMessage(MessageTypes.Emergency, "world ending") DisplayMessage(7, "world ending") End Sub End Class

Enum comments Enum could be in a separate class Enum helped protected DisplayMessage from invalid arguments Enum used extensively in VB.NET (messagebox message types and such) When declared intellsense helps user fill in the right values