 |
Add multiple child controls to a Coolbar
|
Total Hit (2348) |
The Coolbar control consists of a collection of Band objects, and each Band object exposes a Child property. To move a control inside the Coolbar you just have to assign it to the Child property of a Band object.
A minor problem is that you can't directly assign multiple controls to one Band. The
....Read More |
Rating
 |
|
 |
How to apply the flat style to a toolbar
|
Total Hit (2809) |
All recent Windows applications use a flat toolbar similar to Internet Explorer 's and Microsoft Word's ones. Visual Basic 6 includes a Toolbar control that supports the flat look, but if you are still using VB4 or VB5 and you want to use a flat toolbar without buying a new ActiveX control, you just
....Read More |
Rating
 |
|
 |
Load items faster in the TreeView and ListView controls
|
Total Hit (2743) |
There is an easy, but under-utilized, technique for loading many nodes in a TreeView control (or ListItems in a ListView control) that is faster than the standard technique. Consider this loop:
«Code LangId=1»
For i = 1 To 5000
TreeView1.Nodes.Add , , , "Node " & i
Next
«/Code»
Instea
....Read More |
Rating
 |
|
 |
GetNodeRelationship - Check if two nodes are relatives
|
Total Hit (2154) |
«Code LangId=1»
' Returns a value >0 if Node1 is a parent (or grandparent) of Node2
' Returns a value <0 if Node1 is a child (or grandchild) of Node2
' in both cases the number reflects the number of levels
' between the two nodes
' Returns 0 if the two Nodes are the same or
' if they be
....Read More |
Rating
 |
|
|
|
|
 |
SaveImageList - Save the images in an ImageList control
|
Total Hit (3984) |
«Code LangId=1»
' Save all the images in an ImageList control to a disk file
' Images can be later loaded in the same ImageList control using the
' LoadImageList routine
'
' Note 1: if the file exists, it is overwritten
' Note 2: this routine always save the contents of the ListImages collecti
....Read More |
Rating
 |
|
 |
Tiling an Image Across a Form
|
Total Hit (933) |
How to tile an image across the background of any form (except MDI parents). No APIs needed.
|
Rating
 |
|
 |
Creating the Common Control Initialization Module
|
Total Hit (1054) |
This file will be required to be added to the existing project for all common control API methods detailed here that use the API to actually create the common control (as opposed to using the Visual Basic Common Control). The BAS module will provide the mechanism to initialize the comctl32.dll, rega
....Read More |
Rating
 |
|
 |
Creating a Common Control Header via the API
|
Total Hit (1015) |
If you're like myself, you've probably wished that some of Visual Basic's other controls provided the look (and functionality) of a ListView's header. In this example, we'll use the API to create a real header control and position it overtop a list or textbox.
....Read More |
Rating
 |
|
 |
Adding a VB Progress Bar to a VB StatusBar
|
Total Hit (1542) |
Normally, to calculate the position the progress bar should occupy in the status bar panel, one would calculate the panel position relative to the top left corner of the form, and adjust the coordinates appropriately. However, I found this can be circumvented by temporarily changing the status bar
....Read More |
Rating
 |
|
 |
Changing Colours of a VB ProgressBar
|
Total Hit (1551) |
Here's a quick SendMessage method to change the bar and / or backcolours of both a VB5 or VB6 progress bar, or an API-created progress bar. Note that on XP, using the 'Silver' theme, the default bar colour is grey, not the usual blue.
|
Rating
 |
|
 |
Creating a Custom PhotoShop-Style ProgressBar
|
Total Hit (1032) |
The routines on this page were originally developed to overcome display limitations of the original VB3 SSPanel FloodPercent control, namely use of and justification of text and the positioning the control as a member of a status panel. The routine was originally developed in VB3 and has been update
....Read More |
Rating
 |
|
 |
Creating a Custom PhotoShop-Style ProgressBar in a MDI App
|
Total Hit (1062) |
The routine here is based on code originally developed to overcome some of the display limitations of the original VB3 SSPanel FloodPercent control, namely justification of text and positioning as a member inside a status panel. The routine was originally developed in VB3, and has been updated for u
....Read More |
Rating
 |
|
 |
