|
|
|
|
|
|
|
|
|
IsValidDateField - Check whether a date is valid
|
Total Hit (3455) |
«Code LangId=1»Enum psDateTypes
AnyValidDate 'Allows any valid date to be entered
PastDate 'Only allows past dates (before today) to be entered
FutureDate 'Only allows future dates (after today) to be entered
TodayOrFuture 'Only allows today or future date to be
....Read More |
Rating
|
|
|
ShiftRight - Shift a Long to the right
|
Total Hit (2515) |
«Code LangId=1»' Shift to the right of the specified number of times
'
' NOTE: requires Power2()
Function ShiftRight(ByVal value As Long, ByVal times As Long) As Long
' we need to create a mask of 1's corresponding to the
' digits in VALUE that will be retained in the result
Dim
....Read More |
Rating
|
|
|
Crc16 - Evaluate the 16-bit CRC of an array of bytes
|
Total Hit (4658) |
«Code LangId=1»Option Explicit
' Evalutate the 16-bit CRC (Cyclic Redundancy Checksum) of an array of bytes
'
' If you omit the second argument, the entire array is considered
Function Crc16(cp() As Byte, Optional ByVal Size As Long = -1) As Long
Dim i As Long
Dim fcs As Long
Static
....Read More |
Rating
|
|
|
Windows Installer Appears Every Time I Start an Application
|
Total Hit (4694) |
Intended For
Windows XP
Windows 2000
The Windows Installer is a global application used to install many Microsoft products, including Office 2000 and Office XP, and is even available to third-party developers to include with their programs.
Unfortunately, it's fraught with bugs, one of
....Read More |
Rating
|
|
|
Never use the GetLastError API function
|
Total Hit (3872) |
If you heavily use API calls and strictly follow the SDK documentation, you might be tempted to use the GetLastError API to retrieve the error returned by your last API function or procedure. However, this function doesn't always return valid error codes, because Visual Basic internally does a lot o
....Read More |
Rating
|
|
|
Swap the mouse buttons' behavior and meaning
|
Total Hit (4156) |
You can programmatically swap the meaning of the left and right mouse buttons, to account for your left-handed users. All you need is a call to the SystemParameterInfo API function
«Code LangId=1»
Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (By
....Read More |
Rating
|
|
|
Make a phone call using TAPI
|
Total Hit (4802) |
If TAPI libraries are installed on your machine, you can easily dial a number from a VB application using a single API call. Here's a function that encapsulates the call and that returns True if the dialing was successful:
«Code LangId=1»
Private Declare Function tapiRequestMakeCall Lib "TAPI32.
....Read More |
Rating
|
|
|
Don't include Extender properties in ActiveX Wizard
|
Total Hit (3178) |
The left-most listbox in the first page in the ActiveX Control Interface Wizard includes all the properties exposed by the constituent controls currently on the UserControl's surface. Unfortunately, this list includes Extender properties, methods, and events, which should be never added to the publi
....Read More |
Rating
|
|
|
A template for building collection class modules
|
Total Hit (3653) |
The following is a template for building collection class modules in a very quick and effective way. Copy-and-paste this code into Notepad, that save it to a file named "COLLECTION CLASS.CLS" in the \TEMPLATE\CLASSES subdirectory under the main VB6 directory:
«Code LangId=1»
VERSION 1.0 CLASS
B
....Read More |
Rating
|
|
|
Reduce the number of DoEvents
|
Total Hit (4565) |
Don't fill your code with unnecessary DoEvents statements, especially within time-critical loops. If you can't avoid that, at least you can reduce the overhead by invoking DoEvents only every N iterations of the loop, using a statement like this:
«Code LangId=1»
If (loopNdx Mod 10) = 0 Then DoEv
....Read More |
Rating
|
|
|
How to get/set list of files copied in to clipboard using API
|
Total Hit (6163) |
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one drive control, one dir control, one file control, three command button controls and one timer control. Set MultiSelect=True for File control
- Add the following code in form1
«code LangId=1»Option Explicit
' Required data
....Read More |
Rating
|
|
|
|
How to display API Error Description.
|
Total Hit (4080) |
When you execute any system API generally it returns success/failure using return value. To find out any error you have to use GetLastError api or Err.LastDllError property of Err object in VB. But it will return only ErrorCode not description. You can use following code to get description of API Er
....Read More |
Rating
|
|
|
Another check if a file exists
|
Total Hit (2888) |
«Code LangId=1»Function FileExists(strFile As String) As Integer
'********************************************************************************
'* Name : FileExists
'* Date : Feb-17, 2000
'* Author : David Costelloe
'* Returns : -1 = Does not exists 0 = Exists with zero bytes 1 = Exists > 0
....Read More |
Rating
|
|
|
|
|
Tutorial - Image List Control Introduction
|
Total Hit (2201) |
The Image List control allows you to add images to your program, which you can use in the other Common Controls (Toolbar, TreeView, ListView etc). To add the ImageList control to your VB project, click Project|Components, and check the box next to Microsoft Windows Common Controls x.x where x is the
....Read More |
Rating
|
|
|
|
Using the Joystick, Mouse and Keyboard
|
Total Hit (2224) |
So far we have learned how to move, animate and do some other stuff to sprites. We have also looked into the area of sound playback in games. This is all very nice if you want to create a game with no human interaction. Since this is most likely not the kind of game you want to make, then you need t
....Read More |
Rating
|
|
|
Texturising Images
|
Total Hit (1981) |
This sample provides a simple image processing application which applies a texture to an image by modifying the lightness of the image according to the lightness of a texture image. The texture image is tiled across the surface of the processed image.
....Read More |
Rating
|
|
|
True Colour DIBSection
|
Total Hit (2790) |
This article describes in detail the DIB Section techniques used in the vbAccelerator Image Processor. It describes what DIB Sections are, how to use them and provides True Colour DIBSection class I wrote to wrap up the DIB Section.
|
Rating
|
|
|
Owner Draw Combo and List Boxes Version 2.1
|
Total Hit (1730) |
Owner draw combo and list boxes are an excellent way to improve the look and feel of your application. However, there is little support for them in Visual Basic. The only owner-draw combo box supplied is the Checked list box style, but this is a preset list box style with no possibility for customis
....Read More |
Rating
|
|