|
|
|
|
|
|
|
|
ShellSort - Sort Arrays using the ShellSort Algorithm
|
Total Hit (1663) |
«Code LangId=1»
' ShellSort an array of any type
'
' ShellSort behaves pretty well with arrays of any size, even
' if the array is already "nearly-sorted", even though in
' particular cases BubbleSort or QuickSort can be more efficient.
'
' LASTEL is the index of the last item to be sorted,
....Read More |
Rating
|
|
|
BitSet - Set a bit in a number
|
Total Hit (2887) |
«Code LangId=1»' Set a bit in a value
'
' NOTE: requires Power2()
Function BitSet(ByVal value As Long, ByVal bit As Long) As Long
' simply OR with the bit mask
' Range checking is performed in Power2()
BitSet = (value Or Power2(bit))
End Function
' Raise 2 to a power
' the e
....Read More |
Rating
|
|
|
LowWord - The least significant word of a Long value.
|
Total Hit (2167) |
«Code LangId=1»Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)
' Return the low word of a Long value
Function LowWord(ByVal value As Long) As Integer
CopyMemory LowWord, value, 2
End Function
«/Code»
....Read More |
Rating
|
|
|
RotateLeft - Rotate a Long to the left
|
Total Hit (1793) |
«Code LangId=1»' Rotate a Long to the left the specified number of times
'
' NOTE: requires Power2()
Function RotateLeft(ByVal value As Long, ByVal times As Long) As Long
Dim i As Long, signBits As Long
' no need to rotate more times than required
times = times Mod 32
....Read More |
Rating
|
|
|
Manage the SQL Server date format with SQL DMO
|
Total Hit (3158) |
If you haven't localized SQL Server for your language, the default date format is the American one: DD/MM/YY. You may need to display a date in different formats, and you can solve this problem with the help of SQL DMO. A possible solution is using the T-SQL CONVERT() function to show the date with
....Read More |
Rating
|
|
|
Open the default program for sending email messages
|
Total Hit (2620) |
The ShellExecute API function recognizes email addresses if they are prefixed by the "mailto:" prefix, and correctly run the default program for sending email messages (e.g. Outlook). This lets you open a window for sending an email and automatically fill the address field. Here's a wrapper routine
....Read More |
Rating
|
|
|
Check whether a sound card exists
|
Total Hit (3417) |
If you are developing a game in VB or an application that plays sounds, you probably want to check that a sound card actually exists. There is an API function that does this, and returns the number of sound cards installed in the system. Therefore, a return value of zero means that no devices are pr
....Read More |
Rating
|
|
|
Smart Tab key processing in multiline TextBox controls
|
Total Hit (2474) |
The only way for a Tab key to insert a tab character in a multiline text box is that the text box is the only control on the form, or at least the only control whose TabStop property is set to True. Otherwise, pressing the Tab key you simply move the focus to another control on the form.
If there
....Read More |
Rating
|
|
|
Quickly copy field attributes when creating tables
|
Total Hit (3054) |
Under VB6 you can create new SQL Server and Oracle tables - but not MDB tables - without leaving the environment. You only have open the DataView window, right-click on the Tables folder of a database, and select the New Table mennu command.
When working with similar tables, that is tables with m
....Read More |
Rating
|
|
|
The "And" operator is faster than "Mod"
|
Total Hit (4151) |
Using the "And" operator instead of "Mod" may speed up your program under certain situations. Use the And operator instead of Mod when the divisor is a number in the form 2^N. For instance, there are two methods to extract the least significant byte in an Integer:
«Code LangId=1»
lowByte% = valu
....Read More |
Rating
|
|
|
Items of ParamArray can be Missing
|
Total Hit (3453) |
When using the ParamArray keyword within a procedure, always remember that when the procedure is invoked from elsewhere in the program one of the argument might be omitted, and you should keep this into account. Here is an example of a routine that uses ParamArray:
«Code LangId=1»
Function Max(
....Read More |
Rating
|
|
|
Very simple way to create transparent image using API
|
Total Hit (2613) |
If you ever need to create transparent BMP then don't worry here is an API which makes your life easy. To make this demo simple I have avoided color selection. In this demo default transparent color is first left top pixel color of source image.
«b»Step-By-Step Example«/b»
- Create a standard
....Read More |
Rating
|
|
|
Example of rectangle APIs
|
Total Hit (2528) |
This sample code will show you how to work with basic Rectangle manipulation APIs to do some math operations with Rectangles.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one timer control on the form1
- Add the following code in form1
«code LangId=1»Option Explicit
....Read More |
Rating
|
|
|
How to Disable the Ctrl-Alt-Del keys combination...
|
Total Hit (3312) |
API Declarations
«Code LangId=1»
Private Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
«/Code»
Module
«Code LangId=1»
Sub DisableCtrlAltDelete(bDis
....Read More |
Rating
|
|
|
Using XML Queries and Transformations
|
Total Hit (1722) |
Professional Visual Basic 6 XML shows the VB community how to take advantage of XML technology and the available (free-to-use) implementations. The flexible and standards-based data description that XML provides can be used in a myriad of places where VB programmers are active.
To learn more abo
....Read More |
Rating
|
|
|
Developing with a new standard in UI
|
Total Hit (2619) |
In this new century we enter, everything relating to software should have a standard of quality. For small time programmers, that doesn't necessarily mean having quick turnaround or technical support response. No, for quality, I mean having features that can make your user interface smart and easier
....Read More |
Rating
|
|
|
Fixing the IE5/MsComCtrl 5 Toolbar Problem
|
Total Hit (1231) |
After the introduction of IE5, users began complaining that their code, which had previously created flat toolbars, failed on systems with IE5 installed. In addition, whenever the text (caption) for a button was changed through code, and the new caption text length differed from that being replaced,
....Read More |
Rating
|
|
|
EnumWindows and EnumChildWindows Callbacks
|
Total Hit (1687) |
Many Windows' Enum APIs provide callback data for specific tasks.
This project demonstrates using both EnumWindows and EnumChildWindows APIs and their respective EnumWindowProc and EnumChildProc callbacks. The main form in the demo enumerates all top-level windows on the system populating ListView
....Read More |
Rating
|
|
|
|
Change The Width of Items in a Listbox
|
Total Hit (2463) |
Normally in a VB ListBox, if a ListItem is too long to fit, it is clipped by the display. This tip demonstrates how to modify a ListBox so it displays a longer items with a horizontal scroll bar.
|
Rating
|
|
|
Transparent AVI Player Control
|
Total Hit (3627) |
The Animation control supplied with VB (and from various other VB websites) is derived from the implementation within COMCTL32.DLL. However, this implementation only allows you to play AVIs with no audio stream. Also, its idea of transparency isn't quite what you might expect: setting an AVI to tran
....Read More |
Rating
|
|
|
|
Clipboard Ring Sample
|
Total Hit (1060) |
This sample uses the cClipboardViewer class to hook into clipboard change notifications, and then displays them in a pinnable ListBar in a similar manner to the Clipboard Ring functionality provided in Visual Studio.
|
Rating
|
|