devxlogo

June 5, 1999

Correctly set scrollbars’ width and height

You should always modify a vertical scrollbar’s width and a horizontal scrollbar’s height to conform to the display resolution. You can learn the suggested size (in pixels) using the GetSystemMetrics

Always run a component using Full-Compile

When testing a component in the IDE, always perform a full compilation. This ensures that VB checks the syntax of all the code in the component, which in turn guarantees

DirExists – Check that a directory exists

‘ Return True if a directory exists’ (the directory name can also include a trailing backslash)Function DirExists(DirName As String) As Boolean On Error GoTo ErrorHandler ‘ test the directory attribute

FileExists – Check that a file exists

‘ Return True if a file existsFunction FileExists(FileName As String) As Boolean On Error GoTo ErrorHandler ‘ get the attributes and ensure that it isn’t a directory FileExists = (GetAttr(FileName)

PrintRotatedText – Display a rotated message

Const LF_FACESIZE = 32Private Type LOGFONT lfHeight As Long lfWidth As Long lfEscapement As Long lfOrientation As Long lfWeight As Long lfItalic As Byte lfUnderline As Byte lfStrikeOut As Byte

Capturing the Output of a MS-DOS Program

Have you ever heard of redirected input or consoleapplications? Have you ever had the need to launch MS-DOS programs, wait for them toterminate, and then dump their output to screen?