A Computer program is an application used to accomplish any task imaginable in soft form.

Basic steps in programming

It is important to take a structured approach when programming thus implementing a program problem in certain order of steps.

  1. Plan the program’s tasks
  2. Design the user interface
  3. Write the program’s code
  4. Test and debug the program (using if possible alpha and beta testing methods)
  5. Document and distribute the program.

Type of common programs

  • Packaged programs they can be purchased from software stores, ordered via email and direct from manufacturer.
    • Costumed programs they are designed for a particular or specific purpose within a given organization.


Create anew project, which is a set of files that store information about the components of an application program.

  1. Start visual basic
  2. Choose file, new project (if new project dialog box does not occur)
  3. Select or specify the type of project you want to create e.g. Standard. exe option
  4. Then click okay and you will be placed in visual basic’s design environment

If the title bar is specified as design, it means that you are in design mode (design time) and you can design and code the program application.

When the program is running and the title bar is named as run mode; this means that the program is running or executing.

Visual basic applications are comprised of one or more components such as

  • Forms
  • Coded modules
  • Classes
  • Controls
  • Other components

Visual basic has the Project explorer, which consists of a list of the contents of the current project. It grows as many components are added.


 To run the program you need to execute visual basic start command using any of the methods

  • Click the start button on visual basic toolbar
  • Choose run, start
  • Press F5


A Form is a container that holds all the other controls such as labels, textboxes, pictures and access databases and make up part of the user interface.

Forms have features found on a window in a program. It contains a title bar, a control menu, and asset of minimize/maximize/restore, and close buttons.

Design time features are:

Close buttons 

  • They are always present even if the properties are set in such away that they are not visible at runtime.

Design grid

  • It is a grid of dots that allows you to line up controls easily, as you are designing your interface.

The form oversees the use of objects that make up the interface, including storing program codes that relates to the objects on the form and respond to events.

Some form properties

Property Name Description
border style Sets the type of border that is used for the form
Control box Determines whether the controlbox(containing the move and close menus) is visible when the program is running.
font Determines the font used to display text on the form
icon Determines the icon that is shown in the form’s title bar and that appears when the form is minimized.
Maxbutton Determines whether the maximize button is displayed on the form when the program is running
Mdichild Determines whether the form is a child form for an MDI application
minbutton Determines whether the minimize button is displayed on the form when the program is running.
startup position Determines the initial position of a form when it is first shown.
window state Determines whether the form is shown maximized, minimized, or in its normal state.


Visual basic controls let you perform a wide variety of tasks including editing text, displaying pictures, and interfacing with a database. The liberal use of controls has always been one of VB strongest features.

Controls are objects that perform specific tasks and have associated properties, events and methods.

E.g. using a text box control, you can set properties to determine the size of the text box, the text that it displays and the color of the text and background.

You are not limited to using only the control s provided by Microsoft, the design allows easy integration of third-party controls which increases chances of finding a control to perform almost any task you want, from data acquisition to custom reporting to specialized graphics processing to game play, and everything in between. You can create your own activex control for use in your programs.


              A control is a miniature program in itself that perform certain tasks for you e.g. a textbox contain internal code that allows it to process keystrokes so that it knows, characters when you press back space key.

Control properties

          They are adjectives that describe one specific thing about an object and modify objects appearance when you run your program. Hence a windows appearance is defined by a set of properties thus they are settings that control the appearance and behaviour of an object. All objects do not have it set of properties although we have common properties found in many objects.

Common properties

Name, Index, Left, Top, Height, Width, Enabled, Visible, Caption

Left and Top

  • Describe the position of the form on the screen

Width and height

  • Define the size of the form on the screen


  • Dictates what is shown in an object title bar


  • Describes a unique identifier by which you can refer to the object in code.{name property is very important , in that it identifies the control since the program may have many controls of the same  type and you can also use the control name  property to indicate the procedure in which a particular code statements written.}


  • Determines whether an object can be seen on the screen by setting it true (to be viewed) and false otherwise.


  • Determines whether the users can interact with an object setting it either to true or false.

Control methods

Is a program function that is built into the object. As properties, they are referenced using code via the dot notation

E.g. form1.printform-prints an exact image of the form named form1on the line printer

