Return to site

Visual Basic 2010 Source Code Samples

broken image
Samples

C Sample code Linear Search Algorithm Linear search is method for searching a value within an array. It 'sequentially' checks one by one of the arrays for the 'target element' until 'match is found' or until all the elements have Largest Rectangular Area in a Histogram Get minimum of two numbers in hist. Get the 'middle index' from corner. The Visual Basic Users Code Library: The VB and VBA users code library. Contains a VAST library of free source code. Dts sound software for hp. The code samples include API, SQL, ADO, ADOX, MAPI, ADO.NET, VB.NET, VB.NET Interop.


Tutorial 1 - First Program Getting Started
Download the free Visual Basic Express from Microsoft and start programming. It couldn't be more simple.
Tutorial 2 - Events
This tutorial shows events - Button Press, Mouse Enter, Mouse Leave, Resize, etc.
Tutorial 3 - Programming the Meaning of Life
Just a little humor to make programming interesting.
Tutorial 4 - Simple Calculator Part 1 (Simple Calculator)
This video tutorial shows how to create variables, work with data types, show classic string conversions, and perform a calculation.
Tutorial 5 - Simple Calculator Part 2 - RadioButtons (Simple Calculator)
RadioButtons will be added to the simple calculator.
Tutorial 6 - Simple Calculator Part 3 - Clean Up (Simple Calculator)
Data Parsing will be used with error handling.
Tutorial 7 - Playing Movies
This video will show how to use Windows Media Player within Visual Basic.
Tutorial 8 - Embedding YouTube Videos With Shockwave Flash Player
YouTube is a hot site. YouTube Videos can be loaded and run in Visual Basic applications. It is very simple to do.
Tutorial 9 - Random Numbers
Randomize and RND will be used to show how to generate random numbers for different situations.
Tutorial 10 & 11 - Guess My Number Game
This tutorial will show how to program the classic game Guess My Number. The code for the game can be downloaded for free.
Tutorial 12 - Bouncing Ball Animation
A timer and the VB Power Pack will be used to bounce a ball around the window.
Tutorial 13 - Parallel Arrays - Bouncing Balls Animation
Voicemod for macbook pro. Tutorial 13 will built upon the code from Tutorial 12. Parallel arrays will be used to bounce several balls around the window at different speeds.
Tutorial 14 - Making a Multidimensional Array and Matrix
This tutorial will show how to create a multidimensional array. An 2 dimensional array (matrix) will be used to create a deck of playing cards.
Tutorial 15 - Multiple Windows Forms
Adding new window forms to your application is easy. Click on Project then Add Windows Forms. Select the form you want, rename the form (optional) and click OK.
Tutorial 16 - ASCII Tables and Values
This tutorial shows KeyPresses and how to sort characters based upon their ASCII values.
Tutorial 17 - SpeakABCs Overview (SpeakABCs)
The next group of tutorials will create an entire application from start to finish. SpeakABCs is that application.
Tutorial 18 - Form Setup and KeyPresses (SpeakABCs)
This tutorial shows how SpeakABCs is being setup and how the application can accept KeyPresses.
Tutorial 19 - RadioButtons and ASCII Values (SpeakABCs)
Currently, SpeakABCs has KeyPresses that allow for characters other than letters or numbers. By checking the range of ASCII values the computer can determine what key is being pressed. By using RadioButtons, the user can select what keys the computer will accept.
Tutorial 20 - ColorDialog (SpeakABCs)
Visual Basic comes with a Color Dialog Box. When called, the ColorDialog will appear allowing the user to select a color or cancel the dialog. By checking to see if the user clicked OK, the application can change the object to the color selected.
Tutorial 21 - Playing Sound Files (SpeakABCs)
For this tutorial wav sound files will be use. MP3 sound files work the same way. This tutorial will cover three ways sound files can be played: Hard coded, part of the solution, and by relative location.
Tutorial 22 - Menus (SpeakABCs)
To add a menu to your application, click on Menus & Toolbars within the Toolbox. and drag and drop MenuStrip (Context Menu Strip is for right mouse clicks) into your form.
Tutorial 23 - SplashScreen (SpeakABCs)
A SplashScreen can be added by clicking on Project ---> Add Windows Form ---> then selecting Splash Screen from the templates.
Tutorial 24 - AboutBox (SpeakABCs)
An AboutBox can be added by clicking on Project ---> Add Windows Form ---> then selecting About Box from the templates.
Tutorial 25 - HelpBox (SpeakABCs)
This tutorial will use a TextBox and format text to make an HelpBox for the user.
Tutorial 26 - Icons (SpeakABCs)
To insert an icon into your application, select the Icon button within the Application Properties.
Tutorial 27 - Wrap Up of SpeakABCs (SpeakABCs)
There are just a few adjustments that must be done to make SpeakABCs complete.
Tutorial 28 - Multi-Dimensional & Parallel Arrays
There was a VB application assignment that required multi-dimensional arrays when it should have required parallel arrays. This tutorial shows the difficulty of using multi-dimensional arrays when parallel arrays should have been used.
Tutorial 29 - Making a Class
This tutorial will take what was done in Tutorial 28 and modify the application for use with classes.
Tutorial 30 - Classes for a Roll Playing Game Simulation
The tutorial is a walkthrough of a roll playing game simulation program. The program uses a class to create monsters and our hero. Once the monsters and hero are created they will fight to the death. Once the hero is killed off, the game ends.
Tutorial 31 - Picture Transparency
PictureBoxs support false transparency. This tutorial shows the limitations of false transparencies and how to work with them.
Tutorial 32 - EZInvaders Video Game Overview
It is time to make a simple video game. EZInvaders shows the logic on making a video game. EZInvaders uses PictureBoxes. It is not the bast way of making a game but is one of the simplest to understand.
Tutorial 33 - Drawing With GIMP (EZInvaders Game)
Drawing the invader and shooter in GIMP.
Tutorial 34 - Programming the Shooter (EZInvaders Game)
Shows how to move the shooter with arrow keys.
Tutorial 35 - Firing the Shot (EZInvaders Game)
Shows the logic behind firing the shot.
Tutorial 36 - Invading Earth (EZInvaders Game)
This shows how to move the invader and detect if it hits the Earth.
Tutorial 37 - Hit Detection (EZInvaders Game)
This tutorial gives the code on how to shoot down the invader
Tutorial 38 - Arrays Section 1 (EZInvaders Game)
Parallel arrays will be used to add many invaders to the game.
Tutorial 39 - Arrays Section 2 (EZInvaders Game)
Parallel arrays will be used to add many invaders to the game.
Tutorial 40 - Dynamically Making Objects (EZInvaders Game)
Adding object by cutting and pasting them is a tedious method when working with large amounts of objects.Dynamically adding objects is a very simple and quick process.
Tutorial 41 - Dynamically Adding Invaders (EZInvaders Game)
Adding object by cutting and pasting them is a tedious method when working with large amounts of objects. Dynamically adding objects is a very simple process. This tutorial show how to add invaders dynamically.
Tutorial 42 - Adding WAV Sound Files (EZInvaders Game)
What is a game without sound? A few WAV files will be added to the game.
Tutorial 43 - Pausing the Game (EZInvaders Game)
Pausing the game is as easy as enabling or disabling the timer.
Tutorial 44 - Replay (EZInvaders Game)
This tutorial shows how to start the game over, once the game finishes.
Tutorial 45 - Double Buffering (EZInvaders Game)
Double buffering the form can prevent images from flickering.
Tutorial 46 - Playing YouTube Videos With WebBrowser & Parameters
This tutorial shows how to embed and play a YouTube video using the WebBrowser control.

