K & K Consulting    K & K Consulting

K&K Home VB Guru Home Search VB Site VB Code VB Tips VB Tutorials VB Questions

K&K Home
Up
Code Snippets
Upload Your VB Code

 

VB Code & Snippets

 

Categories

ActiveX

Add-In's

BAS Files

Database

HTML

Internet

Miscellaneous

OCX

Registry

Utilities

Win API

Win Networking

XML

Code Snippets

 

ActiveX

Timzone.zip

Time Zone Conversion 

This file includes all code listings for Mark Tucker's August 1999 feature, "Next Stop: The Time Conversion Zone," as well as the complete source for the article. The source incorporates a sample VB program and ASP page to show you how to use it. 

18.40kb

AppEmail.zip

SMTP Email 

Do you want to send Email from your Applications but do not want to have the hassle of MAPI,  CDO or Exchange?  Well this DLL will allow you to send HTML or Text based Email from your Applications with just one function call.  For HTML based, you can send full HTML code to create professional looking Emails. Includes the ActiveX DLL and a sample application to show you how to use the DLL.  

NOTE:  This code will only run on a Windows 2000 based system that uses DNS.

NOTE 2: This code has been updated on May 27, 2001 to solve some DNS entry problems

This code was written by the VB Guru

17kb

VBMsgHook.zip

MsgHook 

The MsgHook DLL is an ActiveX component written in VB6, that lets you perform safe and efficient subclassing even from within the Visual Basic IDE in debug (break mode). 

31kb

NT Log Events

NT Log Events

LogNTEvent is a class that lets a VB app write directly to the NT event log. The zip file includes a demo project and a sample DLL that contains the messages to be logged.

5kb

ClsVersion

Versioning Your Object

When incorporated into an ActiveX Object, this Class will allow any COM compliant, client application, to query your Object for Major, Minor and Build properties, plus a few other goodies. The Client Application can then verify versions and compile date.

This code was written by the VB Guru

1.16kb

Timer Lite.zip

Timer Lite DLL

This timer works just like the standard timer OCX in VB but is an ActiveX DLL format, allowing you to use a timer in your ActiveX EXE's and DLL's. This is the full compiled DLL, just download the DLL, register it, add a reference in your project to it, then use as you would any other timer

This code was written by the VB Guru

6kb

Timer Lite.zip

Fire Events From Classes In A Collection

This is a sample project that will demonstrate how to fire events from classes in a collection

This code was written by the VB Guru

 

24kb

Best Blue 468x60

VB IDE Add-In's

CodeFindAddIn.zip

Error Handler Add-In

This addin greatly simplifies adding error handling to VB programs. Simply register the DLL using REGSVR32 and the addin will be added into the Visual Basic tools menu. Keep the two template files in the same directory as the DLL. Move the cursor within 10 lines after the procedure name line and activate the add-in by pressing Alt-T-E or by clicking on the menu: all the error handling code will be added automatically. The templates can be modified based on preference, as explained in the Readme.txt file.

12kb

CodeFindAddIn.zip

Extended Search Add-In

This add-in augments the VB IDE with the capability to search a string or a pattern across all the modules of all the projects loaded in the environment. Better yet, all the matches are displayed in a non-modal, hierarchical treeview control, so you can move to each occurrence by simply double-clicking on it. All the usual search options are supported, included search for whole words and for a regular expression. All the recent searches are kept in an history list, and you can dock the window as you would do for any regular IDE window. This add-in comes with fully commented source code! 

42kb

VBPropBuilder.zip

Property Addin

This addin greatly accelerates the process of creating new property procedures, both in class, form, UserControl and UserDocument modules. You enter the name of the property, its type, its arguments (if any), its initial value (if any), scope (Public, Friend, Private), type (read/write, read-only, write-only, write-once/read-many), and the addin creates the code for you. You can also create Default properties by ticking a checkbox in this dialog, without having to invoke the Procedure Attributes dialog. If you add a description to the property, this will become a header comment and, at the same time, the string will be assigned to the Description attribute of the property. The addin comes with a number of predefined properties and attributes, that can be then selected from the "Name" combobox. 

