Understanding Programming Concepts and Writing a Simple Visual Basic Application PowerPoint PPT Presentation

presentation player overlay
1 / 39
About This Presentation
Transcript and Presenter's Notes

Title: Understanding Programming Concepts and Writing a Simple Visual Basic Application


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
  • ToolsOptions

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
  • WindowDockable

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 IDE organizes solutions, projects, and files,
    and holds all of your work in a hierarchy.

14
Creating a new VB .NET project
  • FileNewProject
  • 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
  • HelpSearch
  • 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
  • ViewToolbox
  • 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
(No Transcript)
35
Code Window
36
  • Class Name List
  • Method Name List

37
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.
  • FileClose Solution
  • FileExit

38
(No Transcript)
39
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.
Write a Comment
User Comments (0)
About PowerShow.com