|
|
|
|
|
|
|
Flashing Form Caption
|
Total Hit (3097) |
«Code LangId=1»'Ever wanted to get the users attention without one of those annoying BEEPs, or just have a 'little fun? Here is a good way to do it. Flash the caption of your Form. That should get 'their attention!
'Place this code into a Module:
Option Explicit
Declare Function FlashWindow L
....Read More |
Rating
|
|
|
|
|
|
SetMenuBitmap - Add a bitmap to a menu item
|
Total Hit (3834) |
«Code LangId=1»
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, _
ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, _
ByVal nPositio
....Read More |
Rating
|
|
|
|
|
ArrayStdDev - The standard deviation of a numeric array
|
Total Hit (3244) |
«Code LangId=1»' The standard deviation of an array of any type
'
' if the second argument is True or omitted,
' it evaluates the standard deviation of a sample,
' if it is False it evaluates the standard deviation of a population
'
' if the third argument is True or omitted, Empty values are
....Read More |
Rating
|
|
|
Format a drive using an undocumented function
|
Total Hit (4215) |
SHFormatDrive is an undocumented but simple API function that allows you to format a drive. This function simply opens "Format Drive" diaolog window. Being undocument you won't find its Declare with the API Viewer utility:
«Code LangId=1»
Private Declare Function SHFormatDrive Lib "Shell32.dll"
....Read More |
Rating
|
|
|
Compound member attributes
|
Total Hit (2762) |
The Procedure Attributes dialog includes a Procedure ID combo box, that lets you associate a particular ID to a given member of the class. You usually use this combo to make a property or a method the default item of a class or an ActiveX control, but there are other uses as well. For instance, you
....Read More |
Rating
|
|
|
Better type checking in Variant properties that can accept objects
|
Total Hit (2917) |
As explained in the Mistake Bank you need all three flavors of Property procedures to correctly implement a Variant property that can take either an object or a non-object value. Surprisingly enough, in this case you don't need that the argument of the Property Set procedure be declared As Variant.
....Read More |
Rating
|
|
|
Set tab stop positions for a multiline TextBox control
|
Total Hit (2514) |
By default, multiline TextBox controls insert a tab stop position every 8 characters; in other words, if you press the Ctrl+Tab key while the focus is inside a multiline TextBox control, the caret advances to position 8,16,24, etc. (If the TextBox is the only control on the form that can receive the
....Read More |
Rating
|
|
|
Retrieve information on all available drives
|
Total Hit (3141) |
You can retrieve information about all the available drives using calls to Windows API, if you like the hard way of doing things. A much simpler solution is offered by the Microsoft Scripting Runtime library, that exposes a Drive object that lets you get all those info by querying a property:
....Read More |
Rating
|
|
|
Quickly clear a portion of an array
|
Total Hit (2863) |
The fastest way to clear an array is to ReDim (if the array is dynamic) or Erase it (if the array is Static). However, if you want to clear a portion of an array, it seems that you must code a For-Next loop.
If you are dealing with numeric arrays, there is a faster alternative, based on the ZeroM
....Read More |
Rating
|
|
|
Create all the sub directories of specified path.
|
Total Hit (2251) |
Sometimes we need to create a directory if it doesn't exist. It is easy to create directories using VB. You can use «b»MkDir«/b» function. But what if we need to create all directories of specified path if none of them exists? Well, if you are running Win2K or higher then its easy. You can use follo
....Read More |
Rating
|
|
|
|
How To Use the ADO SHAPE Command
|
Total Hit (3340) |
This article describes the ADO SHAPE command syntax for producing hierarchical recordsets, and explains how to traverse hierarchical recordsets. VBA sample code is also provided.
|
Rating
|
|
|
Invoking Chkdsk using WMI
|
Total Hit (1289) |
Besides returning system information, the Windows Management Instrumentation classes also expose methods that can be called from VB. In addition, the WMI supports the executing of SQL-style calls to retrieve specific information.
|
Rating
|
|
|
|
Force an area of a Window to Repaint
|
Total Hit (2225) |
This sample shows how to force an area of a window to repaint. Sometimes this is necessary, particularly when you're experimenting with owner draw control techniques, or when using the LockWindowUpdate API call to improve the speed at which a control fills with data.
....Read More |
Rating
|
|
|
Using ecdClientDrawOnly with the Owner Draw Combo List Box Control
|
Total Hit (2535) |
This article demonstrates how to use the ecdClientDrawOnly mode of the vbAccelerator Owner Draw and Combo List Box control to draw completely customised Combo Boxes (note that exactly the same technique applies for List Boxes as well). The sample provides three useful implementations - a line picker
....Read More |
Rating
|
|
|
vbAccelerator Office Docking Bar Control
|
Total Hit (2004) |
This control provides a new container for the vbAccelerator Toolbar and CoolMenu control which allows controls to be docked and undocked to the side of any form. It emulates the style of the Office XP toolbars and provides full support for saving and restoring the layout of the toolbars. It can also
....Read More |
Rating
|
|
|
Detecting when another application is activated
|
Total Hit (1045) |
In a form, there is a Deactivate event. Exactly what this method is for is hard to determine, because it hardly ever seems to fire. Ok, that's perhaps a little unfair - it never fires. One thing you certainly can't detect without a bit of additional work is when the user Alt-Tabs to another applicat
....Read More |
Rating
|
|
|