29kb

Doc-U-Mentor

Doc-U-Mentor

Doc-U-Mentor is a free VB Add-In that creates Function and Subs on the fly, including Synopsis.  The Synopsis places your function name, date, compiler version and the developer name.  It will list all the parameters ect.  Have you created your app already and just have to document it? No problem, just set the option to Header only and it will just create the synopsis.  This little puppy will defiantly reduce your coding time. Compiled DLL only

This code was written by the VB Guru

29.2kb

Addresser

Base Addresser

Addresser is a free VB Add-In for creating base addresses for ActiveX Dll's and OCX's.  When you want to create a new address before compiling, just start the wizard, it will generate the address for you, verifying against a database, that the address has not been assigned.  Can be installed on a network for sharing with multiple developers. Compiled DLL only.

This code was written by the VB Guru

39.5kb

Spell Check VB

Spell Check VB

This addin is designed to check the spelling of your VB comments and/or double-quoted string literals inside your VB6 IDE using a procedure similar to MS-Word without checking the rest of the code. The advantage of this Addin over commercially available code spell checkers is that it (1) can also check the double-quoted strings inside vb code without checking the rest of the code, (2) can supply custom options and a dictionary, (3) is free, (4) comes with full source code so you can create a version in a foreign language and make enhancements. You are only required to have MS-Word 2000 or MS-Word 97 because this Addins VB code needs the objects they expose. It is also possible to change this code to use MS-Excel in place of MS-Word or completely different objects. Two versions are supplied with a setup.exe and source directory: one for MS-Word 2000 and the other for MS-Word 97.

900 KB

Download From MZ Tools Web Site

MZ Tools For VB 6

MZ-Tools 2.0 is a freeware 'all-in-one' Add-In for Visual Basic 6.0 which adds several features missing in the VB 6.0 IDE. It provides a main menu, a toolbar, handy context menus or customizable shortcuts to access those features.

Through a dialog window, you can customize several Add-In features to meet your development standards (data type prefixes, template for procedure headers, template for error handler, etc.) or your personal preferences (user name, shortcuts, etc.)

For your convenience, the add-in has been localized in the following languages: English, Spanish, French, Italian, German and Portuguese.

Installation is as simple as downloading the Add-In (a DLL file and a configuration file compressed in a .zip file) to a single folder and registering the DLL file with regsvr32.exe (a setup program is not needed). If for any reason you do not like the Add-In and want to uninstall it, simply unregister it with regsvr32.exe /u and delete the files.

You can run the Add-In from a local disk or from a network shared folder (probably read-only to ensure that all developers of a team are using the same Add-In customization established by a team leader).

137 KB

 

BAS Files

Text Box Features

Provides access to features of the text box control not exposited directly to VB. Code & Samples. 4.39kb

DCOM Stuff

BAS file with error handling and remote procedure use for DCOM applications.   1.99kb
FormFades Routines for making really cool fading effects on any form 645b
Roll Form Routines for making your form "Roll Up & Down"  depending on if the mouse is over the form.  When the user moves the mouse over the title bar, the form rolls down. When moved off, the form rolls up

This code was written by the VB Guru

665b
Shell Functions Container for calling the most popular shell.dll API's

This code was written by the VB Guru

2.93kb

Database

DB Info

By supplying a DSN entry, it will attempt to connect to that database and list all the tables in it. When you click on a table, it lists all the fields and the attributes it can. Its been tested on MS-Access and Sybase on NT and Unix and works well. Again, all source is included.  4.24kb

HTML

dynamicsounds.zip

DHTML Sounds

Do you want to play sounds on your website when a user presses a button or on a mouse over event?  Well here is a sample HTML file that will pre-load the files from the server to the client browser, then when you set the proper tags for MouseOver(), Click(), or any DHTML event, it will play the sound of your choice.  Full documentation and samples included.
Note: This file is a txt file in the zip file, to use it, just download extract the txt file,and rename it to a .htm file.

1.16kb

clsSortableTable.zip

VB ASP Class for RS

