
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.
Do you need to tab through all those edit boxes? Are you tired of coding all of their KeyPress events? If so, set the tab indexes as you normally would.
The setup kit supplied with VB has a DLL with a useful function thatcan be called from your own applications. The function, GetFreeDiskSpace,returns the amount of free space available on
Normally, to load a new OCX, you select Custom Controls from the VB4Tools menu. Then, in the Custom Controls dialog, click on the browse button,select the OCX file, and click
In almost every application’s project you come across, fields necessitate the use of numeric text boxes-text boxes that should accept only numeric values. You can deal with this situation by
To signal errors from within a class method, use the Error.Raise methodand bubble it back up to the server. Check the docs for Error.Raise andthe books online. One caveat is
The SetupWizard directly supports only self-registering OLE servers.The setup toolkit doesn’t directly support a server that requires a REGfile. A workaround is use the Add Files button to add an
Windows 95 uses an extra step when searching for 16-bit DLLs. A newregistry key, “Known16DLLs,” in Windows 95 under \HKEY_LOCAL_MACHINESystemCurrentControlSetCon-trolSessionManagerfunctions in a similar way to KnownDLLs in Windows NT. Known16DLLs
The tip “Leap Year Rules” [“101 Hot Tech Tips for VB Developers,” Supplement to the August 1996 issue of VBPJ, page 22] illustrated how to easily determine if any given
Here is a tip that should make life simpler for all VB programmers doing mixed 16/32-bit development in VB4 under Windows 95. I have three additional items in my project
The tip you published on page 70 of the September 1996 issue of VBPJ on “Validating Numeric Input” was a good tip. However, the function failed to take into account
I use a housekeeping routine to check the state of tables during system initialization. The routine tests whether the table is in a collection, whether the table has data, and
To put a combo box on a toolbar, create a place holder and positionthe combo box above the place holder in the z-order. You can’t place thecombo box inside the
Need a fast way to print only one sub or function in VB3 that also takes care of the problem some printers have in printing the last page?Create a small
In VB3, the PostMessage API can cancel an error during Form_Load. Theform unloads if you send a WM_CLOSE message to the loaded window in theerror handler of the Form_Load routine.
To draw a selected transparent image in VB4 from an Imagelist control,as you do in C++, follow these steps. The ImageList_ API functions have many features that weren’t passedthrough in
Do you need to convert user input to all upper case in VB3? All the ways I have seen to force user input to all upper case is to make
To test whether a date falls on a weekend, you might be inclined to do this: nDay = weekday (sDate)If (nDay = 1) or (nDay = 7) Then ‘It’s a
These two routines enable you to get the height of an item of a list box in terms of pixels, and they also enable you to set the height of
Creating an object that looks and acts like a collection is a good wayto implement a form of inheritance in VB4, where inheritance is not providedby the language. Creating properties
In many places, I include Error$ as picked up in an error trap in a descriptive message. I use a function to expand its meaning. I call the function TSS
Assume that you have the full path name of a file, and you need to beable to tell if the drive is writeable (that is, if it is a CD-ROM
While developing MDI applications in VB 4.0, you probably have noticed that the cursor on the MDI child disappears when you click on the toolbar on the MDI parent. You
Microsoft is currently working on a printing problem. Visual Basic 3.0 applications running in Windows 95 cannot print to shared printers with an embedded space. If a shared printer has
The StartMode setting in the Options dialog of the Tools menu in VB4determines only whether an application with no startup form continues torun after Sub Main has completed. This allows
When in NT or Windows 95, use the Sleep API function instead of DoEvents.DoEvents does this: while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg);} DoEvents spends part of its
Add a method in VB 4.0 to center your forms against the screen or aparent form. Create a new project with two forms. Add this code to Form2: Public Sub
Use the Tools-Custom Controls dialog instead of Tools-References toremove controls. The project file will show references to all custom controlsin the project’s toolbox, even if they are not used by
VB4 allows you to create data structures that are more dynamic than previous versions allowed, thanks to the possibility of having dynamic arrays within types. For example, a tree structure
Add Optional parameters to your procedure calls. Both Functions and subs can now use the Optional keyword in the declaration to indicate that the following parameter is optional: Function mfbCheckDBStatus(Optional
To line up controls on a form in VB4, select all the controls you want to line up. Press F4 to bring up the properties window. Then double-click on the