Although different objects have different methods, many objects have the same  or common methods.



  • This handles the operation of the users’ dragging and dropping the object within its container.


  • Changes the position of an object

Set focus

  • Gives focus to the specified control


  • Determines whether an object appears in front of or behind other objects in its container.

Controls responding to action with events

Objects respond to actions, whether generated by the users or externally. Response to actions are handled through use of events .generally an object is the set of events it can raise and the user actions that trigger them.

Intrinsic Controls

picture box Displays graphics .Can also serve a container for other controls.
Label Displays text that the user
Text box Displays text . also allows the user to enter and edit the text.
Frame Serves as a container for other controls. Provides grouping of controls
Command button Allows the user to initiate actions by the button.
Check box Lets the user make the a true /false choice
Option button Lets the user choose one option from a group of items.
Box Lets the user choose form a list of items or enter anew value.
List box Lets the user choose from a list of items.
Horizontal scrollbar Lets the user choose a scrollbar value based on the position of the button in the bar.
Vertical scrollbar Serves as a horizontal scrollbar.
Timer Lets the program perform functions on timed basis.
Drive list box Lets the user select disk drive
Directory list Lets the user select a box directory or folder
File list box Lets the user select a file
Shape Displays a shape in time form
Line Displays a line on the form
Image Similar to a picture box control. uses fewer system resources but doesn’t support as many properties, events and methods..
Data control Provides an interface between the program and a data source
Ole Provides a connection between the program and an OLE server.
Common dialog Allows user of windows standard dialog boxes to retrieve information such as file names, fonts and colors.
Label control It does not allow the user to enter text directly; it contains events and properties that allow the programmer to manipulate the text directly from code. E.g. label caption=”time is”
Textbox It has property that makes programs and user interaction versatile. Multiline and scrollbar properties in the textbox windows. They are useful for handling large amounts of text. Scrollbar property has affect on the textbox only if its multiline property is set to true

Controls for displaying text

Textbox and label


Allow both data/text display and also allow text input. A text box control must be adding to a form so that it can be used.

The textbox control is found in the tool box as one of the default controls on toolbox

Steps followed to use a text box

  1. Click the tool for the textbox control in the toolbox. (To know if it is a text box let your mouse pointer pause over each control in turn to see atooltip.)
  2. Move the mouse pointer to the form .Note that the pointer will change into across hair, indicating that you’re about to draw the control.
  3. Move the pointer to one corner of the area where you want to draw the control.
  4. Click and hold the left mouse button
  5. Drag the mouse to where you want diagonally opposite the corner of the control.


 Are designed only to display text. They inform users what type of information is to be entered in the textboxes if laced next to input field. It has events and properties that allow the programmer to manipulate the text directly from code. If you want to display more text, pay attention to the auto size and word wrap properties. If auto size is true the size of the label control automatically adjusts to fit the text being displayed, otherwise label remains same size.

If word wrap is false the label expands horizontally to a low the caption to fit, even if the label grows so large that it passes the right edge of the screen. If the word wrap is true the label expands vertically to allow enough times of text to accommodate the caption even if the label runs off the bottom edge of the screen.

Steps followed to use a label

  1. Select the label control’s tool in the tool box
  2. Draw a label control to the left of the first text box control
  3. In the properties window change the label control’s name property to start with lbl e.g. lblbookid
  4. Change the label control’s caption property to <name>
    1. lblbookid.caption=<name>
  1. change the label’s alignment property to suit your application

                            e.g. lblbookid.alignment = 0-leftjustify



The command button

This control lets users initiate actions by clicking the button. you can set up a command button control by

  • Drawing the button on the form
    • Then set the caption property to the text that you want displayed on the button’s face.
    • To activate the button, just place code in the button’s click event procedure.

To access commands through the keyboard

  You make use of access keys assigned using the ampersand sign “&” ,on the button caption.

To use the access key, the user holds down the alt key and processes the access key to trigger the command button controls’ a click event.

             e.g. command1.caption=&”print”

     It will appear as     Print and to use the command using the keyboard press alt + p


when  a checkbox is on ,a check mark(Ö) is d displayed in the box.It indicates that the answer to the checkbox ‘s corresponding question  is “yes’ .when the  checkbox  is off  or unchecked the box is empty, indicates an answer  of “NO”