Input from user must be validated before it is accepted and stored into the database table. For validating number visual basic provides 'IsNumeric' Function that takes the string as input parameter. The return value of this function is a boolean value either True or False.
Often the text box input values are checked for validation. If you have a text box named txtAmount for input of currency amount then you can validate it in the text box's Validate event.
I will explain number validation in VB 6.0 with an example. Create a standard EXE project in Visual Basic IDE. Put a text box and set its name property to txtAmount. Put a command button and set its name property to cmdValidate. In the Validate Event of the text box write the following code.
Private Sub txtAmount_Validate(Cancel As Boolean)
If Not IsNumeric(txtAmount.Text) Then
Cancel = True
MsgBox 'Enter valid Amount', vbExclamation
Visual Basic 2010 Source Code Samples

txtAmount.Text = '
End If

Visual Basic Source Code Download

End Sub
Source

C Sample code Linear Search Algorithm Linear search is method for searching a value within an array. It 'sequentially' checks one by one of the arrays for the 'target element' until 'match is found' or until all the elements have Largest Rectangular Area in a Histogram Get minimum of two numbers in hist. Get the 'middle index' from corner. The Visual Basic Users Code Library: The VB and VBA users code library. Contains a VAST library of free source code. Dts sound software for hp. The code samples include API, SQL, ADO, ADOX, MAPI, ADO.NET, VB.NET, VB.NET Interop.


