Category Archives: Visual Basic 6 (VB6)

Create and save into .txt files.

This will create and write into a *.txt file of your choice. Put this code in a timer and you have yourself a keystroke logger. You can save the contents of a textbox into a file also. Original Author: Abdul Kudrath Assumptions Put this code in a button and it will save the contents of a textbox. Code ‘… Read More »

Count number of lines/returns in a textbox

Simply counts the number of lines in a textbox (the textbox should be multiline=true, otherwise it is pretty useless). Put this in a module so it can be reused. Original Author: Jono Spiro Inputs USAGE–countLines(the textbox)EXAMPLE–countLines(text1) Returns Returns the number of lines in a textbox. Code Public Function countLines(textBox As textBox) As LongDim A%, B$A% = 1B$ = textBox.textDo… Read More »

CollectionPlus ! (See VERSION 2)

‘In replacement of existing Collection in VB‘SEE MY NEW VERSION ! Original Author: Rick Inputs ‘Same as Collection Assumptions ‘CollectionPlus his based on existing Collection, but you can ask question like‘ifKeyIsThere ou ifItemIsThere , returns True or False.‘A Public Event Error is available.‘It’s a very simple code but useful !‘In my next version i’m gonna handle Item,Key and Group‘so… Read More »

Simple Email Send

While browsing through the files on this site, I noticed that most listings that dealt with sending e-mail using VB used the Winsock Control. I recently wrote a small demo for a customer that reads a database file, and then sends it to an email address. This code requires that you use the MAPISession Control as well the… Read More »

A huge tip: Visual Basic Scripting Host

This tip is the most powerful bit of code I’ve ever come across. It will act as an exe but with no need to compile. However you must have either Win 98 or IE5 for it to work Original Author: Tmess Code First open up notepad and simply write:Msgbox “HI”Now save the text file. In windows explorerfind that text… Read More »

*Improved* GoAway Screen Wipe

I just quickly improved this screen wipe function written by Jesse Foster.It runs a bit smoother and is usable as a function for any form. Just drop it into a module. Also, I made it work so that it is ‘public’ not private. Original Author: Jono Spiro Inputs ‘Screenwipe form to wipe, speed‘example: screenwipe form1,100 Code Public Function screenWipe(Form… Read More »

Sort a ListView by Number or Date (Updated)

This code allows a ListView control to be sorted by Number or Date without having to use APIs (except to lock the screen) Original Author: Pete Cozens Inputs N/A Returns N/A Side Effects No known side-effects at this time. Does not mess-up theListItems collection like a Custom API-implemented sort. Code ‘****************************************************************’ ListView1_ColumnClick’ Called when a column header is clicked… Read More »

Find and Highlight Substring

‘ Given an editable textbox named Text1, this code prompts to find a word and‘ searches throught the textbox and highlights the first occurance of the‘ found word (if exists). Original Author: Bill Chelonis Code Private Sub FindFunction_Click()Rem Find/highlight first occurance of a word in a textbox named Text1Dim a As StringDim y As Integera = InputBox(“Find text: “,… Read More »

A “Play” Command for Visual Basic

This is the equivalent of the QBasic PLAY command that enabled you to play notes through the PC speaker. This version allows you to take advantage of the Sound card and therefore has many advantages. It uses the MIDI interface to send individual or multiple notes to the sound card. Original Author: Aidan Inputs It requires the notes that… Read More »

FindFile – Fast, using the API

Uses the FindFile, FindNextFile, and SearchPath API functions to quickly find a file on your hard drive. Runs faster than methods which use Dir$. Original Author: Dave Hng Inputs Filename – Filename to search for.Path – The path to start searching from. Assumptions None, if you want to find out what the API does exactly, read the Win32SDK. It’s… Read More »