 |
Get the Default Printer
|
Total Hit (5749) |
API Declarations
«Code LangId=1»
Option Explicit
'MS Windows API Function Prototypes
Private Declare Function GetProfileString Lib "kernel32.dll" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVa
....Read More |
Rating
 |
|
 |
Print an Image contained in a Picture Box or a Form
|
Total Hit (2527) |
Module
«Code LangId=1» 'Print the Picture contained in a PictureBox or a Form
Public Sub PrintImage(p As IPictureDisp, Optional ByVal x, Optional ByVal y, Optional ByVal resize)
If IsMissing(x) Then x = Printer.CurrentX
If IsMissing(y) Then y = Printer.CurrentY
If IsMissing(resiz
....Read More |
Rating
 |
|
 |
How to Print a Multiline TextBox with Alignment!
|
Total Hit (5197) |
API Declarations
«Code LangId=1» 'Add this to your Declarations Section:
Public Declare Function SetTextAlign Lib "gdi32.dll" (ByVal hdc As Long, ByVal wFlags As Long) As Long
Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wmsg As Long, ByV
....Read More |
Rating
 |
|
 |
How to Print Full Justified Text
|
Total Hit (3230) |
Module
«Code LangId=1» Option Explicit
Public Sub PrintLine(Text As String, SpaceWidth As Single, Target As Object)
'Print a justified line to the Target object
Dim i As Integer
Dim cx As Single
Dim OldBold As Boolean
Dim OldUnderLine As Boolean
Dim OldItalic As
....Read More |
Rating
 |
|
 |
Print a Picture to Fit a Page!
|
Total Hit (3087) |
Module
«Code LangId=1» Option Explicit
Public Sub PrintPictureToFitPage(Pic As Picture)
Dim PicRatio As Double
Dim printerWidth As Double
Dim printerHeight As Double
Dim printerRatio As Double
Dim printerPicWidth As Double
Dim printerPicHeight As Double
'
....Read More |
Rating
 |
|
 |
How to run an AVI inside a PictureBox control
|
Total Hit (3675) |
API Declarations
«Code LangId=1» Const WS_CHILD = &H40000000
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Lon
....Read More |
Rating
 |
|
 |
Tunnel graphical effect
|
Total Hit (1849) |
Usage
«Code LangId=1»
'Create a Form and place this code inside
'Sorry but the comments are in german :((
Option Explicit
Dim offx% ' x-offset zur mitte
Dim offy% ' y-offset zur mitte
Dim anz% ' anzahl sterne
Dim bahnx%(100, 180)
....Read More |
Rating
 |
|
|
|
|
|
|
|
|
|
 |
How to handle the Mouse Wheel events in your projects (improved)
|
Total Hit (3265) |
API Declarations
«Code LangId=1»
'==============inside a MODULE
Option Explicit
'************************************************************
'API
'************************************************************
Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA"
....Read More |
Rating
 |
|
|
 |
File Clipboard Enhancer
|
Total Hit (1916) |
Windows Explorer allows you to cut, copy and paste files. However, whilst it uses the clipboard to do this, the file information is not made generally accessible as a custom clipboard is used. Often it's useful to be able to paste a file name as text: for example, into a file name field in an applic
....Read More |
Rating
 |
|
 |
Clipboard Ring Sample
|
Total Hit (1107) |
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
 |
|
 |
Using the Find and Replace Common Dialogs
|
Total Hit (2857) |
VB has never provided direct support for the Find/Replace common dialogs. This may have been because these dialogs are non-modal, and it is more difficult to use these from an ActiveX control container, or that it is fairly simple to knock up your own Find/Replace form in VB without bothering with t
....Read More |
Rating
 |
|
 |
CommonDialog/Direct
|
Total Hit (3155) |
Common Dialog/Direct is a new DLL or class library which shows how to completely replace COMDLG32.OCX through Visual Basic code. The main advantage of this is you no longer need to put a control on a form to use common dialogs - just declare an instance of the class and you have a straight replaceme
....Read More |
Rating
 |
|
 |
Common Dialog Templates - Create a WinZip Style File Add Dialog
|
Total Hit (1169) |
This sample, from Cayce Cochran (cayce@fastlane.net), demonstrates how to use a dialog template with a File Open or Save CommonDialog. It takes advantage of the CommonDialog/Direct DLL component which now (versions dated 1 November 1999 and higher) includes the relevant support for templates.
....Read More |
Rating
 |
|
|
 |
Browsing For Folders
|
Total Hit (2173) |
The Folder Browse Dialog is the missing dialog in VB - it can't be called from a run-time function and it is missing from the Common Dialog OCX as well. Whilst a number of code samples demonstrate that calling this dialog is simple, many ignore the most important feature: the ability to initialise t
....Read More |
Rating
 |
|
 |
Two code only solutions for displaying Common/Dialogs
|
Total Hit (1096) |
The Common Dialog/Direct component provides you with a more functional version of the Common Dialog control which also means you no longer need a form to create Common Dialogs. These samples show how you can go one further with your app and remove the need to ship any DLLs at all!
....Read More |
Rating
 |
|
 |
Introduction to the freeware Info-ZIP libraries
|
Total Hit (1995) |
This project started when I was trying to build up the indexes for the vbAccelerator site. I had a program to search through all the HTML files which make up the site, and this could pick out the ZIP files linked to by the pages. But how to determine which projects these ZIP files contained? You nee
....Read More |
Rating
 |
|
|
 |
Unzipping files using the free Info-Zip Unzip DLL with VB
|
Total Hit (1933) |
This article provides a fully featured unzip application written in VB, using the capabilities of the Info-ZIP Unzip DLL. The zip application demonstrates the abilities of the unzip DLL to handle all aspects of unzip operations - password protection, directory listing, including directories whilst u
....Read More |
Rating
 |
|
 |
Compressing and Expanding with the Freeware zLib.DLL
|
Total Hit (1179) |
This project from Benjamin Dowse (bendowse@dingoblue.net.au) provides a reusable DLL which allows you to compress and decompress byte arrays and strings. You can compress data in memory, or using file IO in Visual Basic you can also compress files.
|
Rating
 |
|
 |
High Resolution Multimedia Timer
|
Total Hit (2941) |
The standard timer supplied with VB is great for most tasks, but the frequency it updates at isn't acceptable for high-performance multimedia. In audio applications the system must be capable of firing audio events with a 1ms resolution, otherwise the ear will be able to discern the timing inaccurac
....Read More |
Rating
 |
|