We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

DevX - Software Development Resource

Change a Property in a Group of Controls

You can easily make a group of controls visible or invisible. At design time, select all controls you want tomake visible or invisible during the execution. Press F4, and assign

DevX - Software Development Resource

Quick Jumps to the Declaration Section

I often want to get to the General code section of a form quickly, either to hack module-level variables or tograb the procedure pull-down to find that function whose name

DevX - Software Development Resource

Round and Format the Easy Way

Do you sometimes need to format rounded numbers to a specific number of digits? You can accomplish thisin one step: n = 12.345Format(n, “0.00”)’returns “12.350”Format(n, “0.”)’returns “12.00”Format(0.55, “#.0”) ‘returns “.60”

DevX - Software Development Resource

A Form That Won’t Close

If you set a form’s ControlBox property to False, the Minimize and Maximize buttons also become invisible.Suppose you want to provide functionality to the user to maximize and minimize the

DevX - Software Development Resource

Avoiding Copy and Paste Functions in a Text Box

Copy (Ctrl+C) and Paste (Crtl+V) functions are already includedin a text-box control, but what if you want to avoid these functions?You might suppose that you can handle Ctrl key combinations

DevX - Software Development Resource

To Flash or Not to Flash

Often, to create status-bar help, you place code in the mouse-moveevent procedures of controls to place text describing the controlon the status bar. Every time you update the text property,

DevX - Software Development Resource

JET 3.0 Query Optimization, Get with the Plan

If you need to analyze the performance of a Jet 3.0 query by thequery execution plan, you may do so by adding this registry keyand running regedit: \HKEY_LOCAL_MACHINESOFTWARE\_ MicrosoftJet3.0EnginesDebug For

DevX - Software Development Resource

Use Multiple Object Types to Reduce Duplicate Code

In the “Determine the Class of YourObject with the TypeOfStatement” tip, the Desk and House objects have many propertiesin common. Instead of duplicating code by having a separate Printmethod for

DevX - Software Development Resource

ListView Column Sorting

vGive your ListView control in report view the sort functionalityof the Win95 Explorer. This code will allow you to sort by anycolumn. If your list is already sorted by the

DevX - Software Development Resource

Application Path Inconsistency

Be aware that when using the Path property of the Applicationobject (App.Path), if your EXE is run from the root directoryof a drive, App.Path will return the drive letter and

DevX - Software Development Resource

Remove that Move!

Sometimes it is desirable to prevent a user from moving a form.A little known feature of Windows is that for any form, functionalitythat doesn’t appear in the control menu (ControlBox

DevX - Software Development Resource

Use Code Profiler for Debugging

Sometimes a runtime error only manifests itself after an EXE ismade and not in debug mode. This can be hard to track down, evenwith message-box statements. Use the code profiler

DevX - Software Development Resource

Maintaining Constants

I like to use the Constant.txt file Microsoft has been kind enoughto provide. For a new project, copy Constant.txt to a new filesuch as MyConst.txt. Place MyConst.txt in the same

DevX - Software Development Resource

Where’s the Beep?!

This code will prevent a beep when you hit [ENTER] or [TAB] ina text box whose maximum character limit has been reached: Sub Form_KeyPress (keyascii As Integer)’Eliminate beep if {ENTER}

DevX - Software Development Resource

Printing Problems

Here is a tip to help with missing or mispositioned text. Thisfailing code works fine with VB3: ClsPrint Spc(10); “Enter Your Name”;currentx = 0currenty = currenty + 1Print Spc(10); “Enter

DevX - Software Development Resource

Close All Forms Before the End of a Program

It is well known that VB3 is not always as conscientious as itshould be about unloading all the forms in an application whentheapplication terminates. Because unloading all the forms for

DevX - Software Development Resource

Color My World-In Default!

Just before performing your final ‘make EXE,’ switch your desktopcolor scheme and see just how many backgrounds you have hard-coded!(Sadly, several excellent shareware controls fail here, VBPJcontributors are guilty of

DevX - Software Development Resource

Cheap Focus Tracking

The Lost_Focus and Got_Focus events are the most-used events for implementing validation and texthighlighting. Wouldn’t it be nice to respond instantly to these events and to do it from a

DevX - Software Development Resource

Save Memory with A Picture Box

Set the AutoRedraw property to True and the benefits and trade-offsinclude much faster repaints and some wasted memory. If your formis resizable, you waste a lot of memory, because the

DevX - Software Development Resource

Fast Database Lookups

Visual Basic doesn’t have a procedure like the DLookUp function that Access has. You can use thisprocedure in VB to receive the Name of an object by ID: Public Function

DevX - Software Development Resource

How to Automatically Resize Forms

The ElasticForm subroutine, part of CodeBank’s standard procedurelibrary, automatically repositions and sizes all controls on anSDI form when the user or code resizes the form. To use the routine,simply lay

DevX - Software Development Resource

Enforce Design-Time Size for MDI Forms

Because MDI forms don’t have a border property, the user can drag the borders and distort the size of theMDI form. If the user tries to resize the form, I

DevX - Software Development Resource

A Form-Level DataChanged Property

Ever wished you could use the Save parameter outside of a Validate event? Have you noticed that if abound control is changed and you set DataChanged back to False, Save

DevX - Software Development Resource

More on Null Conversion

This tip has been published more than once on pages of VBPJ(See “99 of the Hottest Tech Tips For VB Developers,”Supplement to the February 1996 issue of VBPJ, page 17).This

DevX - Software Development Resource

Providing Context Menus for Your UI Objects

Much of the ease of use of Windows 95 comes from the fact thatits user interface objects have their own context menus, whichcan be accessed through a simple right-click of

DevX - Software Development Resource

Streamline Your API Declares, Part 2

While we are speaking of SendMessage, there is another trick youmay find interesting enough to include in your programming habits.When used with some particular messages, the lParam argument isreally considered

DevX - Software Development Resource

Remember SWAP?

I was surprised to learn that the SWAP command was not implementedin Visual Basic when I read a letter in the February 1996 issueof VBPJ requesting that Microsoft bring to