Visual Basic Programming

Visual Basic programming involves the use of a language that allows programmers to create simple and complex applications. It is a combination of visually organizing components or controls, specifying their attributes and actions, and writing additional codes for better functionality.

2,622 Questions
Computer Programming
Computer Hardware
Visual Basic Programming

What is the full meaning of BASIC?

Beginners all-purpose symbolic instruction code

Visual Basic Programming

Factorial of a number in visual basic 6?

dim num as integer, factorial as single

num=inputbox("enter a number")

factorial = 1

for x = 1 to num

factorial = factorial * x

next x

print"factorial is" ; factorial

or By Recursive Method

Private Function FindFactorial(number As Integer)

If number < 1 Then

FindFactorial = 1


FindFactorial = number * FindFactorial(number - 1)

End If

End Function

' recursive is faster and simpler for finding factorial

Software and Applications (non-game)
Computer Programming
Visual Basic Programming

How do you convert a .doc file into a .pdf file using VB code?

Originally, a full version of Adobe's Acrobat application was required to create PDF (Portal Document Format) files from any application, including Microsoft Word. Subsequently, a number of companies sold inexpensive PDF conversion software to compete with the more expensive Adobe product. These applications, like Acrobat, used a printer driver to "print" Postscript-based PDF files. The Mac OS central window server caches window graphics in PDF, allowing any Macintosh application to print to a PDF file from within the OS.

Today, all current versions of Microsoft Word will save directly into PDF format. There's no need to use Visual Basic, assuming you have Microsoft Word.

You can create PDF files programmatically in VB6. You'll need the mjwPDF class and the appropriate PDF fonts. A tutorial on the subject has been attached to this page as a related link: Tutorial - Create PDF files with VB6

Inaddition, you also can use enolsoft PDF Creator to do that. It's fast and simple yet.

Visual Basic Programming

How do you replace in visual foxpro?

You can use the REPLACE using below code

SELECT TableName






Database Programming
Visual Basic Programming

How do you write a program in visual foxpro?

Same with other Visual Basic program, programming in FoxPro will require you to have the right syntax.

Visual Basic Programming

How do you convert non alphanumeric characters in visual basic?

Try using entities, &, pictureboxes and make a picture. Because any non numeric character can only be as string, because it can't be a number. And remember to use the quotation marks.


Real Answer by AC352

You can't do it directly in You need to read it from a file,

