Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.

Similar presentations


Presentation on theme: "What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that."— Presentation transcript:

1 What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that _ uses event driven programming _ uses objects Event driven The programmer writes code(=program) to describe what happens when the user does something (mouse click...).

2 110 B-2 Things that you can use in your program. An example would be an OK button An object has events: The user can interact with the object, e.g she can click on the button An object has methods: an action associated with the object, e.g.Move, Resize... An object has properties: size, color… Object

3 110 B-3 Planning: GUI (Graphical User Interface) Programming: Designing an application _ know the users' needs _ sketch what you want the user to see on the screen _ write an algorithm to solve the problem Build the GUI using VB.NET: choose the objects, set their properties (lots of mouse clicks!) Write a program using VB.NET: Following your algorithm write a VB program (what happens when the user types, clicks…). Do this by writing code for events associated with your objects.

4 110 B-4 When building an application, work within a Solution (project) A project contains one or more forms: where the GUI will be displayed. To design a form, use To write the program, use the code window The different elements of a project are displayed in the solution explorer. VISUAL STUDIO.NET Integrated Development Environment _ toolbox: contains objects that you can put on the form _ properties window: to set the properties of the objects _ form designer: to design the GUI

5 110 B-5 Goal: when the user clicks on a button labeled “Display”, a welcoming message appears on the form. Objects needed: A form A button A label to display the message Sketch: Display before clicking Display after clicking Welcome to VB label: lblMessage button:btnDisplay form: frmWelcome A simple application

6 110 B-6 form Text frmWelcome identifies the form button Name identifies display button Property Description Object Property setting form title bar display Welcome Text Font btnDisplay Display MS sans Serif 8 pt bold Text on button Font for text on button Setting up the form Name

7 110 B-7 label False message is hidden at the start Property Description Object Property setting Name Text Font Visible lblMessage identifies the label Welcome to VB text of the label MS sans Serif 18 pt bold font for text of the label

8 110 B-8 Has the user clicked on the Display button? Yes Make the label Visible Object dot: operator to access the property of an object Property assignment operator property setting lblMessage.Visible = True No HOW? Write in the program The algorithm

9 110 B-9 form: What the user sees. Put objects of the toolbox on the form code: The program that is written to manage events What to do when the user interacts with the controls (buttons…) on the form naming conventions: _use prefixes for names of objects btn for a button lbl for a label frm for a form _ have meaningful names e.g. btnExit for a button to exit Summary


Download ppt "What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that."

Similar presentations


Ads by Google