|
|
|
|
|
|
|
SplitSubMenu - Split a submenu with vertical bars
|
Total Hit (2854) |
«Code LangId=1»
Private Type MENUITEMINFO
cbSize As Long
fMask As Long
fType As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type
Private
....Read More |
Rating
|
|
|
GetFileExtension - The extension in a filename
|
Total Hit (2029) |
«Code LangId=1»' Return the extension of a file name
Function GetFileExtension(ByVal FileName As String) As String
Dim i As Long
For i = Len(FileName) To 1 Step -1
Select Case Mid$(FileName, i, 1)
Case "."
GetFileExtension = Mid$(FileName, i + 1)
....Read More |
Rating
|
|
|
GetFileVersionData - Retrieve file versioning information
|
Total Hit (2202) |
«Code LangId=1»Private Declare Function GetFileVersionInfoSize Lib "version.dll" Alias _
"GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, _
lpdwHandle As Long) As Long
Private Declare Function GetFileVersionInfo Lib "version.dll" Alias _
"GetFileVersionInfoA" (ByVal lptstr
....Read More |
Rating
|
|
|
VolumeLabel - Read the label of a disk volume
|
Total Hit (1698) |
«Code LangId=1»' Return the volume label of a disk
' Pass a null string for the current disk
Function VolumeLabel(drive As String) As String
Dim temp As String
On Error Resume Next
temp = Dir$(drive, vbVolume)
' remove the period after the eigth character
VolumeLabel =
....Read More |
Rating
|
|
|
|
InstrTbl - Search a string for any character in a table
|
Total Hit (1647) |
«Code LangId=1»
' If INCLUDE is True or is omitted, return the first occurrence of a character
' in a group
' or zero if SOURCE doesn't contain any character among those listed in TABLE.
' If INCLUDE is False, return the first occurrence of the character in SOURCE
' that does not appear in TAB
....Read More |
Rating
|
|
|
Disable the Ctrl-Alt-Del key combination (Windows 9x only)
|
Total Hit (3724) |
In Windows 95 and 98, when the screen saver is currently active (and the screen is blanked) the Ctrl-Alt-Del key combination doesn't work, in order to force the user to enter her password. You can take advantage of this feature and programmatically disable this key combination, by making Windows bel
....Read More |
Rating
|
|
|
Extract RGB components from a Long value
|
Total Hit (2994) |
You can extract RGB values out of a 32-bit color value by using the integer division and the MOD operators, but there is a much more effective way, based on the LSet. You can convert from a long to rgb bytes and vice versa with the following code:
«Code LangId=1»
Private Type RGBWrapper
Red
....Read More |
Rating
|
|
|
Quickly build a simple About form
|
Total Hit (2245) |
If you need a quick-and-dirty About dialog box for your application, that maintains a consistent look with other Windows applications, look no further than the ShellAbout routine in SHELL32.DLL. Using this function you have little control on what the dialog displays, and you can only customize the P
....Read More |
Rating
|
|
|
Don't use SetFocus on invisible controls
|
Total Hit (2037) |
In the Show event of a form you might be tempted to use SetFocus to select which field the end user should begin working with. However, this method raises an error 5 when applied on a control that is currently invisible.
If the logic of your application should give the focus always to the same c
....Read More |
Rating
|
|
|
Get a reference to a form given its name
|
Total Hit (1924) |
In some cases you might want to activate a form given its name, but VB doesn't let you do it directly. However, it is easy to create a function that does it by iterating over all the forms in the current project:
|
Rating
|
|
|
Always use "$-typed" string functions
|
Total Hit (2784) |
VB official documentation seems to encourage you to use "$-less" string functions, e.g. Left, LTrim or UCase, instead of their time-honored Left$, LTrim$ and UCase$ counterparts. If you do so, however, you should be aware that the former ones return a variant value that, when used within string expr
....Read More |
Rating
|
|
|
How to perform clipping using API
|
Total Hit (5548) |
To perform very complex clipping operations you can use a set of clipping APIs. From this sample code you will learn several techniques of clipping.
A clipping region is a region with edges that are either straight lines or curves. You can create simple or complex regions using various region API
....Read More |
Rating
|
|
|
|
|
How to Set Item Indentation in a ListView
|
Total Hit (715) |
Many people erroneously believe that the 'control' used in displaying hierarchical data such as Outlook Express' news reader view is a treeview control with columns. Actually, the control is a ListView taking advantage of the comctl version 4-specific Indent member of the LV_ITEM structure. This pag
....Read More |
Rating
|
|
|
ListView Demo 1 - Obtaining the File Path
|
Total Hit (969) |
This page details the code required to construct the base form, and the code necessary to retrieve the user's selection using the Windows Browse dialog.
When the demo is completed, the final app will retrieve the users selection and populate the listview with selected files from that folder, comp
....Read More |
Rating
|
|
|
Displaying a Balloon Tip in a Combo Box
|
Total Hit (1118) |
Note: In order for EM_HIDEBALLOONTIP to function correctly users must not have disabled the "Enable balloon tip" setting on the system. Using TweakUI for XP, this is located under the Taskbar group of options. It is also directly accessible as a registry entry under HKEY_CURRENT_USER \ Software \ Mi
....Read More |
Rating
|
|
|
Browse for Folders Callback Overview
|
Total Hit (1428) |
Windows' Browse for Folders dialog provides the means to retrieve from a user their selection of the Shell's file system and special folders. The following and related code page discuss adding callback functionality to a VB5 application to provide the ability to pre-select a folder on the dialog's d
....Read More |
Rating
|
|
|
Blend Two Colours Together Using Alpha
|
Total Hit (1478) |
If you're not using GDI+ for drawing, then there isn't an easy way to determine what colour you would get if you blended two colours together with a specified alpha amount. This article provides a routine that allows you to do it using straight VB code.
....Read More |
Rating
|
|
|
|
Scale, Rotate, Skew and Transform Images using GDI+
|
Total Hit (1680) |
GDI+'s image rendering is considerably more powerful than the basic bitmap transfer functions provided under GDI. You can perform high-quality rotation, scaling and skewing with no additional lines of code: and better still the functions run very fast on half decent machines.
....Read More |
Rating
|
|
|
vbAccelerator Progress Bar Class
|
Total Hit (1794) |
This article provides a class that allows you to draw progress bars onto any control, form or API created object with a hDC property. The drawing code is derived from the vbAccelerator Progress Bar control and all functionality except Image Processing and persistence of data is included.
....Read More |
Rating
|
|
|