Category Archives: Visual Basic 6 (VB6)

Auto Resize Controls

This will Resize your controls automatically when every time the form is resized. It can also prevent the controls for resizing. You can also use this for custom controls. Put this code on the form_load event: G_P_AdjustFormon Put this code on the form_Resize event G_P_FormResize Finally, place this code in a module: Option Explicit Public Xtwips As Integer,… Read More »

Insertion Sort for VB6

This method uses the insertion sort algorithm to sort a numeric array. This algorithm is one of the simplest available, but there are better algorithms (to be posted on this site shortly) for longer lists. Returns an Array, or vbEmpty if there’s an error e.g., passed array contains elements that can’t be compared to each other, such as… Read More »

Drawing Gradients in VB6

This module uses the line function to create a gradient fill on either a form or picture box, fades from one RGB color to another. At the moment it is a little bit slow, but i hope to improve that soon. Can be used to make setup screens. Set the objects auto-redraw property to true so the gradient… Read More »

vbAdvance Help and Documentation

vbAdvance is a Visual Basic Add-In which gives access to advanced build features and many IDE convenience features. This post covers some advanced topics, and discusses some of the samples included with the package. Webmasters Note I attempted to contact Karl Peterson, Young Dynamic Software, and the webmaster of mvps.org, with no success. I have approved the posting… Read More »

vbAdvance Console Addin for VB6

vbAdvance is a Visual Basic Add-In that gives you access to advanced build features and many IDE convenience features. As a Visual Basic Add-In, vbAdvance runs while you design and compile your applications. Once your app is built, vbAdvance is no longer needed. vbAdvance adds no distributable dependencies to your projects – there is nothing to distribute because… Read More »

Detect Inactive Input

This code sample shows how to detect activity or inactivity on the mouse and keyboard. Option Explicit ‘===========================================================’TYPE’===========================================================Private Type POINTAPIx As Integery As IntegerEnd Type’===========================================================’API’===========================================================Private Declare Sub GetCursorPos Lib “user32.dll” (lpPoint As POINTAPI)Private Declare Function GetAsyncKeyState Lib “user32.dll” (ByVal vKey As Long) As Integer’===========================================================’Variables’===========================================================Private posOld As POINTAPIPrivate posNew As POINTAPI ‘===========================================================’InputCheck’=========================================================== Public Function InputCheck() As Boolean    Dim i As… Read More »

Folder Guard

With this code you can create a application that watches specified folders. When someone try’s to access a folder that is being watched, the application closes the folder and displays an error message. Private Declare Function FindWindow Lib “user32” Alias “FindWindowA” _(ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SendMessage Lib “user32” Alias… Read More »

Work with the registry

This short demo program will show you how to use VB6 to work with the registry.  It shows you how to add, read, change, and delete registry entries. Attachments File Uploaded Size 926-20180127-154719-RegINI2.zip 1/27/2018 3:47:19 PM 12487

Proper cased textbox input

This function will automatically adjust the contents of a textbox to proper case, as input is being entered. It’s not really an “in-depth” piece of code. Rather, it is just a simple something to help out beginners. First, a function must be defined, which can be called from anywhere. Place the following code in a module. Private Function… Read More »