option buttons-they exist a group and only one of them can be selected at a time .They are useful for presenting  a fixed list of mutually exclusive choices.

      Two ways of using the option button.

1.) Use   the click event if you want to take an action when users select  an option. This is useful when using control array and code is typed in the option procedure.

2.) Do not write any code in the  optional button event .Instead use if statement  in a relevant  controls procedure e.g. button to  check if they are true .

The list box

-The key parts of the list box are the following

Item list

  • Which is the list of items from which the users can select.
    • They are added to the list  in the design environment or by our program as it is running  mostly using code

Select item

This item is chosen by the users. Depending on the style of list you choose a selected item indicated by a highlight bar or by a check in the box next to the item.

Scroll bar

This part indicates that more items are available on the list than will fit in the box and provides the users with an easy way to view the addition items. , But it does not have horizontal scrollbar although vertical scrollbar appear as default.

Filling list box using code

    Private sub form_load()

          Dim I as integer

          For  I=1 to 100

                 List1.AddItem   I

           Next I

To clear using clear method


To print items from the list you can use list property of the list box indexed from “ 0”

                Print list1.list (index)

Listcount-represent the number of items in alistbox


Listindex- represent  index of selected items.


Removeitem-remove item from the item list by specifying the array index of the item.this property works only for  asingle selection.

                             List1.RemoveItem   ListIndex

      Using index with additem method you can specify the location within the list where you want the new item to appear.

Setting the appearance of a list box

     This can be done by using or setting the style property to either:



     the values can be changed at runtime by setting its value to one of the  intrinsic constants

                          vblistboxstandard or vblistboxcheckbox        respectively

the otherway to change the list’s APPEARANCE  is to use the columns property that has a default value of zero

Setting it to 1

         Causes the list to be presented  with one column at atime,but to scroll horizontally instead of vertically.

Setting it to values greater than 1

         Causes the list to display in ,the number of columns specified by the property.

Working with multiple selections

Applicable  only when you need to select more than one element .this is done using multiselect property and it has three possible setting.

  1. 0-none

Is default setting showing that multiple selection is not required or permitted.

  • 1-simple

Users can click an item with the mouse to select it or click a selected item to deselect it. Using the keyboard, users can make use of the cursor keys to move the focus (dotted line border)to an item  and then presss the space bar to select or deselect it.

  • 2-extended

Is more complex, here users can use standard windows techniques to quickly select multiple can select a range of items by clicking the first item in the range and then ,while holding down the shift key,click the last item in the range; all items in between the first and lat items are selected .to add or delete a single item to or from the selection,userts hold down       the control key while clicking the item.

Selected property is an array that has an element for each item in the list. The value of the selected property for each item is either true (if the item is selected) or false (when not selected). To display item selected you can print on the form



       For I=0 to numitem-1

             If list1.selected (I) then

                Form1.print list1.list (I)

             End if

        Next I

About Kahufa

Check Also

System development methodologies.