This is a VBScript class that will generate and write an HTML table filled by a RS. All you have to do is pass set its connection and SQL properties. The table will be pageable and sortable by clicking the column heads. You can set the column heads to text or images. 
You can also set on of the columns to have a link (like a tradenum going to a trade details page). 
This is a nice example of how to use a VBScript class. 
Note, this is a .inc file in the zip file,  after unzipping the file, use the include tag to Include it in your ASP page, or rename it to a .ASP file. This file is very well documented.

20.6kb

Internet

VB FTP

VB FTP

Sample application that implements FTP connection, download, and upload using the WinInet FTP API from Visual Basic. Includes all source code.

24kb

ASP Chat

ASPChatWorx

Version 3.0 of ASPChatWorx, upgraded 07/05/2000, is a chat application implemented entirely in ASP and is ready to run immediately. All you need to do is create a virtual directory for the application, and copy the files from the .zip file into that directory. Refer to the readme.txt file for more information. 
Note: Version 3.0 of the application works on IIS but not PWS. 

15kb

Download from Microsoft

Web Services and the SOAP Toolkit for Visual Studio 6.0

Web Services represent the next evolution of this shift, extending the concept of off-the-shelf software with that of software delivered as a service. Web Services are building blocks that enable developers to build and aggregate applications and services from local and remote resources for a range of clients.

1.23MB

scrctohtm.zip

This program converts Visual Basic source code into a form suitable for displaying on a Web page. It converts special characters such as < into the proper codes (&lt;). When it finds a ' not inside a string, it treats the rest of the line as a comment and makes it bold.

4kb

Netdial.zip

Dial the Net Automatically

Does your application need to connect to the Internet?
Most code snippets simply show you how to display a typical connection dialog box. This method has three basic flaws; it doesn't force a dial-up, often requires the name of the connection and doesn't let you know when a connection has been made.
Thankfully this code snippet solves all those problems by using Internet Explorer's own automatic dial-up settings.
If you double-click the Internet Options icon in the Control Panel, you'll notice the Connections tab hosts a list of possible dial-up connections.
This snippet utilizes a couple of little-known API calls that can automatically dial-up and disconnect from the default connection in that list – just like Internet Explorer does if it needs to connect to the Net.
Note: If the 'Never Dial a Connection' option is selected, this code will not be able to connect. It does as Internet Explorer does, and Internet Explorer simply wouldn't connect if that option was selected.
It's worth noting that this code pauses until the connection is actually made - or not, as the case may be. And that's definitely a good thing.

720b

 

Misc

Control Panel App Zip File

Control Panel App

All in one Control Panel Applet Loader.

2.27kb

Tool Tip Class

Extended Tool Tip Class

Use this class to show fully customizable, multi-lined, tool tips using the tool tips class from comctl32.dll.The Tool tip can have Muli-Lines, custom colors, a Title, an Icon and style. It looks like the W2k tool tips

9kb

MsgBoxEx

Extended Message Box Class

This code provides two extended MsgBox functions: MsgBoxMove and MsgBoxPause. MsgBoxMove function allows you to display your message box at a location specified by you: Syntax: MsgBoxMove(hwnd, Message, Title, Buttons, X, Y) MsgBoxPause function allows you to have the message box automatically disappear, after pausing for a number of seconds specified by you. Syntax: MsgboxPause(hwnd, Message, Title, Buttons, Seconds) Like the Msgbox function, each is capable of returning the value of the button clicked.The project consists of two files: MsgBoxEx.bas and MsgBoxEx.frm. The former contains the functions and the latter exemplifies the use of them. 

Usage: Include the MsgboxEx.bas (less than 50 lines in total) in your project and you have these two functions at your disposal.

The Guru's Note:
It came to my attention that this link pointed to the wrong ZIP file, it has now been corrected, 10/25/2000

8kb

MsgBoxEx

Extended Message Box Class DLL Version

This code is the same as the above code, just in a DLL version that I converted.  I have not tested this with multiple instances of the class running at the same time; this may or may not cause a problem, due to the call back functions.  If it causes problems, try changing the main class to Single use.

