Home

TopPicks Blog

VB.Net code

Miscellaneous

Contact Me

 

Following are examples of programs written in Visual Basic.Net...

1) Simple Stopwatch Application

Program....Code...Notice how the buttons are enabled and disabled and how the DateDiff function works in the code for calculating elapsed time. Not as accurate as the 2nd version [see below].

2) Text Problem

Program....Code...How to make the text on a button change when it is clicked.

3) Button Enabled Problem

Program....Code...How to enable and disable buttons.

4) Date Problem

Program....Code...How to display the current date...

5) Calendar

Program....Code...A little calendar with a clock on it.

6) Savings Deposit

Program....Code...Observe the powers of key trapping!! No letters allowed...Enter details in any 3 boxes and it will compute the 4th.

7) Random Number

Program....Code...Returns a random number between 0 and 100.

8) Price Calculator

Program....Code...Calculates the price of ice cream based on the temperature outside.

9) Odd Integers

Program....Code...Adds consecutive odd numbers (starting with 1) until the sum exceeds a target value.

10) Encoding Problem

Program....Code...Encodes / Decodes a simple line of text using Ascii.

11) Mean & Standard Deviation

Program....Code...Calculates the mean and/or SD of up to 6 numbers.

12) Flash Card Addition

Program....Code...Displays a random sum for you to do then checks your answer and keeps a simple tally.

13) Password Validation

Program....Code...Password is 'whalsay76.'

14) Pizza Order

Program....Code...Checkboxes, radio buttons and message boxes...

15) Flight Planner

Program....Code...Listboxes and combo boxes...

16) Message Box

Program....Code...Build your own custom message box!

17) List Boxes

Program....Code...Move info from 1 list box to another...

18) Customer Database Input Screen

Program....Code...Makes use of various types of input controls, outputs sentences in a message box.

19) Temperature Conversion

Program....Code...Demonstrates the use of the scroll bar...Converts between Fahrenheit & Celsius.

20) Picture Box Playground

Program....Code...Demonstrates the different options for the SizeMode property of the picture box.

21) Image Viewer

Program....Code...Demonstrates the use of drive list boxes, directory list boxes and file list boxes.

22) Noughts & Crosses

Program....Code...Traditional game also known as Tic-Tac-Toe in N. America.

23) File Times

Program....Code...Monitors the time stamp on files on your PC and returns stats on how many files in a particular directory and what times they were created.

24) Shopping Cart

Program....Code...Multiple forms in one app...This is a very basic e-commerce prog.

25) Circle Geometry

Program....Code...This app calculates circle area and circumference from a given diameter.

26) Average Value

Program....Code...This adds numbers to a list box then calculates their average.

27) Note Editor

Program....Code...This has its own config file that remembers your settings.

28) Context Menu

Program....Code...Demonstrates colour and font dialogs.

29) World Capitals Quiz

Program....Code...Choose between text and multiple choice answers and choose country or capital.

30) Building Data Lines

Program....Code...Calculates the circumference and area of 20 circles between a user-controlled minimum and maximum diameter and outputs the resulting data neatly in a screen.

31) Note Editor 2

Program....Code...The same program as above but now you can save and open text files as well.

32) Recent Files

Program....Code...Keeps track of temperatures on a daily basis...demonstrates the Recent Files menu option commonly seen in major apps.

33) Simple Animation

Program....Code...A very basic animation which consists of 2 pics...(click the pic)...shows how it's done in the big apps.

34) Beep

Program....Code...Makes your PC beep at regular intervals.

35) Basic Animation

Program....Code...A bit more advanced now...

36) Fruit Machine

Program....Code...My favourite app...just hit Enter to spin 'em...also known as One-armed-Bandit in N America.

37) Random Integers

Program....Code...Randomly sorts a user-controlled number of integers...useful for games and such.

37) Drawing Lines

Program....Code...Draws random lines in a box.

38) Drawing Rectangles

Program....Code...Draws random sized rectangles and colours them in with 255 million random colours.

39) Drawing Pie Charts

Program....Code...Draws random pie charts.

40) Line, bar and pie charts