Tutorial 1 - First Program Getting Started
Download the free Visual Basic Express from Microsoft and start programming. It couldn't be more simple.
Tutorial 2 - Events
This tutorial shows events - Button Press, Mouse Enter, Mouse Leave, Resize, etc.
Tutorial 3 - Programming the Meaning of Life
Just a little humor to make programming interesting.
Tutorial 4 - Simple Calculator Part 1 (Simple Calculator)
This video tutorial shows how to create variables, work with data types, show classic string conversions, and perform a calculation.
Tutorial 5 - Simple Calculator Part 2 - RadioButtons (Simple Calculator)
RadioButtons will be added to the simple calculator.
Tutorial 6 - Simple Calculator Part 3 - Clean Up (Simple Calculator)
Data Parsing will be used with error handling.
Tutorial 7 - Playing Movies
This video will show how to use Windows Media Player within Visual Basic.
Tutorial 8 - Embedding YouTube Videos With Shockwave Flash Player
YouTube is a hot site. YouTube Videos can be loaded and run in Visual Basic applications. It is very simple to do.
Tutorial 9 - Random Numbers
Randomize and RND will be used to show how to generate random numbers for different situations.
Tutorial 10 & 11 - Guess My Number Game
This tutorial will show how to program the classic game Guess My Number. The code for the game can be downloaded for free.
Tutorial 12 - Bouncing Ball Animation
A timer and the VB Power Pack will be used to bounce a ball around the window.
Tutorial 13 - Parallel Arrays - Bouncing Balls Animation
Voicemod for macbook pro. Tutorial 13 will built upon the code from Tutorial 12. Parallel arrays will be used to bounce several balls around the window at different speeds.
Tutorial 14 - Making a Multidimensional Array and Matrix
This tutorial will show how to create a multidimensional array. An 2 dimensional array (matrix) will be used to create a deck of playing cards.
Tutorial 15 - Multiple Windows Forms
Adding new window forms to your application is easy. Click on Project then Add Windows Forms. Select the form you want, rename the form (optional) and click OK.
Tutorial 16 - ASCII Tables and Values
This tutorial shows KeyPresses and how to sort characters based upon their ASCII values.
Tutorial 17 - SpeakABCs Overview (SpeakABCs)
The next group of tutorials will create an entire application from start to finish. SpeakABCs is that application.
Tutorial 18 - Form Setup and KeyPresses (SpeakABCs)
This tutorial shows how SpeakABCs is being setup and how the application can accept KeyPresses.
Tutorial 19 - RadioButtons and ASCII Values (SpeakABCs)
Currently, SpeakABCs has KeyPresses that allow for characters other than letters or numbers. By checking the range of ASCII values the computer can determine what key is being pressed. By using RadioButtons, the user can select what keys the computer will accept.
Tutorial 20 - ColorDialog (SpeakABCs)
Visual Basic comes with a Color Dialog Box. When called, the ColorDialog will appear allowing the user to select a color or cancel the dialog. By checking to see if the user clicked OK, the application can change the object to the color selected.
Tutorial 21 - Playing Sound Files (SpeakABCs)
For this tutorial wav sound files will be use. MP3 sound files work the same way. This tutorial will cover three ways sound files can be played: Hard coded, part of the solution, and by relative location.
Tutorial 22 - Menus (SpeakABCs)
To add a menu to your application, click on Menus & Toolbars within the Toolbox. and drag and drop MenuStrip (Context Menu Strip is for right mouse clicks) into your form.
Tutorial 23 - SplashScreen (SpeakABCs)
A SplashScreen can be added by clicking on Project ---> Add Windows Form ---> then selecting Splash Screen from the templates.
Tutorial 24 - AboutBox (SpeakABCs)
An AboutBox can be added by clicking on Project ---> Add Windows Form ---> then selecting About Box from the templates.
Tutorial 25 - HelpBox (SpeakABCs)
This tutorial will use a TextBox and format text to make an HelpBox for the user.
Tutorial 26 - Icons (SpeakABCs)
To insert an icon into your application, select the Icon button within the Application Properties.
Tutorial 27 - Wrap Up of SpeakABCs (SpeakABCs)
There are just a few adjustments that must be done to make SpeakABCs complete.
Tutorial 28 - Multi-Dimensional & Parallel Arrays
There was a VB application assignment that required multi-dimensional arrays when it should have required parallel arrays. This tutorial shows the difficulty of using multi-dimensional arrays when parallel arrays should have been used.
Tutorial 29 - Making a Class
This tutorial will take what was done in Tutorial 28 and modify the application for use with classes.
Tutorial 30 - Classes for a Roll Playing Game Simulation
The tutorial is a walkthrough of a roll playing game simulation program. The program uses a class to create monsters and our hero. Once the monsters and hero are created they will fight to the death. Once the hero is killed off, the game ends.
Tutorial 31 - Picture Transparency
PictureBoxs support false transparency. This tutorial shows the limitations of false transparencies and how to work with them.
Tutorial 32 - EZInvaders Video Game Overview
It is time to make a simple video game. EZInvaders shows the logic on making a video game. EZInvaders uses PictureBoxes. It is not the bast way of making a game but is one of the simplest to understand.
Tutorial 33 - Drawing With GIMP (EZInvaders Game)
Drawing the invader and shooter in GIMP.
Tutorial 34 - Programming the Shooter (EZInvaders Game)
Shows how to move the shooter with arrow keys.
Tutorial 35 - Firing the Shot (EZInvaders Game)
Shows the logic behind firing the shot.
Tutorial 36 - Invading Earth (EZInvaders Game)
This shows how to move the invader and detect if it hits the Earth.
Tutorial 37 - Hit Detection (EZInvaders Game)
This tutorial gives the code on how to shoot down the invader
Tutorial 38 - Arrays Section 1 (EZInvaders Game)
Parallel arrays will be used to add many invaders to the game.
Tutorial 39 - Arrays Section 2 (EZInvaders Game)
Parallel arrays will be used to add many invaders to the game.
Tutorial 40 - Dynamically Making Objects (EZInvaders Game)
Adding object by cutting and pasting them is a tedious method when working with large amounts of objects.Dynamically adding objects is a very simple and quick process.
Tutorial 41 - Dynamically Adding Invaders (EZInvaders Game)
Adding object by cutting and pasting them is a tedious method when working with large amounts of objects. Dynamically adding objects is a very simple process. This tutorial show how to add invaders dynamically.
Tutorial 42 - Adding WAV Sound Files (EZInvaders Game)
What is a game without sound? A few WAV files will be added to the game.
Tutorial 43 - Pausing the Game (EZInvaders Game)
Pausing the game is as easy as enabling or disabling the timer.
Tutorial 44 - Replay (EZInvaders Game)
This tutorial shows how to start the game over, once the game finishes.
Tutorial 45 - Double Buffering (EZInvaders Game)
Double buffering the form can prevent images from flickering.
Tutorial 46 - Playing YouTube Videos With WebBrowser & Parameters
This tutorial shows how to embed and play a YouTube video using the WebBrowser control.

Input from user must be validated before it is accepted and stored into the database table. For validating number visual basic provides 'IsNumeric' Function that takes the string as input parameter. The return value of this function is a boolean value either True or False.
Often the text box input values are checked for validation. If you have a text box named txtAmount for input of currency amount then you can validate it in the text box's Validate event.
I will explain number validation in VB 6.0 with an example. Create a standard EXE project in Visual Basic IDE. Put a text box and set its name property to txtAmount. Put a command button and set its name property to cmdValidate. In the Validate Event of the text box write the following code.
Private Sub txtAmount_Validate(Cancel As Boolean)
If Not IsNumeric(txtAmount.Text) Then
Cancel = True
MsgBox 'Enter valid Amount', vbExclamation
txtAmount.Text = '
End If

Visual Basic Source Code Download

End Sub

Visual Basic 2010 Source Code Samples Online


Visual Basic 2010 Source Code Samples Free

In the command buttons click event write the following code,
Private Sub cmdValidate_Click()
MsgBox 'Valid amount'
End Sub

Visual Basic 2010 Source Code Samples Pdf

The output for different inputs are as under,

Visual Basic 2010 Source Code Samples Download






broken image