Category Archives: Visual Basic 6 (VB6)

Stop Typeing in Textboxes but dont diasble them

This Code stops the End-user typing o#into a textbox but still allows themto scroll it because it is not disabled Original Author: Andrew Timberlake API Declarations Code in textbox_keypresskeyascii = 0in textbox_keydown and textbox_keyupkeycode = 0Its as simple as that.

RECURSIVE DESCENT PARSER FOR NUMERIC EXPRESSIONS

RECURSIVE DESCENT PARSER FOR NUMERIC EXPRESSIONS Original Author: Sven-Erik Dahlrot Inputs A string with a nummeric expression to parse Returns The result of the parsing as a string API Declarations Code Option ExplicitPrivate Const NON_NUMERIC = 1Private Const PARENTHESIS_EXPECTED = 2Private Const NON_NUMERIC_DESCR = “Non numeric value”Private Const PARENTESIS_DESCR = “Parenthesis expected”Private Token As Variant   ‘Current token’*********************************************************************’*’*   RECURSIVE DESCENT… Read More »

3D-Stars in a Form

Draws a nice 3D-Starfield in a Form (uses X,Y,Z positions)width a very short codeShades each star depending on the distance. Original Author: Mikael Rickan Assumptions Create an Timer for the form called Timer1 Side Effects None (maybe some flickering) API Declarations Code ‘Dim X(100), Y(100), Z(100) As IntegerDim tmpX(100), tmpY(100), tmpZ(100) As IntegerDim K As IntegerDim Zoom As IntegerDim… Read More »

Credit Card Identification

Determines type of Credit Card by it’s number. Original Author: John Anderson Inputs Card Number as String Assumptions This is based on documents from CyberCash’s home page. Returns Card Type as String Side Effects Is not Year 2061 Compliant API Declarations Code Public Function CardType(CCNum As String) As StringDim Header As String  Select Case Left$(CCNum, 1)    Case “5”      Header = Left$(CCNum, 2)      If… Read More »

DateFunctions

Use this module to do many calculations concerning dates. I will maybe add a few more later on.This module inlcudes the following Functions:1. DayOfWeek (Returns the day of the week of a certain date)2. DayOfYear (Returns the day of the year, eg. 31 December 1999 will be 365)3. DaysBetween (Returns the amount of days between two dates)4. DaysInMonth… Read More »

Common Dialog API calls

Here are the Windows API calls for the ShowOpen, ShowSave, ShowPrinter, ShowColor and ShowFont (Thanks to Jaen Saul aka SlowByte for his post) dialogs. Also included is the beginnings of the ShowFonts dialog but I am haning some trouble getting it to work. These calls are more difficult to use than the CommonDialog control placed on a form,… Read More »

Play “.wav” files using VB

Play WAV files using VB ~ awesome ~ Add sound to your projects!by: EM Dixsonhttp://developer.ecorp.netHUNDREDS of FREE Visual Basic Source Code Samples, Snippets, Projects and MORE! Original Author: EM Dixson Inputs NA Assumptions NA Returns NA Side Effects NA API Declarations NA Code ****************************************************************         http://developer.ecorp.net         **************************************************************** Auhor: EM DixsonThis code shows how to play a wave file from VB.Call… Read More »

AutoResize version 2

This code resizes a form and it’s controls (and fonts) according to the users resolution. Original Author: Mark Parter Inputs designwidth, designheight, designfontsizeFor example if you designed your app at 800×600 and Small Fonts then you would set the above variables to 800, 600, 96 (or 120 for Large fonts). Then just sit back and let the code do… Read More »

Perfect Pause

Pauses an operation while allowing other operations to run. This pause is date and time based. The sleep function freezes your computer. The timer function and timer controls stop at midnight because they return to a 0 value. The perfect pause continues where these stop. It’s highly configurable. Original Author: rbennett Inputs ‘Seconds are inputed as seconds ( 1… Read More »