1 / 39

Understanding Programming Concepts and Writing a Simple Visual Basic Application

Understanding Programming Concepts and Writing a Simple Visual Basic Application. Chapter 1. Visual Studio .NET. A developmental tool for creating Windows and Web applications. A Windows application is designed to run on a desktop in the Windows interface.

Download Presentation

Understanding Programming Concepts and Writing a Simple Visual Basic Application

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. Understanding Programming Concepts and Writing a Simple Visual Basic Application Chapter 1

  2. Visual Studio .NET • A developmental tool for creating Windows and Web applications. • A Windows application is designed to run on a desktop in the Windows interface. • A Web application is designed to run from a web server using a browser interface.

  3. Visual Studio .NET • A development environment is the comprehensive set of tools and features that allow you to develop, debug, and deploy applications. • An Integrated Development Environment (IDE) is where all the features are made available within a common interface.

  4. Visual Studio .NET • A profile is a collection of settings that defines the appearance of the IDE. • The profile can be customized based on how you choose to work within the environment. • A view defines how the interface elements appear on the screen.

  5. Customize My Profile • My Profile on Start Page • Student Developer • Solution Explorer • Dynamic Help • Start Page • Task List

  6. Customize My Profile • Visual Studio Developer • Get Started

  7. Customize My Profile • Tools|Options

  8. Hiding Tool Windows Automatically • A Pushpin is a small icon appearing in a tool window that determines whether the window will display and hide automatically, also known as Auto Hide.

  9. Hidden Solution Explorer • Mouse over will display the window. • Mouse out will auto hide the window.

  10. Docking Tool Windows • Window|Dockable

  11. Visual Basic .NET • Visual Basic.NET (VB.NET) is one of the language options available in the development environment. • Visual Basic code is contained within a procedure. • A procedure is a block of Visual Basic statements.

  12. Solutions • An application is made of a solution. • A solution is the starting point for creating applications in Visual Studio.NET. • A solution is the container or box that manages all the individual pieces that make up your application. • Solutions contain one or more projects.

  13. Projects • A project can be created using any Visual Studio.NET Language. • A solution can have multiple projects created in different languages. • A project contains files. • The IDEorganizes solutions, projects, and files, and holds all of your work in a hierarchy.

  14. Creating a new VB .NET project • File|New|Project • Windows Application • Name:

  15. Creating a New Project • Type in the name of the project. • IDE uses the project name to create a new folder for each project you create. • Makes file management easier. • Browse for the location to store this project.

  16. Projects • When you create a project, Visual Studio.NET automatically generates a solution. • A solution usually has one or more related projects. • A single solution can consist of multiple projects.

  17. Solution Explorer • Provides an organized view of your solution, projects, and their files. • Common tree-view interface. • Collapses and expands.

  18. Windows Form Designer is the visual workspace for creating the interface for your application.

  19. Online Help • Help|Search • Look for: • Filter by: • Search

  20. Objects • An object is a combination of code and data you can treat as a single unit. • Menu, button, text box, etc. • A form is an object. • The entire application is an object. • A project requires at least one form.

  21. Controls • Controls are objects that make up the user interface. • A form is a container for the controls a user interacts with when using the application. • Text Box • Label • Button

  22. Toolbox • View|Toolbox • Toolbox button • Mouse over

  23. Properties • Characteristics • Attributes • Data • Name • Text

  24. Events • An event is an action that triggers a program instruction. • An object's code specifies what the object will do in response to an event.

  25. Object Methods • A method is a specific action an object can perform when the application is running. • A button has a Hide and a Show method. • Methods determine which actions an object can perform.

  26. Summary • Properties characterize an object's appearance. • Events are the actions to which a control responds. • Methods characterize an object's behavior.

  27. Design Time vs. Run Time • Design time is the state of the application while you are working with a project using the development environment. • Run time is the state of the application while it is running or executing.

  28. Setting Properties • Design Time – Select the object then change values in the Properties Window.

  29. Setting Properties • Run time – Assign a property value using an Assignment statement in VB code that responds to an event. • Object.Property = Value • txtLastName.Text = "Smith"

  30. Naming Objects • Long enough to be meaningful. • Short enough to avoid verbosity. • Must be unique. • 1st character must be letter or underscore. • Naming convention is Modified-Hungarian Notation. • Standards help programmers produce consistent code.

  31. Modified-Hungarian Notation • Uses a lowercase 3-character prefix to indicate the object type.

  32. Procedural Programming • The program specifies the sequence of all operations in a step-by-step manner, and the order of the program statements determine how the computer program will carry out a specific task. • Payroll • There is no user interaction.

  33. Event Driven Programming • Write code that responds to specific events. • There is no set sequence of events. • Objects respond to events in different ways. • Objects and their events are reusable.

  34. Code Window

  35. Class Name List • Method Name List

  36. Run the Application • Start Button. • Press the Tab key to verify that the tab index property is set correctly. • Test each button. • Stop Debugging button. • File|Close Solution • File|Exit

  37. Saving Files • If changes have been made that have not been saved, an * displays on the Form Designer window tab. • Save All button • The * disappears which indicates that all changes have been saved.

More Related