August 7, 1997

DevX

Give Focus To Another 16-Bit Application In NT

Note that in writing in VB3.0, Visual Basic’s AppActivate statementfails to make a 32-bit application the active window under Windows NT.For example: Sub Form_Load () AppActivate “Notepad – (Untitled)”End Sub

DevX

Monitor Resolution Through API

There is a simple way to get Monitor resolutions through a WinAPIcall. Declare this in a module: Declare Function GetsystemMetrics Lib “User” (ByVal _ nIndex As Integer) As Integer And

DevX

Check for NULLs Returned from DLL Calls

After a call to a DLL, the return value often contains a null.One way to eliminate the null is to look for Chr$(0), as in theexample: Dim CheckForNull As IntegerCheckForNull

DevX

Unload All Forms

Public Sub UnloadAll()Dim f As Integerf = Forms.CountDo While f > 0 Unload Forms(f – 1) ‘ If form isn’t unloaded exit (User had canceled…) If f = Forms.Count Then

DevX

A Replacement For Tabs

You say you want to use a tab control, but you have so many topics thetabs will be unreadable? Try using a list box in conjunction with a controlarray of

DevX

Jump To A Function Within Your Project

When you are looking at code that calls a function or procedure andyou are not sure in which module the function or procedure is defined,you can highlight/procedure name and press

DevX

Dragging A Form By A Control

This code is reusable and small enough to paste into whatever you’redoing and instantly have a form that has no need for a title bar. In thegeneral declarations section, insert

DevX

Printer Object Quirk

You would think that the following code would change the current fontof the default printer, but it doesn’t under VB4: Printer.FontName = “Arial”Printer.FontSize = 11Printer.Print “This is a test.” An

DevX

Using Components

Creating a new project with a lot of old components? In VB 4.0 you candrag and drop files into the project window to add them to the project.Use File Manager