lines = System.IO.File.ReadAllLines("C:\TEST.txt, System.Text.Encoding.Default)

when you put the System.Text.Encoding.Default you will be able to read the non alphanumeric characters.

Software and Applications (non-game)
Visual Basic Programming
Computer Aided Design

What is Visual Cadd?

Visual Cadd is a super-productive 2D design and drafting software for a very reasonable price.

You can try out Visual CADD 5 by downloading the 30 day trial. This is a fully functional version, and includes all features including the ability to save and print Visual CADD files as well as import/export Generic CADD and AutoCAD files.

Web Programming
Visual Basic Programming
Computer Science

What is meant by BASIC in visual basic?

BASIC stands for Beginner's All-purpose Symbolic Instruction Code.

Web Usability
.NET Programming
Visual Basic Programming

What are the net framework services?

.net framework services are :

  • Web forms
  • Windows forms
  • XML Support Throughout
C Programming
Visual Basic Programming

Advantages of using an array?

1. An array cuts down on the number of variables that need to be declared.

For example, if you wanted to store the numbers 1 to 10 without using an array you would literally have to declare ten separate variables.

Dim int1 as Integer = 1

Dim int2 as Integer = 2

Dim int3 as Integer = 3

Dim int4 as Integer = 4

Dim int5 as Integer = 5

Dim int6 as Integer = 6

Dim int7 as Integer = 7

Dim int8 as Integer = 8

Dim int9 as Integer = 9

Dim int10 as Integer = 10

Which is monstrously difficult to read and use further along in your code. A better way of doing it would be to use one variable; an integer array.

Dim intArray() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

Using this example you use the same variable throughout your code and access different parts of it as follows;

Dim intArray() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

Dim intTemp as Integer



This example displays two textboxes which will display the number 1 and 5 to the user (Note that array starts at zero)

2. An array can be used in itterative procedures such as a For... Next loop.

For example if we use the previous example of an integer array containing numbers 1 through 10, and with this array we want to display every number to the user.

Without an array this is an almighty block of code with a minimum of 20 lines, 10 declaring each variable and 10 outputting it to the user. With an array this can be reduced to four lines.

Dim intArray() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

For i = 0 to intArray.Length



The importance of this is that in our example we only have ten numbers stored, in the real world you could have hundreds. Declaring hundreds of variables and messing around with them will take up memory, obfuscate the code immensely and make it virtually unchangeable.

With the above example that array could be any length and contain a thousand variables and still function the same.

3. An array can be declared as a variable length.

Whilst it's all well good saying we have an example array containing numbers 1 through 10, it is unlikely to ever be that simple; we will always want to store an unknown amount of data at runtime.

Just declaring variables in the code wouldn't work for this because they would need to be hardcoded.

In this example we will pretend a form has been made with a listview containing a hundred items, when a user clicks a button we want to store everything they selected in the listview. (If you don't know what a listview is I would ask that question as well)

Dim intVarArray(ListView1.SelectedItems.Count - 1) as Integer

For i = 0 to ListView1.SelectedItems.Count - 1

intVarArray(i) = ListView1.SelectedItems(i).ToString


To do this using nothing but variables would be near impossible as you wouldn't know how many items the user would select, as such you would have to declare a hundred variables and write hundreds of lines of code to do something that can be covered in four lines.

4. An array can be resized on the fly, either destroying or preserving existing data.

In the above example we created an array of variable length and then stored some data from a made up listview control, but it's possible when working in the real world we may need to add things to that variable.

We can Redim an array to change its length.

Dim intArray(9) as Integer

Redim intArray(14)

This declares a variable of an array of integers, sets the length to 10 and then redefines that array as an array of length 15. This will completely remake the variable destroying any data held within it.

Dim intArray(9) as Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

Redim Preserve intArray(14)

intArray(10) = 11

intArray(11) = 12

intArray(12) = 13

intArray(13) = 14

intArray(14) = 15

This declares a variable of length 10 and stores the number 1 to 10 inside it, it then redefines the variable as length 15 but preserves the data within it (It then adds the number 11 to 15 to that variable).

5. An array can have multiple dimensions.

Dim intArray(, ) as String = {{"White", "Rabbit"}, {"Brown", "Bear"}, {"Blue", "Water"}}

This declares something more unique than any other type of single variable, a multidimensional array, and stores some data within it.

Ac532 Answer:

Arrays can be disposed by using the .Dispose which means all allocated memory toward using the array will be lost meaning that your program will run faster.

Database Programming
Visual Basic Programming
Oracle Database

How do you retrieve the target path of any existing shortcut such as a lnk file in Visual Basic?

Here is how to open a Windows Shortcut file Using VB6. This is a safe and documented method.

Create a New VB6 Project

In the Project References Add "Windows Script Host Object Model"

Place a Command Button on the form named CommandButton1

Click on CommandButton1

Private Sub CommandButton1_Click()

Dim Oshell As New WshShell

Dim Osh As WshShortcut

Dim Fn As String

Dim Otarget As String

'Set the path and file name of the shortcut

Fn = "C:\shortcut path\shortcut filename.lnk"


' If the shortcut file is existing, it will open the existing file


Set Osh = Oshell.CreateShortcut(Fn)

Otarget = Osh.TargetPath


' Using the Watch window see the other properties of Osh object


End Sub

Software and Applications (non-game)
Microsoft Access
Visual Basic Programming
The Difference Between

How could you set the selections available in a Microsoft Access form combo box to be dependent on the selection made in a previous combo box?

I haven't used Microsoft Access in a while but I think you would have to modify the action properties of the combo box (i.e. you select choice 1 from the first combo box, then choices a,b and c appear in the second combo box).

In the second combo box's row source property add a reference to the first combo box in the criteria section of the field that matches the first combo box.

For example, if the first combo box is bound to the field Table1ID, and combo box 2 is going to use that value to select records to display, based on records that match combo box 2's table's FKField value, then you would:

a) go into the Combo Box 2 row source

b) add the table's FKField (or whatever it's called) to the query (unless it's already there)

c) and in the criteria row under the FKField, add:


(replace the above names with the specific names; you can also use the expression builder to get that expression).

d) Then, in Combo Box 1's AfterUpdate event, add the following lines of code:

Me.ComboBox2 = Requery Me.ComboBox2 = Null

And that should do it. Hope that help

Computer Programming
Visual Basic Programming

How do you restore a form after closing another in VB?

Suppose you have form 1, form 2 and form 3. form1 and form2 are showing. You press a button on form1 and form2 dissapears but form 3 shows. The code to the button would be as simple as this:



And when you want to close a form make sure you use Hide() not Close() if you want to be able to restore it later.

if you want to re open form2 but hide form form3 then just reverse it and also you should be able to use me.hide

Visual Basic Programming

Free download visual 2008? version). Make sure you have a windows live/hotmail account though because you will need it to get the express version free.

C Programming
Visual Basic Programming

What are the ten examples of high level programming language?

  • Java
  • C
  • Python
  • Scheme
  • Prolog
  • C++
  • C#
  • Java script
  • Lisp
  • Ruby
Mobile Phones
Microsoft Windows
Visual Basic Programming

How can you transfer data from PC to mobile through visual basic codes?

Easiest way to send stuff from a computer to a mobile device is by SMS (a text message) or MMS (a picture message). It will vary between mobile devices. On a Verizon cell phone, if your phone number is (321) 558-2057, send an email to and it will come out on your cell as a text message. The problem with this is the 120 character limit (someone correct me if that number is wrong). If you send the email to, it will come out as a picture message (or a "PIX" message as Verizon calls it) which has a 1000 character limit. Of course, not all phones support picture message, and it is generally more expensive and slower than a text message. You will need to find out the details from your cell phone provider.

