devxlogo

August 2, 1997

Used Bytes in a Directory

This function returns the number of bytes used on the directory: Function DirUsedBytes(ByVal dirName As _ String) As LongDim FileName As StringDim FileSize As Currency’ add a backslash if not

Fixing a Proper Case Tip

If you use the left arrow key to go back to the beginning of a word and then enter a letter, you get twouppercase letters. Use this code, which takes

Get Useful Disk Information

This function returns the hard disk free bytes, total bytes, percentage of free bytes, and used space. Before calling the function, set the first field of the DISKSPACEINFO structure (“RootPath”)

Trapping a Double Click for a Toolbar Button

VB4 supports the built-in Win95 Toolbar control, which allows users to add Buttons to the toolbar. The buttonhas a ButtonClick event, but if you want to trap a double-click, there

Test for “File Exist” the Right Way

Dir$ raises a runtime error if you supply it an invalid drive. For example, Dir$ (“d:winhimems.sys”) crashes ifdrive d: doesn’t exist. To check if a file exists, add an error

Procedures that Act on a Group of Controls

You can use the almost-forgotten ability of Visual Basic to have a function or sub with an undeterminednumber of arguments do something to a set of controls. For example, you