Tips & Tricks with VB

These tips & Tricks are donated by They provides examples of how you can solve a particulair problem with Visual Basic. They are free to use and free to re-publish.

Tip 63: Preventing List Box from Redrawing (Refreshing)
Tip 64: Changing the Case of Text Entered in a Text Box Control
Tip 65: Separating a Path into Individual Fields
Tip 66: Disabling Task-Switching with the SetSysModalWindow Function
Tip 67: Returning Focus to a Specific Control After Executing WinHelp
Tip 68: Removing Duplicate Items from List Box Controls
Tip 69: Forcing a Picture Control to Use Only a Specific Font
Tip 70: Creating Temporary Files
Tip 71: Dragging Controls at Run Time
Tip 72: Positioning the Cursor over a Control That Receives Focus
Tip 73: Creating Nested Directories
Tip 74: Scrolling Through Two List Box Controls Simultaneously
Tip 75: Invoking Menu Items in Other Applications with SendMessage
Tip 76: Detecting Right Mouse Button Clicks on List Box Controls
Tip 77: Determining the Amount of RAM Installed in a Computer
Tip 78: Retrieving the Names of All Printers
Tip 79: Closing All MDI Child Windows at One Time
Tip 80: Drawing Borders Around Controls
Tip 81: Repairing and Compressing a Microsoft Access Database from
Tip 82: Retrieving Multiple Filenames from the Common Dialog Control
Tip 83: Listing Fields and Associated Properties for an Attached
Tip 84: Creating a Scrolling "Credits" Control
Tip 85: Hiding MDI Child Forms at Run Time
Tip 86: Allowing a Visual Basic Application to Accept Drag-and-Drop
Tip 87: Sending Output to the Printer in Any Order
Tip 88: Shrinking Icons Down to Size
Tip 89: Invoking the Microsoft Word Page Setup Dialog Box
Tip 90: Adding ToolTips to Visual Basic applications
Tip 91: Determining If a Form Is Loaded
Tip 92: Using the Shell Statement to Execute MS-DOS Programs
Tip 93: Retrieving the Names of Installed Printers
Tip 94: Using Drag-and-Drop on Multiple items in a List Box Control
Tip 95: Deleting All Records from Every Table in a Microsoft Access Database
Tip 96: Centering a Form over Another Form
Tip 97: Creating a Task List
Tip 98: Saving a Window's Client Area in Bitmap Format
Tip 99: Adding Three-Dimensional Effects to Visual Basic Forms
Tip 100: Printing a Form Multiple Times on One Page
Tip 101: Using the Built-In Windows Icons
Tip 102: Modifying a Child Window's Caption
Tip 103: Preventing the CTRL+TAB and CTRL+F6 Key Combinations from Activating
Tip 104: Creating a Form with a Thin Title Bar
Tip 105: Removing a Form's Title Bar
Tip 106: Centering Text Vertically in a Text Box Control
Tip 107: Detecting Double-Click Events in Combo Box Controls
Tip 108: Flashing Controls to Get the User's Attention
Tip 109: Modifying an MDI Form's Border Style
Tip 110: Sending a Click Event to a Command Button Control
Tip 111: Using Different Fonts in List Boxes That Have Tab Stops
Tip 112: Preventing ListIndex Property from Triggering a Click Event
Tip 113: Creating Transparent Forms
Tip 114: Preventing a Portion of a Text Box from Scrolling
Tip 115: Performing Smart Searches in Combo Box Controls
Tip 116: Sending Data to the Printer in Landscape or Portrait Mode
Tip 117: Changing a Menu's Shortcut Key at Run Time
Tip 118: Converting a Word for Windows Document to RTF Format
Tip 127: Stamping Files with the Current Date and Time
Tip 128: Calculating the Beginning and Ending Date of a Month
Tip 130: Using the Undo Feature with a Text Box Control
Tip 131: Determining Whether a DLL File Is 16-Bit or 32-Bit
Tip 132: Preventing Duplicate Items from Being Added to List Box Controls
Tip 133: Using the SendMessage Function to Scroll Contents of Text Box =
Tip 134: Creating Temporary Files
Tip 135: Preventing a User from Editing the Contents of a Text Box =
Tip 136: Using Keyboard and Mouse Shortcuts
Tip 137: Removing Items from a Drive List Box Control
Tip 138: Enabling and Disabling Scroll Bars in a List Box
Tip 139: Retrieving a Disk's Volume Label
Tip 140: Identifying CD-ROM Drives
Tip 141: Searching a List Box Control for a Partial Match
Tip 142: Determining Whether the Operating System Supports Long File
Tip 143: Determining Whether the Windows 95 Taskbar Is Visible or=20
Tip 144: Using Accelerator Keys with the TabStrip Control
Tip 145: Inserting Tab Characters in the Rich-Text Box Control
Tip 146: Retrieving the Printer Name from the Windows 95 Registry
Tip 147: Retrieving Multiple File Names from the Common Dialog Control
Tip 148: Using OLE Automation to Check Spelling
Tip 149: Enumerating Disk Drives in Visual Basic 4.0
Tip 150: Determining How Many Items Can Be Displayed in the List Box
Tip 151: Finding Whole Words in a Text Box Control
Tip 152: Determining the Status of Virtual Keys on the Keyboard
Tip 155: Scrolling Text Horizontally in a Picture Box Control
Tip 156: Adding New Icons to the Windows 95 Taskbar
Tip 153: Searching PATH for Specific Files
Tip 154: Terminating Windows 95 in Visual Basic
Tip 159: Setting the Minimum Size of a Window
Tip 160: Retrieving the Versions of MS-DOS and Windows
Tip 161: Forcing the Common Dialog Control to Save Files to a Specific Disk Drive
Tip 162: Determining Whether a File Exists
Tip 163: Emulating a Double-Click Event in the Directory List Box Control
Tip 164: Copying Files from One Directory to Another
Tip 165: Locating CD-ROM Drives Installed on a Computer System
Tip 166: Playing .WAV Files in Visual Basic
Tip 167: Controlling the State of Virtual Keys on the Keyboard
Tip 168: Using the ShellExecute Function to Print Files
Tip 169: Setting the Position and Size of the Windows Help File
Tip 170: Positioning the Mouse Pointer over a Specific Control
Tip 171: Determining RGB Color Values
Tip 172: Extracting the Directory Name and the Filename from the Path
Tip 173: Launching Applications in Visual Basic
Tip 174: Using the GetKeyState Function to Determine the State of
Tip 175: Determining the Current Screen Resolution
Tip 176: Sending Files to the Recycle Bin in Visual Basic 4.0
Tip 177: Adding Drag-and-Drop Functionality to Your Application
Tip 178: Enabling or Disabling Fast Task Switching in Windows
Tip 179: Retrieving the Computer Name
Tip 180: Performing Searches in a Combo Box Control with SendMessage
Tip 182: Temporarily Enabling or Disabling Tabs on the TabStrip Control
Tip 183: Changing the Color of the Grid Control's Cells
Tip 184: Creating a List of Directories and Files in a List Box Control
Tip 185: Determining the Number of Printable Lines Per Page on the Printer
Tip 186: Formatting Text in a Rich Text Box Control in Visual Basic 4.0
Tip 187: Determining Whether an Application Was Closed from the Control Menu
Tip 188: Adding New Commands to the Control Menu
Tip 189: Determining Which Screen and Printer Fonts Are Available
Tip 190: Adding Hot Key Access to Your Visual Basic Application
Tip 191: Shelling to Other Applications
Tip 192: Selecting a New Desktop Wallpaper
Tip 193: Launching Windows 95 Control Panel Applets in Visual Basic
Tip 195: Modifying a File's Date and Time Stamp in Visual Basic 4.0
Tip 196: Using the Common Dialog Control to Invoke Context-Sensitive Help
Tip 197: Preventing a Right-Click from Displaying a Context Menu
Tip 198: Retrieving File Information in Visual Basic 4.0
Tip 199: Saving the Contents of the List Box Control to Disk in Visual
Tip 200: Determining the Amount of Free Disk Space
Tip 201: Retrieving the Task List in Windows 95
Tip 202: Forcing a Combo Box Control to Drop Down with the ENTER Key
Tip 203: Searching a Disk for Files Based on Filename and Path
Tip 204: Changing the Screen Resolution at Run Time in Visual Basic 4.0
Tip 205: Drawing a Gradient Background Pattern on Forms in Visual Basic 4.0
Tip 206: Populating the Outline Control with a List of Directories and
Tip 208: Changing the Displayed Icon in the About Dialog Box in
Tip 209: Changing the Color of a Label Control When the Mouse Pointer Is

with thanks to the Visualbasic Group