Creating a Common Control Progress Bar - Overview
|
Total Hit (1596) |
The following is an explanation of the messages and structures used by the Windows Progress Bar common control, written by Brad Martinez and provided for distribution on VBnet.
The Windows Common Controls API continues to grow as more features are added. Currently, comctl32.dll contains the follo
....Read More |
Rating
 |
|
 |
Creating a Common Control Progress Bar via API
|
Total Hit (999) |
The advantages of this implementation are obviously beneficial. First and foremost the need to distribute Comctl32.ocx with an application is eliminated, reducing distribution size. Also an application's memory footprint is significantly reduced by not loading an ActiveX control. And finally, there
....Read More |
Rating
 |
|
 |
Displaying Modal Form Activity on a Parent Form VB Progress Bar
|
Total Hit (1329) |
This is simple code that demonstrates how to use a normal VB progress bar on a parent form (SDI or MDI) to track the activity being performed in another form, even when that form is modal.
The demo also shows how to call SetParent to embed the progress bar inside the status bar panel.
....Read More |
Rating
 |
|
|
 |
Adding a VB Toolbar to a VB StatusBar
|
Total Hit (1304) |
This code was prompted by a newsgroup request for code to place a VB command button inside a VB statusbar such that the button reacted normally to events yet was contained inside the status bar panel area. Attempts to use SetParent against the command button worked to re-parent the control, however
....Read More |
Rating
 |
|
|
 |
Creating a Common Control Status Bar via API
|
Total Hit (1030) |
In this second article written for VBnet by Brad Martinez, Brad works out the magic behind the Win32 Status Bar common control (window) exposed by the common control library Comctl32.dll without the use of Comctl32.ocx. Subsequent pages will introduce more functionality in creating the control.
T
....Read More |
Rating
 |
|
 |
How to Determine Re-Ordered Column Positions in a ListView
|
Total Hit (1520) |
Sending the listview extended style message LVS_EX_HEADERDRAGDROP enables repositioning/reordering of a ListView's main and subitem columns.
However, this does not alter the index of the columns to match their new physical locations. VB remains unaware that repositioning has taken place (since it
....Read More |
Rating
 |
|
 |
How to Set a Flat ListView Header Style
|
Total Hit (1370) |
There may be occasions where a flat-looking listview column header suits the design of your application more that the standard default button-style. By obtaining the handle to the header portion of the listview, and toggling its HDS_BUTTON style bits, the header takes on a flat appearance. Setting
....Read More |
Rating
 |
|
 |
How to Track Cursor Movement in a ListView
|
Total Hit (1097) |
The methods presented here are a bit different. The first (Check1) causes the mouse cursor to change into a hand, and as it moves over the ListView items, causes the item below to become underlined as a visual aid. This is similar to the visual clue in Internet Explorer when a hyperlink is encounter
....Read More |
Rating
 |
|
 |
Tying a Treeview and Listview Together via the Tag Property
|
Total Hit (995) |
Unlike most of the other treeview and listview code examples here on VBnet, this one doesn't use APIs. Its creation was prompted by a newsgroup question by someone wanting to have a treeview and listview with similar items, and to behave such that when the user selected a treeview item, the correspo
....Read More |
Rating
 |
|
 |
Changing a VB Toolbar to a Rebar-Style Toolbar
|
Total Hit (1043) |
Here's a quick routine to set a standard VB toolbar to a IE-style Rebar style control (aka 'coolbar') for IE4 Active Desktop users. The illustration shows the original and flattened style for the same toolbar.
Place a toolbar with images (and optionally text), and add a placeholder. Set the place
....Read More |
Rating
 |
|
 |
Fixing the IE5/MsComCtrl 5 Toolbar Problem
|
Total Hit (1305) |
After the introduction of IE5, users began complaining that their code, which had previously created flat toolbars, failed on systems with IE5 installed. In addition, whenever the text (caption) for a button was changed through code, and the new caption text length differed from that being replaced,
....Read More |
Rating
 |
|
 |
Using the ChooseColor Common Dialog API
|
Total Hit (1596) |
Although the API uses a structure to pass parameters to the ChooseColor API, the dialog can be shown by providing just the flags, hwndOwner, lStructSize and lpCustColors members completed. Other options, such as a hook, can be added to provide additional functionality such as positioning, custom cap
....Read More |
Rating
 |
|
|