Visual Basic Lookup Software
This program was created in a Visual Basic Programming course I took at Kent State University. I chose this because it demonstrates my knowledge about how to create interactions between various controls in a Visual Basic, and also how to reference data from outside of the program itself, allowing for changes to be made to the underlying database without the need to edit the primary executable.
Item Price Lookup Application
This is a Windows application that allows the user to select an item from a listbox and reveal the corresponding price of the item in the textbox to the right.
The video to the left demonstrates the basic functionality of a piece of software, created using Microsoft Visual Studio, which displays the price of an item when it is selected from the list on the left side of the window.
It references an external file to build the list when the program is launched and to look up the price when the item is selected. This works through use of the "SelectedIndexChange" event for that List Box, which triggers the Item Price label to update to the related price in the external file.
Finally, it has a built-in exit button that uses the Me.Close() method to close the form when the "Click" event is triggered on the exit button.
To the right is a code snippet, with comments in green, that walks through how the program opens the external file, reads through it to find the items and prices, and adds them to two variables which store those values for later use in the program. It simultaneously builds the list for the list box as each new substring is added to the "ItemCode" column of the "Items" array.
'open the file for input
infile = IO.File.OpenText("ItemInfo.txt")
'loop through the file
Do Until infile.Peek = -1 OrElse intSub = Items.Length
'read a line from the file
strLine = infile.ReadLine()
'find the comma
intComma = strLine.IndexOf(",")
'separate the fields
Items(intSub).ItemCode = strLine.Substring(0, intComma)
Items(intSub).ItemPrice = strLine.Substring(intComma + 1)
'add item to listbox
lstItemList.Items.Add(Items(intSub).ItemCode.ToString)
'move to the next line
intSub += 1
Loop
infile.Close()