The other alternative that will be more compatible with other phones is creating a WML page and viewing it on a WAP enabled phone. If you don't know WML, use this tutorial:

But then the phone won't actually store the data, it will just view it. There are tons of different possible approaches to this. You will need to talk to your cell phone provider for more details. Alternatively, if the phone in question supports e-mails you could set up your project to send emails


Unfortunately, Visual Basic does not have the capabilities to do this. This kind of feature is more internet-related than through the Personal Computer itself. Look into web design if you want to learn more about this. Finally, if your computer and phone has bluetooth you could use that.


You could do this simply by getting your phone's email address. To do that you simply send a text message (or picture message or both) to your regular mail (such as The you use the mailto function within visual basic to send the items that you want. If you need a tutorial search YouTube for some good ones.

Visual Basic Programming

What is a tooltip in vb?

A tool-tip is a small box that is displayed at the mouse location when hovering above wherever the tool-tip is set for a brief period of time, it provides a help prompt to the user.

An example of its use would be on an invalid entry into a form, you would point out the error in say, the password field and highlight it in a red box. When the user runs their mouse over this box you would use a tool-tip to tell them that their password was not long enough.

Another example is present on all of the questions in a category on this site, when you mouse over them it simply says 'Click to open in a new window' at the location of your mouse.

Visual Basic Programming

What is Visual Basic?

Microsoft Visual Basic is a programming language and is considered RAD(rapid application development) software that is used for creating applications. Visual Basic uses a programming language called NET Frameworks to take one programming language and decompile and recompile into a different language (vb to c#/c++). Some other popular programming languages are C++, HTML, JAVA, SQL, PHP, DELPHI, etc. Programming languages are the most common method of creating computer programs.

VB is a BASIC-based language that allows a programmer to make Windows applications very easily. It is probably the second easiest programming language (in my opinion). BASIC is the easiest. C++ is one of the hardest, but you can do anything with it.

Visual Basic is a computer programming language developed by Microsoft. It was created to be an "English like language" that anyone can learn. Me being a programer in it, I would have to say it is a very easy language to learn. Its not a powerful language and is mainly used for databases, but you can make a few good programs with it.

Visual Basic is a program developed by Microsoft that allows you to make programs and other things in part by dragging stuff to create the layout and in part by programming although even the programming part is aided. At first it was very hard to make any more advanced then a database or simple program with just a few items and math equations but now people are starting to tackle really hard things with about the only area left unpioneered by people being 3-d games which some people have gotten close to (2.5 D) but not quite achieved yet!

Punjab Technical University PTU
Visual Basic Programming

BSCIT 4th sem question papers from PTU?

i want qeestion paper in bsc-it

Visual Basic Programming

How do you create a menu editor in visual basic 6.0?

Men editor is a most important feacture of any application that enables a large number of commands in a small area. Visual basic provides to creating menu editor in our application. The following step is used to create a menu editor in visual basic 6.0-

  1. Click on the 'Tools' menu of VB application window.
  2. Select menu Editor from this.
  3. A dialogue box is appear. Here we named the menu, named its caption select shortcut for the menu.
  4. After doing this click on ok to create your menu.
  5. Then after from your menu we select it to write code or event to it for perform a specific operation
Visual Basic Programming

What do you means by Mask Edit Box control in VB 6.0?

this is a control which is use for storing the special type of data like storing the NIC number or complete phone number with code of a person.

i hope now you have knowledge about it. Muhammad Naseem

.NET Programming
Visual Basic Programming

What is app.helpfile in vbnet?

For providing context-sensitive help to VB5 and Vb6 applications, we can set the property called App.helpfile and hook-up the helpfile with the application.

For VB 5 and above one can use .hlp files as help files. For Vb6 and above one can use .chm files as application help files.

In VB.NET this property is not used for providing F1 help to the applications. Instead a control named - Helpprovider is dropped on the form and configured for associating help topics frm the .chm file to the form controls.

C Programming
Visual Basic Programming

How do you write a program in VB to compare three number and print larger number?

Public Sub Main() Dim X As Integer Dim Y As Integer Dim cnt As Integer 'Our counter. cnt = 1 Do Debug.Print X X = Y + X Y = X - Y If cnt >= 8 Then Exit Do Else cnt = cnt + 1 End If Loop End Su

Operating Systems
Visual Basic Programming

What are the advantages and disadvantages of existing system?

"...advantages and disadvantages of existing system"

Main disadvantage? If all you are doing is existing, you really need to get a life!

Main advantage? If you are merely existing, you are physically alive, which usually means you have a chance to get a life.

C Programming
Visual Basic Programming

Where can 'Borland C Book' be read in e-book form?

Wherever you want to. Provided you have an e-book reader, and you have got the book on it.


Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.