|
vbAccelerator S-Grid Control
|
Total Hit (2279) |
The SGrid control is an all-VB grid which can emulate the Outlook messages list, including grouping of messages and message preview. The highly optimised display code makes this grid draw faster than FlexGrid and other VB grids even while it allows more sophisticated displays to be set up. It is als
....Read More |
Rating
|
|
|
Owner-Draw Cells with SGrid 2.0
|
Total Hit (2511) |
This sample demonstrates implementing the IOwnerDrawGridCell interface for SGrid 2.0 to create customised cells within a grid. Two easy to re-use examples are provided: a colour indicator and a progress bar.
|
Rating
|
|
|
Creating Shortcuts using VB
|
Total Hit (2218) |
This article expands on the cShellLink class provided to allow the shortcuts used in Window's Recent Document Collection to be investigated. It demonstrates how to use the class to read and write shortcuts, including choosing the icon, start up directory and more.
....Read More |
Rating
|
|
|
Add Your App to the Systray the Easy Way
|
Total Hit (2546) |
This sample application presents a small form which you can drop into your project to get immediate SysTray support. A lot of the source code I've seen for VB SysTray interfaces has used an OCX or DLL and subclassed for a SysTray message, however, it turns out you don't need to do this, because you
....Read More |
Rating
|
|
|
Thumbnail Extraction Using the Shell
|
Total Hit (2158) |
Since Windows Me/2000, the Windows Shell has included a mechanism for extracting a small thumbnail image for any item in the namespace. This sample demonstrates how to use this function to get thumbnail images for web pages, images, Office documents - in fact anything that supports thumbnailing in E
....Read More |
Rating
|
|
|
Adding, Deleting and Viewing Recent Documents
|
Total Hit (1027) |
This sample demonstrates how to add, read and clear the Shell's Recent Document List from VB code. At the same time, it provides a useful ShellLink class for working with Shortcuts.
|
Rating
|
|
|
|
Shell an application and wait asynchronously for completion
|
Total Hit (2626) |
Surprisingly often it comes in handy to be able to shell another application and wait for it to complete. This sample shows what I think is the best way to do it. At least, this method has been totally reliable for me. Its better than some methods I have seen because the application isn't frozen whi
....Read More |
Rating
|
|
|
Splitting the Easy Way
|
Total Hit (1500) |
The EasySplitter class provided with this download completely automates most of the tasks involved with setting up a split between two objects. All you need to do is tell it which two objects you want to split and which direction to split and it does the rest.
....Read More |
Rating
|
|
|
Splitting Aligned Controls on MDI Forms
|
Total Hit (2028) |
This article provides an easy to use class which allows resizing of any aligned control on an MDI form. The code is also available packaged as a DLL for ease of debugging, as it uses a subclass which can make things awkward in the IDE.
|
Rating
|
|
|
Subclassing Without The Crashes
|
Total Hit (2454) |
Prior to VB5, it was impossible to subclass a control without relying on a proprietary custom control. This greatly restricted what you could do if you wanted to play around with some of the neater customisation features - creating a new control was completely out, finding out in detail what was goi
....Read More |
Rating
|
|
|
Emulating Modal Forms
|
Total Hit (997) |
Sometimes, the restrictions applied when showing a modal form can be restrictive. For example, if your application can have more than one main view window, a modal dialog prevents any other form from being activated whilst the modal dialog is displayed. Another example occurs when you want to try an
....Read More |
Rating
|
|
|
Adding Scroll Bars to Forms, PictureBoxes and User Controls
|
Total Hit (2443) |
In the Win32 API, all windows can have scroll bars. However, this feature is not exposed in any way in Visual Basic. Its not too hard to enable, though provided you can intercept WM_HSCROLL and WM_VSCROLL messages sent to the window. This project provides a small, self-contained class which extends
....Read More |
Rating
|
|
|
Tile a Bitmap Into a TextBox Background
|
Total Hit (2843) |
This sample presents a small class that allows you to tile a bitmap into the background of a TextBox. Note that the technique only works on multi-line text boxes, as the drawing of single-line TextBoxes is done in a different way and cannot be easily overridden in code.
....Read More |
Rating
|
|
|
Sophisticated Control Over Window Sizing and Moving
|
Total Hit (1997) |
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
|
|
|
Keep Form Titlebars in Focus when ToolWindows are Shown
|
Total Hit (2108) |
The ToolWindow style, introduced with VB4, allowing you to easily create pop-up tool windows with small captions. However, there is (and has always been) a problem with them: whenever the form or a control on it gets the focus, it appears that the main form of your application looses focus. Whilst m
....Read More |
Rating
|
|
|
Generating MouseLeave Events for a Window
|
Total Hit (2379) |
Almost all of the more recent windows control support a feature known as "Hot-Tracking" - that is, when the control appears to highlight when the mouse moves over it, then returns to normal when the mouse leaves. Common examples include the flat toolbar buttons provided with the Windows Commmon cont
....Read More |
Rating
|
|
|
Creating and Responding to System-Wide Hotkeys
|
Total Hit (1998) |
Win32 allows you to set up combinations of key-presses which can be associated with an application on a system-wide scope, called Hotkeys. When a user presses a registered HotKey it doesn't matter which application is active when they pressed it, the hot-key message will get routed to your applicati
....Read More |
Rating
|
|
|
Drawing Buttons, Option Boxes and Check Boxes In Your Own Style
|
Total Hit (2216) |
If you set the Style property for VB's CommandButton, OptionBox or CheckBox controls to Graphical, VB turns the control into an Owner-Draw control. By default VB allows you to associate three pictures with these controls. However, if you've ever tried this you will know that the button draws like a
....Read More |
Rating
|
|
|
Moving Forms and Creating Resize Gripper Boxes
|
Total Hit (1751) |
This article provides code demonstrating how to modify the behaviour of a VB form so that parts of it behave like title bars and resize borders. You can use this code to:
Create windows without a title bar that you can click on anywhere to move around.
Build fake title bars.
Add a Resize Grippe
....Read More |
Rating
|
|
|
Detecting when another application is activated
|
Total Hit (1021) |
In a form, there is a Deactivate event. Exactly what this method is for is hard to determine, because it hardly ever seems to fire. Ok, that's perhaps a little unfair - it never fires. One thing you certainly can't detect without a bit of additional work is when the user Alt-Tabs to another applicat
....Read More |
Rating
|
|
|
Subclassing and Hooking with Machine Code Thunks
|
Total Hit (2051) |
VB's AddressOf is limited in that it can only provide an address to a function within a module, and not one in a class. This makes doing many things with it harder. However, there is a way of getting a callback to a class function, although you need to know a little assembler to do it. Don't worry i
....Read More |
Rating
|
|
|
Multi-Threaded VB Using ActiveX EXEs
|
Total Hit (2586) |
Ever since VB5 service pack 2, there has been the possibility of running VB applications multi-threaded by using ActiveX EXEs. However, if you try and research this you will find it is fiddly to get working. This article presents a method which makes running operations asynchronously really easy.
....Read More |
Rating
|
|
|
Forcing Any Window to Show in the Taskbar
|
Total Hit (1978) |
VB provides a ShowInTaskBar property for forms which is meant to set whether a form is shown in the Alt-Tab sequence and the shell's task bar. However there are two limitations to this:
The property can't be set at run-time.
Erm, it doesn't work anyway.
Ok, it can work, but only when your form
....Read More |
Rating
|
|
|
Enumerating Windows Using the API
|
Total Hit (1879) |
Prior to VB5, it was impossible to use the enumeration methods provided in the Windows API without relying on a proprietary custom control. This was a problem if you wanted to find out all the Windows showing on the system, because the only reliable methods you can use to do this are through enumera
....Read More |
Rating
|
|
|
Preventing Crashes at Shutdown
|
Total Hit (2081) |
Some versions of ComCtl32.DLL version 6.0 cause a crash at shutdown when you enable XP Visual Styles in an application. This particularly occurs when using VB User Controls.
This article provides two solutions to the problem.
|
Rating
|
|
|
Making VB Apply XP Visual Styles at Design and Debug Time
|
Total Hit (1415) |
If you want to use XP Visual Styles in a VB application, the fact that the controls don't draw using the new styles at design- or debug-time can be a problem, as your form looks different when once you've compiled. Luckily you can persuade both VB5 and VB6 IDEs to use XP Visual Styles too.
....Read More |
Rating
|
|
|
Drawing with XP Visual Styles
|
Total Hit (1707) |
This sample demonstrates using the UxTheme API calls to draw the various objects provided by current Windows XP Theme. This can be a very powerful and simple technique to providing the latest UI effects in controls and applications, as demonstrated by the No Status Bar and No Progress Bar samples.
....Read More |
Rating
|
|
|
Adding XP Visual Styles to Your Visual Basic Application
|
Total Hit (1997) |
When you run a Visual Basic application on an XP machine, you will see that although the form gets an XP-style title bar, the controls on the form still draw in the old-fashioned Windows style. However, it doesn't take much to persuade an application to use the new styles. In some cases, you can get
....Read More |
Rating
|
|
|
Panel Selector Control
|
Total Hit (2458) |
This article provides a regional selection control which can be floated over other controls to provide additional options for the selected item. The demonstration then shows how to use the control in conjunction with SGrid 2.0 in hot-tracking mode to provide an interface similar to the lists in the
....Read More |
Rating
|
|