Program....Code...Draws random line, spiral, bar and pie charts.

41) Bounce

Program....Code...Bouncing ball animation...

42) Dice Rolling

Program....Code...Rolls a pair of dice.

43) RGB Colours

Program....Code...255 different shades each of red, green and blue...so mix and match!

44) Blackjack

Program....Code...My 2nd favourite...play against the dealer...also known as Pontoon.

45) Temperature Recording 2

Program....Code...An extension to the Recent Files program, but this time it plots the data in a graph as well.

46) Blackboard

Program....Code...Left-click for 1 colour and right-click for another...try drawing circles with it....it takes a bit of getting used to. The 2nd version [see below] works more fluently, but doesn't have the weird effect that you get with this version.

47) Lines & Polygons

Program....Code...First click up to 30 points on the app screen...then it will join the dots for you then form a polygon and finally fill the polygon with colour.

48) Drawing Curves

Program....Code...Does the same thing as above but with curved lines.

49) Hatch Brush

Program....Code...Demonstrates the hatch brush in various colours.

50) Linear Gradient Brush

Program....Code...Demonstrates the linear gradient brush effect with various colours.

51) Texture Brush

Program....Code...Demonstrates the texture brush...(3 texture samples enclosed)...and use your own...

52) Horizontally Scrolling Background

Program....Code...Use the scrollbar to control the speed of the scrolling.

53) Collision Detection

Program....Code...Use the cursor control keys to guide one of the rectangles around...this thing not only detects a collision, it measures the extent of the collision as well...a helluvalot of games rely on this sort of thing...

54) Bouncing Ball with Sound

Program....Code...Just like the title says...demonstrates how to incorporate sound files into your game/app...

55) Stopwatch 2

Program....Code...This version uses the GetTickCount method and is accurate to 1000th of a second.

56) Blackboard 2

Program....Code...This version works much better than the previous one and you can adjust the size of your chalk as well.

57) Rubber Band

Program....Code...Hold down your mouse button and move the mouse to make a square on the screen like you do on your desktop when bored...

58) Shape Guessing Game

Program....Code...Pretty much what you're expecting

59) Bouncing Balls Collide

Program....Code...More collision detection and reaction.

60) Moon

Program....Code...Use the arrow keys to navigate around the surface of the moon.

61) Sound Files

Program....Code...Uses drive, directory and file list boxes to locate sound files and plays them.

62) Pong

Program....Code...Another personal favourite, this is my take on the classic game. A 2-player game, use A and Z for player 1 and K and M for player 2.

63) Tab Control

Program....Code...Demonstrates the use of the tab control.

64) Date Selections

Program....Code...Demonstrates the use of the MonthCalendar and the DateTimePicker controls.

65) Rich Text Box

Program....Code...Demonstrates the use of the Rich Text Box and Font Dialog.

66) Note Editor 3

Program....Code...Same program as before but with a toolbar added. This will also deal with the problem of having no config file.

67) Adding Controls at Runtime

Program....Code...Instead of painstakingly adding every one of these buttons at designtime you can do it at runtime more easily, as this shows.

68) Printing

Program....Code...Printing is a little bit more complicated in Visual Basic.Net, but here's how to do it plus print previewing.

69) Help System

Program....Code...To make your own Help Files you will need the Microsoft HTML Help Workshop. This app demonstrates how to incorporate the finished help file into your program.

70) Biorhythms

Program....Code...Uses the DateTimePicker and calculates your physical, intellectual and emotional biorhythms for you.

71) Note Editor 4

Program....Code...This final version has a help file as well.

72) Loan Repayment Schedule

Program....Code...Enter the loan amount, yearly interest and number of months and this will calculate the monthly payment and print a full repayment schedule out.

73) Chart Printing

Program....Code...This app will input a .csv file (comma-separated values), convert the data into a graph and then print out this graph.

74) Phone Directory

Program....Code...A useful little program which saves up to 3 phone nos. per person and has an alphabetized look-up button array. It works by saving the names and numbers in a text file.

75) Books Database

Program....Code...This demonstrates how to use a VB front-end to work with a database.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

copyright is bollocks