VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Code samples by Anonymous

Add a circular color gradient to your form.
Add a color gradient to a form without any API calls. Also allows you to specify the beginning and
Add a diagonal gradient to a form.
Add a file to the Windows Recent Document List/ Clear existing list
Add a gradient fram around a form.
Add a horizontal gradient to a form.
Add a horizontal scroll bar to a list box
Add a rectangular gradient to a form.
Add an icon to the system tray, and recognize when the icon is clicked or hoovered over
Add basic AUTORUN capability to your A: drive (Put autorun filename as first line of AUTORUN.INF)
Add bitmap images to a menu item
ADODB Sample File Maintenance, this very Usefull for the Begginers advanvce VB6
ADSI sample - checks all members of strGroup. If an element of this group is not member of the strM
ADSI sample - checks if the user account is disabled. Written in VBScript, using ADSI.
ADSI sample - List all groups in a Windows 2000 AD domain or Windows NT4 domain. If domain is a com
ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip
ADSI sample - retrieves all domains in the namespace. Written in VBScript, using ADSI.
ADSI sample - Retrieves all users and some of their properties in a Windows 2000 AD domain or Windo
ADSI sample - retrieves computers that are connected to a specific domain controller. Written in VB
ADSI sample - Retrieves password policy info of a domain. Written in VBScript, using ADSI.
an example for a way to simulate gravity in a game. in this example, the image is attracted to the
Animate the Microsoft Office Assistant.
ASP sample: send an SMS message through a Nokia mobile phone. Also works for Ericsson, Motorola and
Associate a file extension with an application
Automatically select all text in a text box when it recieved focus
Body Mass Index Calculator (that works!) Fully commented
Calculate a persons age
Change double-click time of mouse
Change the color of the active forms title bar
Change the computer name
Change the name of a disk drive
Change the Windows display resolution.
Change the Windows wallpaper.
Check for the existence of a file.
Check if account is disabled unsing ADSI
Check Spelling Using Excel's Spell Checker
Client server sample: use winsock socket communications to send/receive data from a remote program
Client server socket sample; this sample show how to cretae your own client server application usin
Close all windows and logon as a different user
Close dial-up internet connection. This uses the wininet.dll which comes with Internet Explorer 3
Code demonstrates a binary search, excellent for beginning VB programmers
Code for using the Animated Copy Functions in Windows 95/98
connection to Database
Convert a JPEG File to a BMP Format
Convert an RGB value to a long, or a long to RGB.
convert from X base to decimal (hex, bin, oct etc...)
Convert Long Number Colors to RGB or Convert RGB Colors to Long Number Colors
Converts any number system into any number system, up to base 36. Ex: Base 2(binary) to Base 11(Und
Converts from Hue Saturation Value (HSV) to a VB Color suitable for use in forms, controls, etc.
Copy a file the using SHFileOperation API call so that Windows copy progress dialog appears
Copy the desktop wallpaper to your form's background or to any control with a device context handle
Correct way to determine when your visual basic application gains or loses focus.
Create a circular form
Create a hotkey for your application
Create a Left to Right Gradient Form using the basic RGB colors. Quick and EZ.
Create a MS Access database using 4 lines of code
Create a multi-level directory structure using CreateDirectory API call
Create a shortcut in Windows on the desktop and on the start menu
Create an encrypted string (in a function) encrypted in both design mode and on compiled code (the
Create an Internet shortcut
Create Multi-Column Menus in Visual Basic Using the WIN32
Creating a flashing form title bar.
Defines the click event for the label control, creates a popup message box
Detect if computer has a sound card that plays wave audio
Determine current line in a multi-line text box
Determine free disk space
Determine how long Windows has been running
Determine if a computer is connected to the Internet
Determine if a computer is using large or small fonts
Determine if a directory exists
Determine if a year is a leap year by checking if it is a valid date on the system. This assumes yo
Determine if the computer has established a modem connection
Determine screen resolution
Determine the number of colors a computer can display
Determine the output displayed when the button is clicked
Determine the screen saver time-out value in seconds
Determine the Windows Startup Mode
Determine when your visual basic application gains or loses focus.
Determine whether or not the screen saver is enabled.
Determining the final values of a, b, and c.
Dial Internet using Dial Up Networking (DUN) to connect. This uses the wininet.dll which comes wi
E-mail sample code : connnect to a SMTP server from Windows 95 platform or higher.
Encrypts text using a mathematical equation based on the length of the text entered. It is extremel
Excel Macro for Comma and Delimiter Exports
Exchange 2000 monitor function - this code was copied from the ActiveXperts Network Monitor applica
Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper
Execute a LINUX or UNIX command using RSH
Fade a form from the form's color to black.
Find and replace one string with another.
Find free disk space on a computer
Find Your Ip
Form Move?
Function to draw an etched (3-D) looking line on a form
Function to find the last occurrence of one string within another
Function to remove all occurrences of a string inside another string. Even allows you to do a case
Function to retrieve a temporary file name using GetTempFileName API call
Get a file extension
Get a long file name from a short file name
Get a short file name by converting to 8.3 compliant file.
Get drive volume information
Get Windows directory using an API call.
Get Windows System directory using an API call.
Give a form a 3-D looking frame/border.
Give a window a toolbar style title bar using the SetWindowLong API function
Hide the mouse from the user
Hide windows taskbar
High Security Encryption DLL (DES, Blowfish, Twofish, Gost, RC4, Skipjack, & CryptoAPI)
How to change information in a database using Active Server Pages (ASP). This method creates a reco
How to ping an IP address using VB.
How to ping an IP address using VB.
I made KeyCode Events For The Whole Alphabet.
Initialise a modem using VBScript. Use it to control a modem, a weight indicator or any other devic
Input data, Need help inputing date and correct code.
Launch default web browser without any API calls (uses Shell command)
Launch find all files dialog box
Launch the File Properties dialog box for a given file
Launch the Windows Mail Control panel GUI
Launch Windows Add New Hardware wizard
Launch Windows Add/Remove Programs Dialog
Launch Windows Date/Time Properties Dialog
Launch Windows Display Properties Dialog
Launch Windows Game Controllers Dialog
Launch Windows Internet Properties Dialog
Launch Windows Keyboard Properties Dialog
Launch Windows Modem Properties Dialog
Launch Windows Mouse Properties Dialog
Launch Windows Multimedia Properties Dialog
Launch Windows Network Dialog
Launch Windows Password Properties Dialog
Launch Windows Regional Settings Dialog
Launch Windows Sounds Properties Dialog
Launch Windows System Properties Dialog
Log Off user
Logs event to Windows Application Event Log via ReportEvent function of advapi32 API. Refactored ve
Loop through all drives and determine type (hard disk, floppy, CDROM, network, etc)
Loop through Submitted items that were POSTed from a form
Make a form cover the entire screen including taskbar and office toolbar
Make a form transparent
Make a program sleep for a number of seconds
Make color tags in a rchtext box
make the dice roll 100 times and count the number of snake eyes
Map a network drive
Minimize all applications on a computer
Modem initialisation and serial port communications
More leap year routines
Move a file to the Recycling bin
Move a form that has not title bar, or one that does by clicking anywhere on form
Move the form by dragging a control, with only one event...MouseMove
movement of image according to timer
n/a
Netscape-like progress bar
Network Monitoring task: check if process is running. ActiveXperts Network Monitor has lots of VBSc
Nokia SMS sample using VBScript
one liner for opening web page / URL. no declarations. no web browser or special control.
'Open CD drive door retvalue = mciSendString(set CDAudio door open, returnstring, 127, 0)
Open the windows start menu
Open/Close the CD-Rom drive tray
Periodic Table
Play an .AVI file in full screen
Populate a combo box with information from a database
Prevent multiple instances of a 32-bit application.
Prints an image from your program
Pulsating Glowing Color-changing Shape It should work on any VB that supports Controls.Add - if you
Quick and easy encryption
Quickly Search a List Box. A popular item in a user interface is to link a text box to a list box
Read EAN13
Read web site contents in VBScript - shows how to connect to a website, read all information, displ
Reboot the computer
Refresh windows, including active desktop, startmenu, etc.
Remove application from CTRL-ALT-DEL list
Retrieve a web page using the Microsoft Internet Transfer Control
Retrieve color of form title bar
Retrieve Current printer name
Retrieve double-click time of mouse in milliseconds
Retrieve number of mouse buttons
Retrieve the computer name
Retrieve the computers currency symbol based on the Regional Settings of the control panel
Retrieve the title of the active window
Retrieve the Windows user name
Retrieve the Windows working area (i.e. the portion of the screen not obscured by the taskbar or ot
Return various directories including desktop, programs, personal, favorites, start menu, fonts, etc
RSH sample from VBScript
Scrambles the keyboard layout
Search and replace a string within another
Send an e-mail to a SMTP server without need for IIS/CDONT, in VBScript. Embed attachments, use RTF
Send E-mail from ASP, VBScript, Visual Studio apps or Visual Studio .NET app with IIS or CDONT inst
Send Keys Example
send Recycle
Send SMS message through a cellular mobile phone, for instance nokia or ericsson, using Hayers AT c
Serial port communications - VBScript sample how to initialize a modem. Sample can be used a a base
Shade a form
Shell out to a 32-bit application and wait until task completes
Show Find All Files dialog box
Shows how to set Up the RichTextBox Control for WYSIWYG Printing
Shut down the computer
simple sort
Simple web browser that navigates through pages.
Socket code sample: establish a telnet session and read/write strings
Start Windows Screen Saver
Swap the left and right mouse buttons
Telnet sample; this sample show how to establish a telnet session to a remote Telnet server using V
The most powerful ASP Web-based file manager
This code has one timer, three labels, three lines and one command button. This code runs a one min
This code strips enything you want from a string in 5 lines of code using the Replace Function!
This code will allow you to lock outlook express with a password. You will need a text box and a bu
This codes is an easier way to hi-lite the text in a textbox than was submitted the other day.
This function puts a border around a usercontrol,this function also includes multiple colors and si
Three Letter Combinations
Tile an image on a form
time in, time out, punched in, puched out calculate time, time spent
To collect all fonts available in you computer and add to the list box.
to find if number is evenly divisible by x
to make form transparent
Transaction processing program with random access files
Translate bin>hex and hex>bin again.
Two sorts and one method to reverse an array
U CASE AND L CASE
Use ClipCursor API function to keep the mouse pointer inside a form.
Use GetModuleFileName API call to find the location your executable, since App.Path can return erro
USE OF POLYGON,SETPOLYFILLMODE AND OTHER API CALLS AN EXCELLENT EXPANDING STAR
Use of scroll bars
Use SetWindowLong API call to make a text box only accept numeric input (0-9)
Use TAPI32 to dial a telephone number.
Use the Microsoft Internet Control to determine when a web page was last modified.
Using a data text file containing a name of a salesperson, a pair of numbers declaring the final sa
Using the ShellUIHelper Object. The code below demonstrates how this can be done in a standard Visu
Various date functions including age calculation, number of days in month, leap year, etc.
Various joy stick functions, determine if a joy stick is present
Various registry routines
Various routines for controlling a music CD on your computer. Includes Play, setting track number,
Various sorts and functions to check if items exists in a sorted array or list
Very Simple example showing how to send arguments to a sub
When concatenating dates into a SQL string, you must use a standard US date format, regardless of t
Winsock VBScript sample - connect to a remote vbscript socket program, exchange data and disconnect
WMI sample - retrieve event log file information of a remote or local computer, like compression, d
WMI sample - retrieves the serial port configuration of a local or remote computer, like baudrate,
WMI sample - retrieves the tape drive configuration on a local or remote computer, like manufacture
WMI sample - retrieves the time zone setting of a local or remote computer. Written in VBScript. Us
WMI sample - retrieves the usb settings of a local or remote computer. Written in VBScript. Uses Wi
WMI sample: change wins and dns on local or remote computer. Written in VBScript. Uses Win32_Networ
WMI sample: checks if a process is running on a (remote) computer. Uses win32_process WMI class.
WMI sample: create a share on a (remote) computer
WMI sample: list shares on a local computer. Written in VBScript
WMI sample: list shares on a local or a remote computer. Written in VBScript
WMI sample: list shares on a remote computer, using DIFFERENT CREDENTIALS than the currently logged
WMI sample: list users and/or groups on a domain or on a computer.
WMI sample: lists all application service details of a computer
WMI sample: lists the printjobs on a printserver. Written in VBScript. Uses Win32_PrintJob WMI clas
WMI sample: reboot a (remote) computer. Written in VBScript. Uses Win32_OperatingSystem WMI class.
WMI sample: retrieve battery info of a (remote) computer
WMI sample: retrieve boot configuration of a (remote) computer. Written in VBScript. Uses Win32_Boo
WMI sample: retrieve CDRom information of a (remote) computer. Written in VBScript. Uses Win32_CDRO
WMI sample: retrieve COM application info of a local or remote computer. Written in VBScript. Uses
WMI sample: retrieve fan status info and settings of a (remote) computer, like availability, speed,
WMI sample: retrieves computer system information of a (remote) computer, like domain membership, n
WMI sample: retrieves desktop settings of all profiles of a (remote) computerdesktop settings of al
WMI sample: retrieves disk drive settings of a (remote) computer, like bytes per sector, ' compress
WMI sample: retrieves floppy drive status info and settings of a (remote) computer,like availabilit
WMI sample: retrieves group info and group membership of a (remote) computer. Uses Win32_Group WMI
WMI sample: retrieves memory configuration of a remote or local computer, like bank label, descript
WMI sample: retrieves network adapter settings of a remote or local computer, like adapter type, av
WMI sample: retrieves network protocol settings of a remote or local computer. Written in VBScript.
WMI sample: retrieves Operating System properties of a remote or local computer,like build number,
WMI sample: retrieves printer status on local or remote computer. Written in VBScript. Uses win32_P
WMI sample: retrieves the processors configuration of a remote or local computer, like processor ty
Writes a string to a file without saving the quotes.
You can use the WinWait function to wait until a window with a specific name has appeared, or use t

267 Submissions by Anonymous