devxlogo

August 7, 1997

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

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

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

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

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

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

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

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

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