System development methodologies. Waterfall Iterative methodology. An alternative to sequential development of systems. Plan system. …


  1. I like to get my inspiration from really meaningful phrases said by truly great people like “If you would be a real seeker after truth, it is necessary that at least once in your life you doubt, as far as possible, all things”, do you know where I can find thematic compiltaions of those?

  2. Best Essay Writers

    An introduction to academic writing for English Language Learners, focusing on essay development, grammatical correctness, and self-editing. A nonfiction writing prompt (in case you didn’t know) is a simple brainstorming tool that helps you come up with new blog posts, articles and ebook topics to write about. Conclude the essay with a paragraph that restates the thesis and recaps the descriptive and sensory details.

    [url=]see this site[/url]
    [url=]find more info[/url]

    7 Tips On Writing An Effective Essay

    Essay topics are the crucial part for your college admission and also for your academic career. Lots of college students work part-time trying to earn extra money or to pay off their loans. For example, if you are writing an essay on How Global Warming can be reduced”, it will be a good idea that you take a moment to define what global warming is all about in your introductory paragraph.

    [url=]Introduction, Types Of Essays, Tips For Essay Writing, Questions[/url]
    [url=]Causes And Effects[/url]
    [url=]The Purpose Of An Essay[/url]

  3. Essay Producing Assistance by tigers! Just the preferred writers, just the very best quality! 100% non-plagiarized essays, costless offers and excellent special discounts.

  4. Wanting for your most effective essay composing provider, you should think about various factors, for example grammar, formatting design and framework, and EssaysWriting | org goes.

  5. Essay 10 Talking About Online Shopping

    English is a is an intemational languagelt is spoken all over the people of the world communicata with each other by this lainguagthis languag is used in everyday life-at home,in the market,in the office,at school,in college , is also the medicion of communication through email and intemet.moreover, english has been the medium of education in all parts of the important subgect like english,science, economics,history,geography,medicine,engenerring, taught in english.without understanding english the intemational student cannot get scholarship in america,britain,japan,china or other rich countries. The introduction or the introductory paragraph is a very relevant aspect of your essay because of the fact that it states the main idea of your composition. At last, a strong concluding paragraph summing up the ideas should be written. This service helped me submit several papers on time, and I really appreciate it. Their support guys are always friendly and the papers are great every time.

    You don’t wish to write i have writing essays which are regarded as hilarious since they’re inadequately written or even off subject. There are many GED essay topics given to the students in GED essay writing exams which make it difficult to handle. Since writing an outline can sometimes be tedious job because this is where you actually start thinking about your essay seriously.

    [url=]browse around this website[/url]
    [url=]browse around these guys[/url]

    Essay DecodeCIVILS Mudit Jain

    There are four main types of essays: narrative, descriptive, expository, and argumentative. The writing team with us are British essay writers based locally and are fully equipped to support you via email, phone or if needed in person too. If you’ve signed up for a high school course in English literature, chances are great that you’ll be assigned Beowulf to read, and you might very well have to write an essay or research paper based on the work.

    [url=]How To Write Essay Topics[/url]
    [url=]The Myth, The Legend, The Really Straightforward Guy[/url]
    [url=]Why Conclusion Is Important In Term Papers Writing[/url]

  6. College or university Essay Creating Provider | Do my historical past essay | Highest quality Web-sites To purchase An Essay.

  7. Higher education Essay Composing Services | Do my record essay | Most useful Website pages To obtain An Essay.

  8. Fighting your college or higher education essays | Get skilled essay creating fac ilitate | Satisfy your deadline and make the quality using the essay crafting.

  9. Get the pro creating assist from legit essay composing services | Our qualified essay writers will pay attention to your orders to offer tailor made essays in time.

  10. Ads by Google shows essay composing products and services which are not produced lo include guidance lo learners with regards to the crafting technique, but somewhat, provide you with essays.

  11. Custom made essay creating products british isles | For principle, just one may well invent to aid the situation to some psychological dick security for any thanks deny.

  12. Tailor made essay producing providers united kingdom | For principle, an individual may very well invent to aid the situation into a psychological dick basic safety for any owing deny.

  13. Get the skilled professional crafting support from legit essay creating assistance | Our high quality essay writers will manage your orders to offer customized essays in time.

  14. Be able to write my essay ask for | By deciding on a specialist essay creating support, you’ll be able to profit from getting accessibility to customer support on the 24 several hours.

  15. Ads by Google shows essay composing providers that can be not developed lo provide suggestions lo college students when it comes to the creating routine, but somewhat, supply essays.

  16. The Uni Tutor Customized Essays Creating Providers provides carefully investigated educational perform, properly annotated and referenced, and published towards your actual.

  17. Obtain your specialist composing assistance from legit essay composing assistance | Our compe tent essay writers will deal with your orders to offer tailor made essays in time.

  18. Just one from the most popular United kingdom essay crafting solutions | In this article you’re going to get a hold of the specialist British isles essays finished according to your directions.

  19. A person for the perfect United kingdom essay composing products and services | Right here you can expect to locate the expert British isles essays done according to your guidelines.

  20. In terms of the scholars are anxious, creating leading superior essay is critical to protected very best grades, but absence of capabilities tutorial them to relaxation on essay producing.

  21. Those that get to the skilled support with all your customized essay, groundwork paper, phrase paper, dissertation or another bit of composing, you’re encouraged to show.

  22. A particular for the most efficient United kingdom essay crafting companies | Listed here you’re going to get hold of the high quality British isles essays done according to your recommendations.

Leave a Reply

Your email address will not be published. Required fields are marked *