0% found this document useful (0 votes)
5 views5 pages

Computer 10 - Visual Basic (1st Q)

Visual Basic is a high-level programming language developed to simplify programming through a graphical user interface, allowing users to create various applications including games and business systems. It features an Integrated Development Environment (IDE) with tools like the Toolbox, Solution Explorer, and Properties Window to assist in program development. Key concepts include properties, methods, and events associated with objects, as well as event-driven programming, which is central to how Visual Basic operates.

Uploaded by

aeon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Computer 10 - Visual Basic (1st Q)

Visual Basic is a high-level programming language developed to simplify programming through a graphical user interface, allowing users to create various applications including games and business systems. It features an Integrated Development Environment (IDE) with tools like the Toolbox, Solution Explorer, and Properties Window to assist in program development. Key concepts include properties, methods, and events associated with objects, as well as event-driven programming, which is central to how Visual Basic operates.

Uploaded by

aeon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

VISUAL BASIC

BASIC
-​ Beginners’ All Purpose Symbolic Instruction Code, is a general-purpose,
high-level programming language designed for ease of use.
-​ created by John G. Kemeny and Thomas Kurtz in 1964 to enable students in
non-scientific fields to use computers.
-​It’s been used in teaching introductory concepts of programming.

VISUAL BASIC
●​ developed by Alan Cooper in the 90’s
●​ His main purpose was to teach programmers how to design and develop programs
easily using a graphical user interface (GUI).
●​ In a GUI setting, you work with graphics, forms, and icons instead of typing text to
accomplish a particular task.
●​ No need to spend much time memorizing commands and their corresponding
parameters.
●​ Pictures, objects, and images will make it easier for you to remember commands and
their parameters.

Different applications can be developed using Visual Basic


●​ computer games
●​ Information systems
●​ Computer-Aided instructions (CAI)
●​ Multimedia Powered applications
●​ Business application systems
●​ Internet/web-based applications
You can develop programs not only for the personal computer, but also for Android phones and
tablets.

Integrated Development Environment (IDE) - is your workspace

Menu bar - located below the Title bar, it contains menu items such as file, edit, view, debug,
tools, and more. (Given was 2022 version)

File menu - contains the commands to Open and Save your project

Edit menu - lists commands related to the Clipboard - cut, copy, and paste commands

Toolbar - shows a list of icons; this is where you can quickly access commonly used
commands. Just click the icon and activate it.

Toolbox - contains objects or controls that you can drag-and-drop onto the form. Ex. Buttons
and text boxes.

Tip 1: To make the toolbox visible all the time, click the drop-down button (small triangle) and
choose dock from the list of options.

Tip 2: To hide or display the toolbox, press Ctrl+Alt+X


Solution explorer - keeps track of all the items contained in each project. The items are seen
as files or folders.

Keyboard shortcut to hide or display the Solution Explorer is Ctrl+Alt+L

Properties window - provides you with a list of property settings that is applicable to the
selected object on the form.

Keyboard shortcut to hide or display the Properies window is F4

Property characteristic - is a characteristic of an object, such as color, size, or caption.


Property is not limited to the appearance of the object, it can also determine how an object or
control behaves.

Form Designer Window - this is your drawing board

Form - where you place objects & controls, like buttons, checkboxes, labels, listboxes, pictures,
etc.

To add the objects


1.​ Drag a button to the form
2.​ Drag a textbox to the form
3.​ Change Text Property of the Button to Greet now!

To write the code


1.​Double-click the Button to display the Code Designer window
Keyboard shortcut to hide/display is F7
Code example
Textbox1.Text = “Hello World!” typed in between the Private sub and the End sub.

Keyboard shortcut to run a program is F5

Intellisense
-​a code completion tool built into Visual Studio
-​ will offer you options or even complete the code for
you Offers syntax tips, or rules on how program codes are
written.

Context menus - contain shortcuts to frequently used commands.

To display a context menu, point to an object and click the right mouse button.

In doing the examples in the book, please note that there are system generated codes and
there are codes that you will write or embed in the method.

VB takes care of system generated codes

DON’T TYPE THE SYSTEM GENERATED CODES


The private sub and end sub for example are system generated codes; they are automatically
generated when you double-click on an object.

Properties, Methods, & Events are basic terms associated with OOP or Object Oriented
Programming languages.

●​ Property - refers to an attribute or characteristic of an object


●​ Method - refers to the action that an object can perform
●​ Event - refers to the responses recognized by the object.

Button
Property - caption, color, and size
Method - show a form object
Event - mouse click

Summary of Keyboard Shortcuts

●​ Ctrl + Alt + X - hide and display the Toolbox


●​ Ctrl + Alt + L - hide or display the Solution Explorer
●​ F4 - shortcut for Properties Window
●​ F7 - displays the Code Designer window
●​ F5 - shortcut to run a program; start Debugging

Controls or Objects
-​The means by which users interact with an application sysyem
-​Intended to get user input and display output

Buttons are placed in the program for users to click it and for your program to carry out the
command associated with that button. Used to extract responses, and invoke special functions

TextBox
-​ is intended for the user to input text or enter data
-​A String is a sequence of characters which can be a combination of letters, numbers, or symbols

Properties
-​Something controls and objects have
-​Object.Property is used to change the property settings of the Form and Controls used in the
Form during Run Time
-​ Mouse Click is the event that will trigger the button to perform the method

Beep() makes the computer emit a beep sound


MessageBox
-​Used to display simple messages

CheckBoxes RadioButtons
●​ Valid as a single control but are not ●​ Mutually exclusive.
mutually exclusive ●​ User can only select one of the items
●​ Several can be checked at once

Label
-​Represents a standard windows label
-​Generally used to display informative text on the GUI that is not changed during run time

Alan Cooper
-​Father of Visual Basic

Control or Object properties can be changed during Design Time or during Run Time

Design Time
-​When you are creating and developing the application, designing the interface, and writing the
code.

Run Time
-​Starts when you click the Start Debugging button or F5
-​To change the property during Run Time, double-click Button1 to open the Code Designer
window, and write a code in the following syntax. Objectname.Enabled = False

Disabling a control restricts use, preventing user from clicking.

Visible Property
-​Sets the value that indicates whether the control is displayed or not
-​Can be changed during Design Time or Run Time

ToolTip
-​Represents a small rectangular pop-up window that displays a brief description of a control’s
purpose

Me
-​Keyword that refers to the form control itself

Event
-​Action recognized by Object or Control

Event Driven Programming


-​A programming paradigm in which the flow of program execution is determined by events, such
as mouse click or key press.

Class Object
●​ Blueprint for creating objects ●​ Instance of a class
●​ Describes properties, methods, and ●​ Represents real world entities and
events of an object they can perform actions and store
●​ Promotes code reusability and data defined by their class.
organization ●​ Such as Button, TextBox, Label

Class is the cookie cutter; object is the cookie itself


Comments
-​Brief explanatory noted added to the code for the benefit of those reading it.

You might also like