GT List v1.0 Tabbed List Box
	GT List v2.0 Tabbed List Box Properties Methods Events
License & Copyright

Disclaimer of Liability & Warranty

Description

GT List v2.0 Tabbed List Box is in all respects similar to the standard Windows/VisualBasic List Box.control except for the three additional properties I've added.  Each of this three properties are discussed in full in the Properties section of this help file.

Filename

GTLIST.VBX

Object Type

TListBox

Remarks

GT List v2.0 was incepted out of my frustration in setting the List Box control's tab stops (click on the frustration popup for the long story).   GT List v2.0 enables the application programmer to set a List Box's tab stop(s) precisely where s/he wants them.  The TabStops property takes pixel values therefore saving the application programmer the drudgery in dealing with DialogBaseUnits (which seems to be a useless unit-of-measure in Visual Basic).

If you feel the text describing the special properties of GT List v2.0 is not very enlightening, please take time to go through the included project.  The application of the special properties in the project may be more explanatory of how the properties work and how they are used.

GT List v2.0 is my first attempt in writing Visual Basic custom controls and, quite frankly, is my first attempt in writing in the C language.  I've taken good measures to make my code as clean as possible.


Properties

All of the properties for this control are listed in the following table.  Properties that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*).  For documentation of the remaining properties, see your Visual Basic Languare Reference manual or the Visual Basic Help File.

Alignment	HelpContextID	Parent
BackColor	hWnd	Selected
BorderStyle	Index	TabIndex
Columns	ItemData	TabStop
DisNoScroll	ItemForeColor	TabStops
Enabled	ItemImage	Tag
FontBold	Left	Text
FontItalic	List	Top
FontName	ListCount	TopIndex
FontSize	ListIndex	Transparent Bitmap
FontStrikeThru	MousePointer	Visible
FontUnderline	Multiselect	Width
ForeColor	Name
Height	NewIndex


Methods

All the methods supported by GT List v2.0 are listed in the table below.  The use/handling of all the listed methods below are identical to Visual Basic's List Box control. Please consult your Visual Basic Languare Reference manual for a description of these methods.

Additem	Refresh	ZOrder
Clear	RemoveItem
Move	SetFocus


Events

All the events supported by GT List v2.0 are listed in the table below.  The use/handling of all the listed events below are identical to Visual Basic's List Box control. Please consult your Visual Basic Languare Reference manual for a description of these events.

Click	KeyPress	MouseMove
DblClick	KeyUp	MouseUp
GotFocus	LostFocus
KeyDown	MouseDown


ItemForeColor
ItemForeColor Property

Description

Specifies the text color of an item in the List Box.  This property is an array of color values (Long data type) with the number of items corresponding to the number of items in the List Box.  Not available at design time, read/write at run time.

Usage

[form!]listbox.ItemForeColor(listindex)[ = color ]

Remarks

This property is useful if you want to make a List Box item stand out from the rest of the items in the List Box.  The default text color of all items in the listbox is the color specified in the List Box's ForeColor property.

See the description of the standard BackColor and ForeColor properties in the Visual Basic Languare Reference manual for an explanation of the color value.

Data Type

Long array

Example

This example sets the text color of the first item of the List Box to the Visual Basic color red.

mnFrm!tlist1.ItemForeColor(0) = QBColor(4)


ItemImage Property

Description

The ItemImage property sets the picture to be displayed ot the left of an item in the List Box.  This property is an array of integer with the number of items corresponding to the number of items in the List Box.  Not available at design time, read/write at run time.

Usage

[form!]listbox.ItemImage(listindex)[= picture]

Remarks

You can assign a value to the ItemImage property either through the use of the LoadPicture function, assigning it another control's Picture property, or using another List Box item's ItemImage property.  The ItemImage property only accepts bitmap (.BMP) type pictures.

If you plan on using the same picture for all items of the List Box, it is more memory effecient to assign a picture to the ItemImage property using another control's Picture property or alternately, you can use the LoadPicture function to assign a picture to the first item in the List Box and use that item's ItemImage property to assign the picture of subsequent item's ItemImage property (see example).

Data Type

Integer array

Example

This example assigns a picture to the first item of the List Box using the LoadPicture function and uses this item's ItemImage property to assign to all subsequent items' ItemImage property.

Sub Form_Load()

' Populate our list box with all the names of

' available screen fonts

For x = 0 To Screen.FontCount - 1

tList1.AddItem Screen.Fonts(x)

Next

' Assign a picture to the first item's ItemImage

' property

tList1.ItemImage(0) = LoadPicture("folder.bmp")

' Assign the other items' ItemImage property using

' the first item's ItemImage property

For x = 1 to tList1.ListCount

tList1.ItemImage(x) = tList1.ItemImage(0)

next

End Sub


TabStops Property

Description

The TabStops property is what GT List v2.0 is all about.  This property is an array of integer values with up to ten (10) items, numbered from 0 to 9, and whose values must be in ascending order, and are expressed in pixel measurements.  Not available at design time, read/write at run time.

Usage

[form!]listbox.TabStops(0-9)[= n]

Remarks

Using the TabStops property is useful in instances where you want to separate fields of a List Box item using the tab character Chr$(9).  Since the value of a tab stop is specified in pixel measurements, you are insured a fixed tab stop position independent of the font used by the List Box.

Data Type

Integer array


Transparent Bitmap

Description

The Transparent Bitmap property determines whether or not the background of an item's picture is drawn in the same color as the BackColor of the List Box.   Not available at design time, read/write at run time.

Usage

[form!]listbox.Transparent Bitmap[= boolean]

Remarks

If the setting of this property is True, any color matching pixel 0, 0 of the bitmap will be drawn in the same color as the current BackColor color of the List Box.  If this setting is set to False, no special drawing is done and the bitmap is drawn as is (see illustration).

The two illustrations below shows the effect of the Transparent Bitmap property given an ItemImage picture like this:

Transparent Bitmap = True	Transparent Bitmap = False
Data Type

Boolean


DisNoScroll Property

Description

The DisNoScroll property determines whether or not scrollbars are hidden if they are disabled (i.e, not needed as determined by the listbox control).   Setting this property to True keeps the scrollbars visible when disabled.  Read-only at run time.

Usage

[form!]listbox.DisNoScroll[= boolean]

Remarks

The property is not reflected until run time, that is, even if you set DisNoScroll to True at design time, the scrollbars will still not be visible.  If the Columns property is set to more than 0 (zero), GTList will remove the vertical scrollbar so it will not be visible even if the DisNoScroll property is set to True.

Data Type

Boolean


License and Copyright

The author of GT List v2.0 grants non-commercial users a free license to use this product.  If you use this product in your application and you charge money or derive income (in the Internal Revenue Service's sense of money & income) from others' or your use of your product where GT List v2.0 is a part of,  a license to use this product is granted upon the author's reciept of payment in the amount of $15.00 payable in U.S. funds.  Amount is negotiable but must be pre-arranged and pre-approved by the author,  George R. Torralba.

GT List v2.0 is Copyright © 1993 George R. Torralba.

Portions of this sotware are Copyright © Microsoft ® Corporation.


Disclaimer of Liability and Warranty

The author, George R. Torralba, will not be responsible for any damages, direct or consequential, from the use of this product.  This product does not come with any kind of warranty, express or implied.  Use it at your own risk.  For registration, bug reports, comments, suggestions  you can reach the author at:

Email:	grtorlba@seattleu.edu (preferred)

US Mail:	George R. Torralba
8728 Phinney Ave. N #8
Seattle, WA  98103

Phone:	(206) 781-7622