Visual Programming w/ Visual Basic How to prepare your mind to face the endless nightmare By Williem.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Val Function A Function performs an action and returns a value The expression to operate upon, known as the argument, (or multiple arguments), must be.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
1 Pertemuan 02 Visual Basic Environment and Control Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Instructor: Adil Ibrahim Office: 212 Ullrich Phone: ibrahima 1.
Getting Started Example ICS2O curriculum
Chapter 31 Fundamentals of Programming in Visual Basic (Continue VI) String Properties and Methods: "Visual".Length is 6. "Visual".ToUpper is VISUAL. "123.
3/9/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Week 2.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Visual Basic Chapter 1 Mr. Wangler.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #4: Working with Variables and User Interfaces IE 212: Computational Methods for Industrial Engineering.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Let’s get started using Visual Basic!. Private Sub cmdGo_Click... Dim strMessage As String Dim sngSum As Single If IsNumeric(txtNumber1.Text) = False.
Chapter 12: How Long Can This Go On?
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
MS Visual Basic Applications Walter Milner. Event-driven programming Standard approach for GUIs Contrast with old character interfaces – program determines.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
CS 101 Test 2 Study Guide Acronyms RAD - Rapid Application Development IDE - Integrated Development Environment GUI - Graphical User Interface VB - Visual.
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
31/01/ Selection If selection construct.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Microsoft Visual Basic 2012 CHAPTER FIVE Decision Structures.
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Data and variables in Visual Basic. Annoucement Lecture on Thursday 7:30PM C106 Visual Basic download: 
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3 Variables and Calculations.
1 4.2 Selection Logical Operators. 2 Learning Objectives Explain how the logical operator AND Boolean statements works. Directly testing if text boxes.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Data Types. Visual Basic provides data type Single for storing single-precision floating-point numbers. Data type Double requires more memory to store.
Visual Basic Fundamental Concepts
VISUAL BASIC 6.0 Designed by Mrinal Kanti Nath.
Visual Basic.NET Windows Programming
A variable is a name for a value stored in memory.
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
CHAPTER FIVE Decision Structures.
3.01 Apply Controls Associated With Visual Studio Form
البرمجة بلغة فيجول بيسيك
CHAPTER FIVE Decision Structures.
مراحل كتابة البرنامج بلغة فيجول بيسك ستديو
Visual Basic..
المحاضرة الأولى Lab(1) أ.ساره الأحمدي برمجة حاسب 2.
Chapter 8 JavaScript: Control Statements, Part 2
The University of Texas – Pan American
Introduction to Programming
Selection Statements Chapter 3.
Presentation transcript:

Visual Programming w/ Visual Basic How to prepare your mind to face the endless nightmare By Williem

To make new project  In main menu, click “New Project”  Choose your destination folder and remember to change your name (for the sake of originality, you’ll see later)

VS Topography  Left Side : Toolbox  Bottom-Right Side : Properties of selected object  Top-Right Side : Solution and Project Mapping/Explorer  Upside Menu Bar  Form to create your interface  The holy green triangle to debug and start your program

Gizmos  Button  Checkbox  Label  Combobox  RadioButton  Textbox  GroupBox  Timer IMPORTANT! To change every information regarding to specific objects, go to the Properties. It is essential

How to create the interface  VB consentrates on creating a user interface and manipulating the objects so we can do something better or even create and application  E.g. Create an application that says “Hello World” when a button is clicked

How to: 1.Create a new project 2.From the toolbox, drag the “Button” tool to the Form 3.To change the button’s text, go to Properties and change the “Text” infobox 4.To manipulate the code (sorry to say such holy word), double-click the button in the form*. 5.In the code, under the Private Sub blablabla, type “MsgBox(“Hello World”)” 6.Click the holy green triangle P.S. : *This applies to every object in later use, just keep in mind

Variables Almost same as C/C++, variable defining is essential in VB To define variable use “Dim” keyword Visual Basic is not case sensitive, so A and a are just the same. Be careful. To comment your program use the apostrophe ( ‘ )

MsgBox  MsgBox (not MonoSodium Glutamate) is essential and can be manipulated  MsgBox([Contents], [Type], [Box Text])  If you want to concatenate string, use “+” or it will be much professional to use “&” because it does for string and numerical * Types of the textbox determine the style, can be exclamation, yes or no, ok or cancel, ok, etc. MsgBoxStyle.Information MsgBoxStyle.Exclamation And many other stuffs you can explore *p.s. : because you will encounter some program with direct addition in the box

Textbox  To take the value of text input, use “[TextBox_Name].Text”  E.g. Dim myInt As Integer  myInt = Textbox1.Text  Converting is essential in taking input value. The only reason is every input you do in the textbox is taken as String value.  To convert to Integer: myInt = Cint(Textbox1.Text), etc.  Double = CDbl  String = CStr  Single = CSng A question: What if the input is 12A?

So easy…  Just use “IsNumeric()” function.  IsNumeric([Input])  This function returns Boolean value (True / False)  What does “IsNumeric(Textbox1.Text) = False” ?  Almost all programs in Visual Programming use this function. KEEP IN MIND

The Math Logic or Boolean Algebra  Remember “||” or “&&” ?  In VB, we use “And” or “Or”  || is Or  && is And  <> is Not Same As (or ‘!=‘ in C/C++)  ! is Not  == and = is different and it is self-explanatory.

RadioButton  To make it checked by default, go to Properties->Checked->True  To use it in code, [RadioButton_Name.Checked]  In default, it is considered true. Example: Male.Checked = False, what does it means?  And it can be combined with logic And / Or to achieve some purposes.

Conditional (If-Else-Elseif) and (Select- Case)  Like other languages, the If-else-elseif in VB is just the same, but remember, you have to be able to separate some if  Always remember, after If – Then, Elseif – Then, Else (no Then) and End If. *usually auto-typed by VB, but keep your eyes on them unless you want to shout like sh*t when error happens in debugging because of no “End If” or even “Then”  Select is like switch Select Input Case 0 Condition…. …(continue) End Select

Loops (While, Do While, For)  While and Do While is like in C/C++ except for While, it has End While  Do … Loop While/Until.  Or Do While (Condition) … Loop. It is self-explanatory or not clear enough?  For … To … (Step -a) Next Step is used to determine the difference in every loop, can be negative or positive

Bonus Sneak-Peek (Array)  Usually used to manipulate string.  To take string length just use myStr.Length as in C/C++ Dim myStr As String myStr = Textbox1.Text ‘Assume input is Hello MsgBox(“The character is” & myStr(2)) …. What is the result?

Challenge 101 Create a program that counts temperature from:  Fahrenheit to Celcius and vice versa  Celcius to Reamur and vice versa  Reamur to Fahrenheit and vice versa  All to Kelvin and vice versa And Show the conversion result Use one textbox, one button and 8 radiobutton Create a program that reads String input from textbox and Reverse it manually with loop by clicking a button (any loop will do), then show the result! Use one-dimensional array! (there are two ways to do it )