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

Create “Remotely Controllable” Forms

Sometimes I need to control a VB form while focus is on another one. For example, I want form B to beresized when I press the “OK” button on form

DevX - Software Development Resource

Run Automation Manager as a Hidden Task

If you use OLE Remote Automation, you must start the Automation Manager on the server computer beforeany OLE remote communication occurs. By default, this application is visible, but you can

DevX - Software Development Resource

Better Scrolling Images

I enjoyed Joel Paula’s “Scrollable Viewport for a Picture” tip [“101 Tech Tips for VB Developers,” Supplementto the February 1997 issue of VBPJ, page 12], and I’d like to make

DevX - Software Development Resource

Problems with Popup Menus

If you use popup menus in your applications, you should be aware of a bug present in VB4 16/32 and VB5. Ifyou have two forms and the first one shows

DevX - Software Development Resource

Save Form Position and Size Using SaveSetting

SaveSetting and GetSetting make writing application settings a breeze. These two utility functions retrieve andstore the current forms position: Public Sub FormPosition_Get(F As Form)’ Retrieve Form F’s position from an

DevX - Software Development Resource

Properties that Behave Like Text and Caption

If you build an ActiveX control that exposes a Text- or Caption-like property, even under different names, you should modify its attributes in the Procedure Attribute dialog box after expanding

DevX - Software Development Resource

GoSubs are Slow in Compiled Programs

Because GoSubs make for less structured programming, many programmers avoid them. If you compile yourVB5 applications to native code, you have one more reason to stay away from them because,

DevX - Software Development Resource

Speed up your Code Using Choose

You can often use Choose to replace an array and build tables of results evaluated at compile-time instead ofrun time. For instance, if you need to evaluate the factorial of

DevX - Software Development Resource

Compact Your Code Using IIF and Switch

You can often replace an If…Then…Else block with a more compact IIf function: ‘ returns the max of two valuesmaxValue = IIf(first >= second, _ first, second) Switch is a

DevX - Software Development Resource

Combine Default with Other Attributes

When building an ActiveX control, you can set a default property or method using the Procedure Attributesdialog box, after clicking on the Advanced button. However, if your default property also

DevX - Software Development Resource

“Array” is not a Valid Variable Name Anymore

If you, like me, often used the “array” name for variables, you must revise your code when porting yourapplications to Visual Basic 5.0. This name has become a reserved keyword

DevX - Software Development Resource

AutoSelect Text Box Contents

Users often find it faster to retype the entire contents of a text box rather than position the cursor within the data, and then edit the data. This is especially

DevX - Software Development Resource

More Versatile Array Parameters

You can write a single procedure that accepts any type of array as an argument by using a variantparameter. Within the procedure, address the array using the usual syntax: ‘

DevX - Software Development Resource

Easy CR/LF Padding

When I write text in message boxes, labels, and so on, and I need to include a carriage return/line feed, I use this function, passing it the number of CR/LFs

DevX - Software Development Resource

The Address of a Variable

THE ADDRESS OF A VARIABLEVB5 includes a built-in VarPtr function (see tip “Use the Object Browser to Discover UndocumentedFeatures”), but this function isn’t available in VB4. The VB4 runtime library

DevX - Software Development Resource

Cross Midnight Benchmarks

Traditionally, VB programmers benchmark their code using the Timer function. However, if your processmight terminate on the following day, you must take into account that the value returned by that

DevX - Software Development Resource

App.Path Might Return UNC Path Specifications

Unlike VB4, VB5””””s App.Path property might return a UNC path, such as “\serverprograms…”), undercertain circumstances, depending on how the program started and if it””””s interpreted in the VB IDE orcompiled

DevX - Software Development Resource

Friendly Enumerated Values

If you build an ActiveX control that exposes an enumerated property, you should define a Public Enumstructure that gathers all the possible values for that property. Doing this helps the

DevX - Software Development Resource

Standalone Type Libraries

If you create out-of-process OLE servers, Visual Basic embeds the companion type library into the EXE fileand generates no TLB file. However, if you own the Enterprise Edition of VB4

DevX - Software Development Resource

Implementation of Public Forms and Class Variables

The implementation of Public variables in forms and classes changed with Visual Basic 5.0. VB4 implementspublic variables in forms and class modules as if they’re regular variables, using pointers to

DevX - Software Development Resource

Hide All Project Windows

When working with multiple projects, it’s easy to get confused by the many windows active on the screen atthe same time. However, you can temporarily hide all the windows related

DevX - Software Development Resource

Customize VB Toolbars

Here are a few simple ways you can customize your VB5 IDE: Add tabs to the custom control toolbox by right-clicking on the General button and selecting the Add Tab

DevX - Software Development Resource

Not all Templates are Created Equal

Unlike templates in other Office 97 products, Word 97 templates provide a business-application engine thatremains separate from the documents that use that engine. Template-based Excel workbooks andPowerPoint presentations include a

DevX - Software Development Resource

Center Forms on Screen

A popular code snippet lets you center any form on the screen, regardless of the current screen resolution. You now can reach the same result by simply assigning the value

DevX - Software Development Resource

Don’t Create Aliased Variables

Never pass a global variable as an argument to a procedure that also accesses the variable directly. If you’re 100 percent sure you adhered to this rule within your application,

DevX - Software Development Resource

Default Values for Optional Parameters

If you ever programmed under VB4, you probably took advantage of the powerful Optional parameters. VB5 enhanced them in several ways: they can be of any type now (not only

DevX - Software Development Resource

Don’t Auto-Optimize for Fast Code

If you take a look at VB’s native code optimization options for the first time, you might be tempted to click on “Optimize for Fast Code” right away. Strange as

DevX - Software Development Resource

Comment and Uncomment Blocks of Code

Visual Basic 5.0 lets you comment a block of code in a snap and uncomment it later. This feature is useful in the debug phase, when you don’t want to

DevX - Software Development Resource

Combo Box Event

Two problems can arise when a confused user scrolls up or down with the mouse and then makes a selection with the Enter Key. First, the down arrow fires two