1 / 9

What is Visual Basic .NET?

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

Télécharger la présentation

What is Visual Basic .NET?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Designing an application GUI (Graphical User Interface) _ know the users' needs Planning: _ sketch what you want the user to see on the screen _ write an algorithm to solve the problem Programming: 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. 110 B-3

  4. VISUAL STUDIO.NETIntegrated Development Environment 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 _ form designer: to design the GUI _ toolbox: contains objects that you can put on the form _ properties window: to set the properties of the objects To write the program, use the code window The different elements of a project are displayed in the solution explorer. 110 B-4

  5. A simple application label: lblMessage form: frmWelcome Welcome to VB Display Display before clicking after clicking button:btnDisplay 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: 110 B-5

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

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

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

  9. Summary 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 110 B-9

More Related