|
|
|
|
|
|
|
|
|
|
Reduce COM+ context overhead: use non configured classes
|
Total Hit (1597) |
In another item in this Tip Bank (see link below), we mention that you can co-locate secondary instances within the context of the caller. If you don't need any services at all for your secondary components, then you don't have to configure them as COM+ components either. You lose the deployment and
....Read More |
Rating
|
|
|
Setting a pixel color
|
Total Hit (3512) |
The PSet method is much slower than it should actually be, and in most cases you will find it convenient to substitute it with direct calls to the SetPixel API functions. This function is about twelve times faster than the VB's method, at least when you can set the form's ScaleMode to Pixels, for mo
....Read More |
Rating
|
|
|
Create stand-alone type libraries
|
Total Hit (3115) |
Many VB programmers assume that Visual Basic 5.0 is not capable of creating stand-alone Type Libraries, because the documentation states that when an ActiveX component or control is created, the companion Type Library is embedded in the main executable file.
This is correct, but if you own the E
....Read More |
Rating
|
|
|
Prevent dragging elements in a ListView control
|
Total Hit (3111) |
The ListView control doesn't expose any property that lets you disable the dragging of its elements. To do so, you must trap the WM_NOTIFY message that the ListView control sends its parent form when the drag operation begins, and "eat" it. Using the MSGHOOK.DLL subclassing library it's easy to acco
....Read More |
Rating
|
|
|
Highlight current word and line in a TextBox control
|
Total Hit (2992) |
Here's a simple way to highlight the current word in a TextBox control (i.e. the word where the caret is):
«Code LangId=1»
Text1.SetFocus
SendKeys "^{LEFT}+^{RIGHT}"
«/Code»
Similarly, you can highlight the current line in a multiline TextBox control as follows: «Code LangId=1»
Text1.SetFo
....Read More |
Rating
|
|
|
Append a string to a textbox quickly and without flickering
|
Total Hit (2867) |
The usual way to append text to a TextBox or a RichTextBox control is to concatenate the current contents with the new string:
«Code LangId=1»
Text1.Text = Text1.Text & newString
«/Code»
Here is a different approach, which is slightly faster and causes less flickering: «Code LangId=1»
Text1
....Read More |
Rating
|
|
|
Get the canonical name of a file
|
Total Hit (3364) |
In many cases you may need the canonical (or absolute) name of a file, for example when you need to compare two relative file names (relative to the current directory or drive, that is) and decide whether they point to the same or different files.
You can obtain the canonical path of a file usin
....Read More |
Rating
|
|
|
Extract all quoted strings with the RegExp object
|
Total Hit (3620) |
When parsing a text file that contains quoted strings - such as a VB source file - you might want to quickly locate and extract all the quoted strings. Thanks to regular expressions and the RegExp object in the Microsoft VBScript Regular Expression type library, this task is surprisingly easy:
«co
....Read More |
Rating
|
|
|
Process string characters using Byte arrays
|
Total Hit (2846) |
When you need to process each character in a string, you can assign the string to a byte array and iterate on its elements (remember: each Unicode character corresponds to two bytes). This approach is usually much faster because it saves a lot of Mid$ functions and, hence, a lot of temporary strings
....Read More |
Rating
|
|
|
|
Working with Crypto API to encrypt/decrypt text
|
Total Hit (25650) |
This article uses the CRYPTOAPI sample application to demonstrate how to decrypt or encrypt data.
For more information check MSDN article
«b»«a href='http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncapi/html/msdn_cryptapi.asp'»MSDN Article : The Cryptography API, or How to
....Read More |
Rating
|
|
|
|
|
|
|
How to track the download progress
|
Total Hit (2434) |
The Internet Transfer Control (ITC) provides us with a very easy way to retrieve web resources. But unfortunately the control doesn't have any means to track the progress of data transfer. It could be nice if the control ...
|
Rating
|
|
|
Tiling an Image Across a Form
|
Total Hit (807) |
How to tile an image across the background of any form (except MDI parents). No APIs needed.
|
Rating
|
|
|
Tutorial : Drawing & Animation
|
Total Hit (1486) |
These tutorials are were originally developed as part of a VB Game Programming for beginners book Soren and I were working on. For a variety of reasons the book idea never came to fruition and so we decided to post the material that is finished as a series of tutorials in the hopes that you would fi
....Read More |
Rating
|
|
|
Image Processing Using DIB Sections
|
Total Hit (819) |
This sample demonstrates a new 24 bit image processor using the DIB Section GDI object, allowing you to perform a whole raft of standard Image Processing functions, including blurring, sharpening, colourising, resampling and image arithmetic.
|
Rating
|
|
|
QuickStart - Creating an IE Toolbar
|
Total Hit (1942) |
Describes how to use the vbAccelerator CommandBar control by demonstrating how to create a toolbar which looks like the Internet Explorer main toolbar.
|
Rating
|
|
|
Reading Data from Local or External Library Resources
|
Total Hit (2773) |
Often your application will have associated data, such as pictures, sounds, static data and so forth you need to ship with it. If you are localizing your application then you also need to be able to provide alternative text strings for menus, messages, labels on so forth. Resources are a great way t
....Read More |
Rating
|
|