Includes all DLL code and a test project

5kb

Visual Studio Service Pack 4

Visual Studio Service Pack 4

Service Pack 4 (SP4) is a free download containing all previous service pack updates (SP3, SP2 and SP1). SP4 fixes some compatibility issues with previous versions of Visual Studio and provides updated versions of DAO, HTML Help, MDAC, Scripting, and OLE.

129mb

VB LiteTimer.zip

Lite Timer Class

This handy class module by Kieron O'Connor lets you add a control-less timer to your application, without actually using a Timer control. Beside being useful in itself, the CLiteTimer class provides a great example of how you can correctly implement Windows callback procedures. The class comes with a complete demo program that demonstrate that you can create multiple forms with many a timer on them. 

The Guru's Note:
I played around with this code and it is really good.  I stripped the Class and BAS files out, and put them in an ActiveX DLL.  Works like a charm.  Note, the download code is the original, not the DLL version

5kb

Timer Lite.zip

Timer Lite DLL

This is the full compiled DLL as I described in the above Lite Timer.  Just download the DLL, register it, add a reference in your project to it, then use as you would any other timer

 

6kb

Download from Microsoft

Visual Studio 6.0 Service Pack 3

Visual Studio 6.0 Service Pack 3 provides the latest updates to Microsoft Visual Studio 6.0 development system and its component products. Service Pack 3 is recommended for all Visual Studio 6.0 users, and is currently available free for customers to order on CD or download.

1.23MB

 

OCX

Common Dialog File

New Type Common Dialog Control

Common Dialog with multiple selections Win98 explorer type. Includes OCX code only, no sample Application.

11.71kb
Wheel zip File

New Type of Slide Control

An alternate to using Sliders, Scrollbars and UpDown controls. Not just an enhanced version of an existing type of control, but a new type of control altogether. Scrolls values up and down with the use of Visual thumb wheel, includes the ability to "Spin Over" to Minimum value when Maximum value has been attained and visa-versa. Includes OCX code only, no sample Application.

35.31kb
Color Picker Control Zip File

Color Picker Control with Sample Code

It is a color picker control, which is almost similar to those you find in MS Office 2000 applications. Includes OCX code and sample application code.

83.5kb
ListBox Control with Images

Listbox Control with Images

This is a multi-lined, per item, Listbox control with images

27kb
Animation Control

Animation Control

This control uses the Animation control from comctl32.dll to show animations from files or resources. For Example the moving Flash Light in Explorer or Network Places.

36kb
cPopMenu

CPopMenu

The cPopMenu control is a really simple way to get icons into a VB project's menus. It also allows you to create arbitrary new submenus, gives you control over the system menu and has some useful new events indicating when menu items are highlighted and exited. Sample Projects, Control Code & full documentation are included.

Note:
These projects require the SSubTmr.DLL component. Make sure you have loaded and registered this before trying any project. 

174kb
SSubTmr.Dll

SSubTmr.DLL

SSubTmr.DLL for use in other projects listed here

10kb
SSubTmr6

SSubTmr6.DLL

SSubTmr6.dll for use in other projects listed here here Note: This is a different DLL then SSubTmr.Dll, they are not compatible, you must download the correct version if the project calls for it.

43kb

Hover Button

Clock Control

A clock control. Drop the control on a form where it will display the time.

10kb

Hover Button

Enhanced Command Button

This is an enhancement of the standard command button. The additional properties include "mouse-over" forecolors and backcolors, an Image property, a borderstyle property, and a "mode" property (text-only or image-only mode).

7kb

3D Line Control

3D Line Control

Tired of drawing double lines to get a 3D effect.  What happens to the lines when you want to resize the form in run time?  Well here is an OCX control that does it all for you.  Includes the compiled control and all source code.

This code was written by the VB Guru

20.5kb

Easter Egg Control

Easter Egg Control

What to tell everyone how good of a developer you are. Well now you can, with a hidden Easter Egg that is. Includes OCX, source code and examples.

This code was written by the VB Guru

29.7kb