

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.








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
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
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
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
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
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
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
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
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
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
Are your programs not executing instructions in VB4 that wereexecuting in VB3? Try this in Qbasic, VB3, and VB4: BEEP: BEEP: BEEP If you F8-step through this very complex code,
Most programmers want their applications to look like commercial software, so they want to add their ownhelp files. How do you open the contents of a Windows help file in
If you are you unhappy with Microsoft’s comment in the help (“Note:You cannot specify where a common dialog box is displayed”),but like the idea of common dialog controls, try this.
To make icons look better, Windows 95 uses three standard-size icons;16-by-16, 32-by-32, and 48-by-48. These three standard sizes should beincluded in any ICO file you create for inclusion in your
The User Tip submitted by Nick Bulka in the January 1996 issueof VBPJ was interesting, but, as with so much code, improvable: Sub TextHiLite( t as TextBox ) t.SelStart =
Some controls in VB4 and VB5, such as the TextBox control, have a default context menu that appearswhen you right-click on the control. If you want to pop up your
With the advent of long file names in Windows 95, it may be necessary to display a trimmed version of a path in a text box or label. The following
If your users have the option to type a directory where they wantfiles installed, they may type a directory that doesn’t existor a directory that is several levels below another
To center a form, you only need one API call, no UDTs, and two constants. This solution is based on thefact that GetSystemMetrics reflects real estate taken up by the
In a collection object, such as the ListItems collection from the ListView control, or simply a generic VBcollection object, you can specify a key to uniquely identify the item. Documentation
In VB4, DBGrid’s columns can be referenced using object variables. Thisreduces the amount of typing required and makes code more readable. Thecode is also more efficient because the full name
I have found a solution to the problem of GetModuleUsage not workingin 32-bit VB4. The TaskID returned by Shell can be used by AppActivatelike this: TaskID = Shell(“DOSAPP.EXE”, _ vbNormalFocus)
Jet 3.0 (32-bit VB4 only) includes a new security system basedon database passwords that you may use instead of the more complex,more secure, workgroup security system. This system allows youto
Set the number of columns in VB4’s DBGrid at design time by right-clickingon the grid and selecting Edit from the menu. (The grid can now be editedinteractively at design time.)
A new Windows 95-only API call notifies the system that you’ve changedsomething it should know about. The call, SHChangeNotify, is very handyin a number of cases. You might make this
VB4’s commands for dealing with file names (such as KILL, MKDIR, andFILECOPY) support long file names without programmer interaction. A numberof the Win95 API functions will return only the short
The ShellAbout API call provides a quick and easy way to show an aboutbox (using the standard Win95 format) without having to include an additionalform in your project. The call
MouseMove events don’t occur when the control’s Enabled property is set to False. My method tackles this problem and is useful when you want to display the Tooltips or Notes
If you’re checking a numeric value against 0, one option is to usethe “” operator: If iNumber 0 Then … End If It is faster, however, to check the variable
I’m developing a database program that deals with many auxiliary files at same time. Everyone codingdatabase programs must create some temporary files to produce an output from SQL or a