Reliable Answers - News and Commentary

Visual Basic Samples

Various samples of how to accomplish common and advanced tasks in Visual Basic (VB).

Recent MSKB Articles
Courtesy of...
9k; 5950 downloads
Added 2001/04/09

How to run your application on systems that don't have all the components installed. Yes, you read that right. These two modules can be used within your applications to provide a means of notifying the user *which* components are missing from the system and provides them with the opportunity to visit your website to download the missing components. See a demonstration in action by downloading XFL (eXtreme Favorites List). If you decide to use this code in your apps *please* let me know. I may provide an online service in the future from this site which would provide links to download missing components. If I don't know you're using it I can't let you know when (and if) I implement this service.
8k; 6097 downloads
Added 2001/05/22

Demonstrates how to shell an application on another computer in the *other computers* memory space. Uses the Winsock control. This is only one example of several ways to perform this type of need.
7k; 5710 downloads
Added 2001/02/09

How to use the GetKeyState API, which let's you do some really cool stuff for detecting system keyboard state - and HOW your application started. Did your application start from the mouse? Did it start from the keyboard? Did the user press Shift (often signaling an 'explore' or advanced feature of an application) and *which* Shift key? Did the user press anything else that might be 'fun' to check?
7k; 4342 downloads
Added 2001/01/19

This project was pasted together basically so I could collect the icons from my own computer. It's a simple utility to extract all the icons from ico files and within resources from a folder/drive on your system and duplicate them into the current directory.
This code utilizes source (mResource.bas, cFileIcon.cls and cResources.cls - not included) from
1k; 7187 downloads
Added 2001/11/01

A bas module with a procedure demonstrating how to access the calendar functions of MS Outlook, either in VB or Outlook VBA.
5k; 6480 downloads
Added 2001/11/01

A bas module with several procedures that demonstrate Contact automation of MS Outlook, either in VB or Outlook VBA, including address book creation, deletion and duplication.
4k; 8100 downloads
Added 2001/11/01

A bas module with several procedures that demonstrate Email automation of MS Outlook, either in VB or Outlook VBA, including batch-sending email & customization directly from the Outlook Address Book.
30k; 4937 downloads
Added 2001/02/09
ADO (A2K, ADO26)

How to use the ItemData property of combo and list controls to identify values within an ADO recordset.
21k; 6365 downloads
Added 2001/01/30
ADO (A2K, ADO21)

Sample demonstrating how to use '.Find' to locate a record in ADO. Options include exact matching, like matching, automatically searching and searching on a change timer (so you don't have to search at every character change - runs every three seconds when 'on').
13k; 6527 downloads
Added 2000/11/21
ADO (A2K, ADO21)

How to implement 'Find' & Auto-Search with ADO.
14k; 4507 downloads
Added 2002/07/13
ADO (A2K, ADO21)

How to use the StdDataFormat object to custom-format columns or set a different 'display value' for a field/column.
22k; 5603 downloads
Added 2001/10/06
ADO (A97, ADO21

Demonstrates the usage of referential image locations. Storing an image within a database field is *possible* but it is very bulky, and database access suffers to implement. Alternatively, it is recommended to store a pointer/path reference to the file and use that to load your image(s).
2k; 5543 downloads
Added 2001/04/10

Demonstrates the usage and implementation of IE to open a POST or GET method to an HTTP server. ie; shows you how to open a browser to send parameters to a web server (like an asp page). Want to remove a dependency from your project? This sample DOES NOT use any controls - it is, and can be, used from a single bas module. Notice the description though - it does require IE (Internet Explorer) to be installed on the client. Which is not a great feat considering every Windows PC since Windows 98 has it installed by default and you can't expect even a Win95 system to live without the OS patches incorporated into an IE installation.
10k; 3686 downloads
Added 2001/04/16
Application Security

Demonstrates how to store a text value within a binary file. A wav file is used in order to reduce the potential of corruption. Larger files with higher bitrates should work better than small files. Do not use an audio file that uses high-compression because it increases the chance for audio corruption, and thus, the likelihood that a cracker would quickly ascertain the means of your copy-protection scheme.
2k; 4614 downloads
Added 2001/04/24
File Access

Demonstrates how to store and retreive values within an INI file by wrapping the GetPrivateProfileString and WritePrivateProfileString API's.
2k; 8862 downloads
Added 2000/11/21
Drag & Drop

How to implement OLE Drag & Drop.
30k; 6844 downloads
Added 2001/04/14
Drag & Drop

Demonstrates how to use VB Drag & Drop (not to be confused with OLE Drag & Drop) and scrollbars to move an object within another. In this case an image control is framed inside a picturebox and manipulated with either drag and drop or via the scrollbars.
4k; 4269 downloads
Added 2002/07/11

This sample is a *code-only* solution to encapsulate printing of 3 of 9 Barcode's. It incorporates the ability to include a check digit just by changing a parameter, and change the output color by manipulating a constant. This module is based on a sample George Corrigan posted to several forums I participate in, first to -VB.
4k; 4185 downloads
Added 2001/10/27

Demonstrates two methods for moving objects gradually across their parent object at the pixel level.
3k; 4185 downloads
Added 2001/02/09

How to use the Circle method in VB, as well as the right way to handle key masking.
3k; 3669 downloads
Added 2000/11/21

How to use the CreateSolidBrush, Ellipse and Rectangle API's.
4k; 5314 downloads
Added 2001/10/22

Demonstrates using scrollbars (and drag and drop) to scroll the contents of a form.
3k; 4304 downloads
Added 2000/11/21

How to gracefully exit a long loop.

The stuff you see here is in response to posts for information/howto's from the DevX newsgroups ( or from the many *Groups I monitor (/eGroups/Programming), and those I moderate. If there is something you'd like to know how to do that is not listed here, check the links below, or join one of the groups I do monitor for expert advice.

Other references for great samples:

Without a second thought I recommend VB Accelerator as the most enduring and well designed site for the VB programmer. Other sites I hold in high regard are Edanmo's VB Page, VB Net and Karl Peterson's site.

Carschooling by Diane Flynn Keith

Take me to the top

Reliable does not endorse any Google advertisers, these ads are managed by Google. They are here to pay for hosting expenses. If you notice an inappropriate ad, please contact Shawn with the domain of the offensive advertiser.

Take me to the top

We invite you
to visit:

Professional Web Hosting and Design Services: 12 Point Design Local Homeschool provides the most up-to-date support group listings in a geographical and searchable index Budget Homeschool Kidjacked -- To seize control of a child, by use of force SaferPC dispels security misunderstandings and provides you with a solid understanding of viruses and computer security Reliable Answers - developer information, current news, human interest and legislative news Twain Harte Times - Twain Harte, CA - The closest you can get to Heaven on Earth Cranial Laser & Neurolymphatic Release Techniques (CLNRT) - Experience dramatic pain reduction At Summit Chiropractic our mission is to improve your quality of life - We know that health is much more than just not feeling pain Visit to learn about your preschool options.