|
|
|
|
|
|
|
|
|
|
InstrWordEx - Find a whole word, with your choice of delimiters
|
Total Hit (1759) |
«Code LangId=1»
'------------------------------------------------------------------------
' This enum is used by both InstrWordEx and ReplaceWordEx
'
' It uses a binary value to determine what separator characters are allowed
' bit 0 = allow spaces
' bit 1 = allow symbols
' bit 2 = allow cont
....Read More |
Rating
|
|
|
IsPrime - Determine whether a number is prime
|
Total Hit (1634) |
«Code LangId=1»
' Return True if the number is prime
Function IsPrime(ByVal number As Long) As Boolean
' manually test 2 and 3
If number > 3 Then
If number Mod 2 = 0 Then Exit Function
If number Mod 3 = 0 Then Exit Function
End If
' we can now avoid to consi
....Read More |
Rating
|
|
|
Avoiding Access Denied erros when raising events from MTS objects
|
Total Hit (3175) |
If you don't take specific actions, you get an Access Denied Error when you try to raise an event from an MTS component into a client. This happens because the client executable doesn't have the proper DCOM security settings to let the server call it back. In order to have it working you have two so
....Read More |
Rating
|
|
|
Provide a free preview of Office Documents
|
Total Hit (1738) |
NOTE that this tip requires Windows 98, Windows 2000, Windows 95/NT 4.0 + Active Desktop. If your application must do a lot of work with Office documents, then chances are that you might need to provide a quick preview of them. I'm not talking about scrolling pages up and down as in Word or Excel bu
....Read More |
Rating
|
|
|
Determine how many records the DataReader is about to return
|
Total Hit (2282) |
The DataReader is the ADO.NET counterpart of the forward-only, read-only recordset in classic ADO. For this reason you never know how many rows the DataReader is about to return. In most cases you don't need this information, because you tipically process each row as soon as it is being returned, an
....Read More |
Rating
|
|
|
Register and unregister components with context menus
|
Total Hit (3318) |
The stardard method to register and unregister ActiveX component is running the REGSVR32 utility, which forces you to bring up the Start|Run dialog and manually type the command line. A much better approach is to have the Register and Unregister commands right in the context menu that appears when y
....Read More |
Rating
|
|
|
Use DataChanged with unbound controls
|
Total Hit (1992) |
When you need to learn if a field has been changed by the user, you have at least three options:
you can use a global boolean variable and set it in the control's Change event, or
you can save the original value in global variable to compare it against the current value
you can use the EM_GE
....Read More |
Rating
|
|
|
Create arrowed buttons without icons
|
Total Hit (4035) |
You don't need to use icons or bitmap to create buttons with arrows on them. In fact, you just have to select the "Windings" font, set a suitable font size (e.g. 12 or 14 points), and then enter one of these characters:
«Code LangId=1»
Line arrows
Chr$(223) Left Arrow
Chr$(224) Right Arrow
Chr
....Read More |
Rating
|
|
|
Very simple Encryption/Decryption code using VB
|
Total Hit (5182) |
This code will show you how to encrypt/decrypt a string.
Copy/Paste the following code in your VB form and press F5 to run.
«code LangId=1»Const ENCRYPTION_KEY = "MySecreteKey123"
Private Sub Form_Load()
Dim txt As String, enctxt As String
txt = "Your password is : asd$223"
....Read More |
Rating
|
|
|
Working with LZ (Lempel-Ziv) compression APIs
|
Total Hit (6612) |
«b»Lempel-Ziv compression«/b» is a lossless compression algorithm, which means that no data is lost when compressing and decompressing the file, as opposed to lossy compression algorithms such as JPEG, where some data is lost each time data compression and decompression occur. NTFS volumes support f
....Read More |
Rating
|
|
|
How to create pattern brush from bitmap or picture object ?
|
Total Hit (6617) |
In this article we will learn how to use CreatePatternBrush along with CreateBitmap API. CreateBitmap can be used to create a memory bitmap of specified width, height and Bits/Pixel. CreatePatternBrush can create a pattern brush based of Bitmap. You can also use VB Picture object as a bitmap handle.
....Read More |
Rating
|
|
|
How to list all available timezones and change the timezone?
|
Total Hit (6878) |
It is sometimes necessary to programmatically change the time zone for the system where the application is running. This article demonstrates this technique.
The way to implement this effect is as follows:
Determine which time zone you would like to change to.
Find the key in the registry tha
....Read More |
Rating
|
|
|
|
|
|
Centering the Open & Save Common Dialogs Using Callbacks, Advanced
|
Total Hit (1322) |
Centering the Open & Save Common Dialogs Using Callbacks showed just how simple implementing a window hook for the OPENFILENAME structure can be. Here we expand upon that same code to provide additional positioning options - centred to the screen, to the parent form, or allow the dialog to take its
....Read More |
Rating
|
|
|
VB Programmer's AVIFile Function Help Pages
|
Total Hit (1214) |
Windows contains a powerful set of video file functions called the AVIFile API ('Application Programming Interface'). The AVIFile API set of functions is part of an even larger API called the Video For Windows API. It is possible to use the AVIFile functions from Visual Basic. However, the lack o
....Read More |
Rating
|
|
|
Transparent GDI Sprite Library
|
Total Hit (2164) |
This VB library aims to make it simple to add fast, animated graphics using transparent sprites, something which is either missing or dismally slow using VB's standard methods. The source code provides a complete screen saver, and a simpler (and somewhat smaller) sample which animates a large number
....Read More |
Rating
|
|
|
MusicLibrary SGrid Sample
|
Total Hit (2367) |
This sample uses SGrid 2.0 along with the MP3 Tags code to load, display and persist a Music Library. It allows library import, sorting, grouping and in the future should be upgraded to include tag editing and play functions. It has been successfully used with over 7,000 tracks.
....Read More |
Rating
|
|
|
Sophisticated Control Over Window Sizing and Moving
|
Total Hit (2040) |
VB's control over moving and sizing isn't much - basically you have the Resize event, as has been the case since VB1. Windows gives you a lot more control over moving and sizing forms if you need it though. For example, try resizing an undocked tool window in MS Office. You will see that the size sn
....Read More |
Rating
|
|
|
High Resolution Multimedia Timer
|
Total Hit (2881) |
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
|
|