Download presentation
Presentation is loading. Please wait.
1
Visual Basic .NET BASICS
Lesson 2 Forms, Controls, and Properties
2
Objectives Create a new Visual Basic .NET project.
Save a Visual Basic .NET project. View and modify form properties. Create controls such as command buttons.
3
Objectives (continued)
Move, resize, and delete objects. Explain the concept of focus. Set additional properties (BackColor, Top, and Left).
4
Creating a New Project To create a new project, select the New Project option from the File menu or push the New Project button on the Start Page.
5
Forms Forms are the windows and dialog boxes when the program runs.
Every program must have at least one form because all other objects must be contained within forms.
6
Saving the Project Visual Basic .NET will save your project whenever you compile the program. Use the Save All button to save your project manually.
7
Viewing and Modifying Properties
The Properties window allows you to easily alter the properties of objects. Two of the most important properties of a form are the Text and Name properties. The Text property specifies the text that appears in the title bar. The Name property names the object for coding.
8
Creating Controls Controls are the objects that make up the user interface. One of the most common controls is the command button. To create controls, you must access the Toolbox. Objects can be moved and resized using techniques common to most Windows programs.
9
Understanding Focus The object that is currently active on the screen is said to have the focus. Press the Tab key to move the focus from one control to another. Each object in a window will get the focus in a sequence, called the tab order.
10
Dealing with Build Errors
There are times when errors will occur when Visual Studio. NET attempts to run your program. Renaming objects can confuse the compiler and produce an error.
11
Setting Additional Properties
The BackColor property sets the form’s background color. The Location property allows you to specify the location of an object using X and Y coordinates.
12
Summary To create your own Visual Basic. NET program, you must create a new project. The Windows Application project type allows you to create a program from scratch. Projects created using the Windows Appli-cation option begin with one blank form. Forms become the windows and dialog boxes when the program runs.
13
Summary (continued) Every program has at least one form. All other objects must be contained within forms. Visual Basic. NET will save your project whenever you compile the program. A window created from a Visual Basic. NET form has certain functionality by default, such as the ability to be moved, resized, maximized, minimized, and closed.
14
Summary (continued) Properties are the characteristics of Visual Basic. NET objects. Properties can be modified in the Properties window. The Text and (Name) properties are two of the most important properties. The Text Property controls what the user sees in the title bar of a form and in other objects such as command buttons.
15
Summary (continued) When we add programming code later, the (Name) property allows us to refer to the object using a meaningful name. Program-mers often use a naming standard when naming objects. Controls are the command buttons, text boxes, scroll bars, and other objects that make up the user interface.
16
Summary (continued) A command button is a standard pushbutton control that commonly appears in dialog boxes. Command buttons can be moved, resized, and deleted like other Windows objects. The term focus refers to the active status of one of the objects in a window. Only one object can have the focus.
17
Summary (continued) The BackColor property controls the background color of a form. The Location property can be used to accurately position objects. By default, the X and Y point values of the Location property use a measurement called pixels.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.