|
|
|
|
|
|
|
|
CTreeViewEdit - A class for enhanced treeview node editing
|
Total Hit (4388) |
«Code LangId=1»'-------------------------------------------------------
' The CTREEVIEWEDIT Class module
'
' This class lets you use a regular TextBox control to
' edit a treeview node's label. All you have to do to
' use this class is adding a TextBox control to the same
' form that hosts the
....Read More |
Rating
|
|
|
|
FileExists - Check that a file exists
|
Total Hit (3811) |
«Code LangId=1»' Return True if a file exists
Function FileExists(FileName As String) As Boolean
On Error GoTo ErrorHandler
' get the attributes and ensure that it isn't a directory
FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
' if an error occurs, this
....Read More |
Rating
|
|
|
ReplaceLast - Replace the last occurrence of a substring
|
Total Hit (2188) |
«Code LangId=1»' Replace the last occurrence of a string
Function ReplaceLast(Expression As String, Find As String, ReplaceStr As String, _
Optional Compare As VbCompareMethod) As String
Dim i As Long
i = InStrRev(Expression, Find, , Compare)
If i Then
' the search s
....Read More |
Rating
|
|
|
InstrLast - Find the last occurrence of a substring
|
Total Hit (2915) |
«Code LangId=1»
' returns the last occurrence of a substring
' The syntax is similar to InStr
Function InstrLast(ByVal Start As Long, Source As String, search As String, _
Optional CompareMethod As VbCompareMethod = vbBinaryCompare) As Long
Do
' search the next occurrence
....Read More |
Rating
|
|
|
Be careful when installing SHLWAPI.DLL with Visual Installer
|
Total Hit (1961) |
I happened to come across a serious problem when installing my own software with Visual Installer 1.1: the installation of my product on Windows 98 computers caused a system crash during the next Windows start-up. The only way to fix things was to reinstall Windows from CD, over the existent version
....Read More |
Rating
|
|
|
|
Pass the hidden Global object to an ActiveX DLL
|
Total Hit (3201) |
An ActiveX DLL doesn't have direct access to the environment of the calling EXE. For example, the App and Printer objects in the DLL don't correspond to the objects with the same name in the main application, therefore if you want to print something from the DLL using the same settings as the main a
....Read More |
Rating
|
|
|
Get or Set the height of TreeView nodes
|
Total Hit (3951) |
In plain VB there is no way to determine or change the height of node elements in a TreeView control. All you need to accomplish both tasks, however, is send the right message to the control.
«Code LangId=1»
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
hW
....Read More |
Rating
|
|
|
References to form and controls prevent complete form unloading
|
Total Hit (1803) |
When you assign a reference to a form (or one of its controls) to an object variable which is stored outside the form module, you must set the variable to Nothing or the form won't be completely unloaded. In other words, it will become invisible but will continue to take memory.
Note that this i
....Read More |
Rating
|
|
|
Check whether a string array contains an item (without a loop)
|
Total Hit (2636) |
To determine whether a String array contains a given item it seems that you can't avoid writing a loop. However, you can do it with just one line of code, using the new VB6 Join function:
«Code LangId=1»
' ARR is an array of string, SEARCH is the value to be searched
Found = InStr(1, vbNullChar
....Read More |
Rating
|
|
|
How to display Advanced document property of a selected printer ?
|
Total Hit (3632) |
This demo will show you how to use AdvancedDocumentProperties function to displays a printer-configuration dialog box for the specified printer, allowing the user to configure that printer.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Place following code in form1 code windo
....Read More |
Rating
|
|
|
How to modify (Add/Remove) System Menu using API ?
|
Total Hit (12413) |
In this article you will learn how to modify system menu (control menu). You will also learn how to handle event of newly added menu item.
To modify system menu first you have to call GetSystemMenu api to get handle of system menu and then you can all other menu APIs (i.e. GetMenuItemCount, Appen
....Read More |
Rating
|
|
|
|
|
|
Mail Checker Sample Application
|
Total Hit (2554) |
the tutorial that shows you all the steps of creating of the simple application for receiving e-mail.
|
Rating
|
|
|
Translating a Mapped Drive to a UNC Path
|
Total Hit (1631) |
WNetGetConnection, when passed the drive letter of a mapped drive, will return the full UNC path to the \\server\share that drive is mapped to. By adding a few Shell APIs we can create wrapper routines to perform tests on the constituent portions of the mapped path to assure the returned value point
....Read More |
Rating
|
|
|
How to Reorder ListView Columns Programmatically
|
Total Hit (1413) |
We have seen how to allow the user to reorder columns by sending the HEADERDRAGDROP message. The listview control provides another means to reorder the report view columns - programmatically via the COLUMNORDERARRAY message. This page demonstrates this technique.
The principle is simple. We dim
....Read More |
Rating
|
|
|
|
Using PSAPI to get a complete task list and memory usage.
|
Total Hit (3952) |
PSAPI.DLL is a DLL provided for NT/2000/XP systems which greatly simplifies the job of getting task list and memory usage information. The information is also available in the dyamic data section of the registry, but the format is fairly obstructive and it is a considerable task to extract it progra
....Read More |
Rating
|
|
|
Optimised Colour Reduction Using Octrees
|
Total Hit (808) |
Describes the working of the Octree colour quantisation algorithm be used to create optimised colour palettes of arbitrary depth (although typically used for 256 colours) from any image and compares the results with other colour reduction methods.
|
Rating
|
|
|
Saving Pictures to JPG Files Using the Intel JPEG Library
|
Total Hit (2002) |
Whilst Visual Basic provides support for loading graphic files in various formats into a StdPicture object, it sadly forgets about all of these when it comes to saving the file again. You normally only have one choice of file format for writing: a BMP at the system colour depth.
Whilst there are
....Read More |
Rating
|
|