|
How to Paint a ScanBar CODE39 on Printer or PictureBox
|
Total Hit (2911) |
«Code LangId=1»'Put this code at a module.
'Usage: PaintCodeBar39 Printer, Xpos, Ypos, BarsHeight, WidthFactor, Text, HumanRead
' Printer.EndDoc
Public Type C39
char As String * 1
bar(1 To 5) As Boolean
spe(1 To 5) As Boolean ' 5th space for character gap
End Type
Dim CODE39(
....Read More |
Rating
|
|
|
Undocumented Shell Path APIs (Testing Path).
|
Total Hit (4334) |
Way back when Microsoft released Internet Explorer 4.0, they bundled with it a number of upgrades to the operating system including a new DLL called SHLWAPI.DLL (Shell Lightweight Utility APIs). That DLL provided programmers with some useful path manipulation functions (amongst other things), but ob
....Read More |
Rating
|
|
|
Retriving ICMP statistics using GetIcmpStatistics API
|
Total Hit (2893) |
This code will show you use of GetIcmpStatistics API which can give you some important information regarding ICMP information.
Here is the sample output of this program
«code LangId=0»# Messages [in/out] : 9/11
# Error [in/out] : 0/0
# Redirects [in/out] : 0/0
# Echos [in/out] :
....Read More |
Rating
|
|
|
Setting Custom Paper Size using Printer API
|
Total Hit (34149) |
Here is the alternate method which shows how to use printer APIs to set custom papersize and other printer properties using API. This code will work with Win9x and WinNT both.
|
Rating
|
|
|
|
|
|
|
|
|
|
|
RLECompress - Compress a block of memory using RLE algorithm
|
Total Hit (3644) |
«Code LangId=1»Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal Bytes As Long)
' compress a block of memory (a string, an array, a bitmap)
' using the RLE compression algorithm
'
' Returns True if the block has been compressed,
'
....Read More |
Rating
|
|
|
LCM - The Least Common Multiple of two integers
|
Total Hit (3402) |
«Code LangId=1»' the Least Common Multiple of two integers
' (it uses the Euclide's algorithm)
' if either argument is zero you get a "Division by Zero" error
'
' Note: if your app also includes the CGD() function,
' you can simplify the following code as follows:
' LCM = (n1 * n2)
....Read More |
Rating
|
|
|
Silent install with VB6 Deployment and Packaging Wizard
|
Total Hit (2252) |
VB6 Deployment and Packaging Wizard's resulting setup.exe has a command line switch that allows for a silent install. This feature is virtually undocumented except in the source code for Setup1.exe. The default path for the project file of Setup1 is:
C:\Program Files\Microsoft Visual Studio\VB98\
....Read More |
Rating
|
|
|
Register and unregister type libraries
|
Total Hit (3725) |
All COM-oriented VB developers know how to register and unregister an ActiveX DLL, using the REGSVR32 utility. However, there is no such an utility to register and unregister a type library.
You can quickly build your own TLB Registration utility with a handful of statements, thanks to the undoc
....Read More |
Rating
|
|
|
Print the WebBrowser's contents
|
Total Hit (2928) |
The WebBrowser control doesn't expose any method to directly print its contents. You can achieve this effect through the ExecWB method, by passing the OLECMDID_PRINT constant in its first argument:
' display the Print dialog
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
You can
....Read More |
Rating
|
|
|
Use Refresh, not DoEvents
|
Total Hit (2114) |
The DoEvent statement should be used only to give other portions of your program to be reactive to the end user's actions. Instead, many VB developers use it to force a repaint of a form or some of its controls. This means adding a lot of overhead to your code, which you can avoid by using the Form'
....Read More |
Rating
|
|
|
Counting characters in a file
|
Total Hit (3847) |
Ever needed to count how many characters of a given type are in a file? For instance, how many alphabetical characters, or digits, or spaces? You might read each line of the file using Line Input, but you will probably to load the whole file in memory using one single operation:
«Code LangId=1»
....Read More |
Rating
|
|
|
Create Controls at RunTime
|
Total Hit (4792) |
API Declarations
«Code LangId=1» 'API Calls
Public Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal n
....Read More |
Rating
|
|
|
Tile image in MDI Background.
|
Total Hit (3144) |
This code Requires MDIForm and 1 Picturebox.
Set Picture property of picturebox. This picture will be used for MDI Background
|
Rating
|
|
|
Give user ability to interrupt loop
|
Total Hit (2932) |
Private Declare Function GetAsyncKeyState Lib "user32.dll" _
(ByVal vKey As Long) As Integer
'//ESCAPE
Const VK_ESCAPE = &H1B
'//Button Click
Const VK_LBUTTON = &H1
'//Interrupting A Do Loop
'//Give user ability to interrupt loop
Private Sub cmdStart_Click()
....Read More |
Rating
|
|
|
|
Hooking the Open & Save Common Dialogs To Manipulate Components
|
Total Hit (1521) |
Now that you're an expert at centering a common dialog using hooks its time to look at customizing other aspects of the dialog window. A frequent request is a method to set custom captions for the various buttons and static fields (labels) on the dialog. This page addresses this request.
Again the
....Read More |
Rating
|
|
|
Creating a Transparent Bitmap
|
Total Hit (1565) |
Start a new project, and to the form add two controls - a single command button and a single PictureBox containing the picture to make transparent (Source), as shown in the illustration. The 'Transparent Result' in this example is displayed on the form's hdc, not in another picture or image control.
....Read More |
Rating
|
|
|
RunTime Debug Tracing
|
Total Hit (2063) |
Sometimes you want to be able to view trace messages when running your application outside the VB IDE. Perhaps something slightly different happens as an Executable; or you may be running something that's not so easy to debug, such as subclasses, callback procedures and custom COM implementations. W
....Read More |
Rating
|
|
|
Reading and Writing MP3 ID3v1 and ID3v2 Tags
|
Total Hit (1106) |
This article describes the MP3 ID3v1 and ID3v2 tags and provides a sample application which can read and write both types from MP3 files, along with two reusable classes wrapping up the tag functionality.
|
Rating
|
|
|
vbAccelerator Visual Studio Style Tab Control
|
Total Hit (1559) |
This control reimplements the tab drawing code used in the vbAccelerator MDITabs Control as a fully-featured Visual Studio style Tab Control, with a fully-typed object interface. It also supports pinning and unpinning tabs, so when they're unpinned they show a small vertical tab-bar which slides-out
....Read More |
Rating
|
|
|
Creating ListView Style Groups with SGrid 2
|
Total Hit (2494) |
This sample demonstrates how to use owner-draw to customise the appearance of grouping rows, and to ensure that they remain open in the style of the Windows XP ListView in grouped mode. It also demonstrates adding new rows to a grouped grid and moving them to the correct position given the current s
....Read More |
Rating
|
|
|
vbAccelerator TreeView Control
|
Total Hit (1777) |
This article provides a new TreeView control that provides an alternative to the standard version provided with VB. Enhancements include much wider support for item colours and formatting, better drag-drop support including node auto-expand and scrolling, styles to support numbering items and an IE-
....Read More |
Rating
|
|