Copyright: Copyright 1995, MicroHelp, Inc.
Citation: Copyright 1995, MicroHelp, Inc.


Welcome

Thank you purchasing another quality programming tool from MicroHelp.

OLETools is a comprehensive collection of OLE controls for Visual Basic, Visual C++, and other applications and development environments that support OLE controls. OLETools contains over 50 OLE custom controls. Each control is available in 16-bit and 32-bit OCX versions.

VBTools 5 is the most comlete collection of VBX controls available for Visual Basic, Visual C++, and other applications and development environments that support type 1 VBXs. VBTools 5 contains 60 VBX controls.


Contacting MicroHelp

Phone

You can reach the MicroHelp offices by phone weekdays, between the hours of 9 a.m. and 5 p.m., Eastern Standard Time.

Technical Support:	(770) 516-0898

Sales and Service: 	(800) 922-3383 or (770) 516-0899

Fax

You can fax MicroHelp 24 hours a day, 7 days a week.

Fax:	(770) 516-1099

Please note that technical support questions submitted in writing to MicroHelp, whether by letter or Fax, are replied to in kind or as deemed appropriate. Please be sure to include address, phone/fax number, etc.

BBS

MicroHelp maintains a 24-hour-a-day, multi-node Bulletin Board System for Technical Support. See the Programmer’s Reference for details on using the BBS.

BBS:	(770) 516-1497

CompuServe

You can also reach MicroHelp in the MSBASIC forum on CompuServe. At the CompuServe prompt, type in GO MICROHELP. Our CompuServe address is 74774,55.

Internet / World Wide Web

You can send MicroHelp e-mail via the Internet at tech@microhelp.com. Our world wide web page can be found at http://www.microhelp.com.

Mail

You may write MicroHelp at:

MicroHelp, Inc.

4211 JVL Industrial Park Dr., NE

Marietta, GA  30066

Whenever you contact MicroHelp concerning one of our products, please have the product name, version number, and your serial number available so that we may locate your record in our customer database. Also include this information whenever you leave a message or send us correspondence to help us expedite your request.


Mh3dCombo: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	(Default) The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled. If the TextLength property is set to zero, the maximum number of characters that can be entered is 32,767. Otherwise it is limited to the value of TextLength.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextLength


Mh3dCombo: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dCombo: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control.

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3dCombo: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


Mh3dCombo: BufferSize

Description

The BufferSize property sets or returns the number of records that are buffered when the control is bound to a data control. The default value is 100. The valid range is 0 to 1000. If the control is not bound or the VirtualList property is set to False, this property is ignored. When the control is bound and virtualized the minimum number of records that will be buffered is two times the number of visible items in the list.

Syntax

ctlname.BufferSize = setting%

Data Type

Integer

Availability

Design-Time 	Run-Time Read     Run-Time Write

See Also

VirtualList


Mh3dCombo: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The valid settings for the Case property follow:

Setting	Description

0	(Default) Mixed Case; no case conversion performed.

1	Lower Case; all text is converted to lower case.

2	Upper Case; all text is converted to upper case.

Syntax

ctlname.Case = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColText


Mh3dCombo: ClearBox

Description

The ClearBox property clears the contents of the control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Design-Time 	Run-Time Read     Run-Time Write

See Also

ColText


Mh3dCombo: CloseUpReason

Description

The CloseUpReason property returns the reason the Combo Box was closed. One of the following values is returned.

Setting	Description

0	OK button was selected.

1	Cancel button was selected.

Syntax

value% = ctlname.CloseUpReason

Data Type

Integer

Availability

Run-Time Read

See Also

ColText


Mh3dCombo: Col

Description

The Col property sets or returns the column number being addressed when setting the ColAlignment, ColMultiLine, ColWidth, and other Colxxx properties. The valid range is 0 to 99 and the default value is zero.

In design mode, all three Colxxx properties are set using a dialog box. To display the dialog box, either double-click on the Col property in the properties window or click on the ellipsis (...) that appears when the Col property is selected. The values for all 30 columns can be set or viewed by pressing the Next/Previous command buttons in the dialog box.

In run mode, you must first set the Col property to the column number you want to address and then read or set the desired property.

Syntax

ctlname.Col = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColAlignment, ColMultiLine


Mh3dCombo: ColAlignment

Description

The ColAlignment property sets or returns the alignment of text within the specified column. The column affected by this control is specified by the Col property. The valid settings for the ColAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

2	Center

Syntax

ctlname.ColAlignment = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Col


Mh3dCombo: ColCharacter

Description

The ColCharacter property sets or returns the ASCII character used to separate list items into columns. The default value is 9 (Tab). The valid range is 0 to 255 (any ASCII character). This character is used as the column separator for all columns in the control. Column zero consists of all text from the first character in the list item to the first instance of ColCharacter. Column one is the text between the first and second instances of ColCharacter, etc.

Syntax

ctlname.ColCharacter = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dCombo: ColDataField

Description

The ColDataField provides the same functionality as the VB3 DataField property, but applies to an individual column within the list. While you can set this property at run time, it is easier to use the dialog box at design time by double-clicking on any of the Colxxx properties. If you will be changing the field name at run time, you must first set the Col property you want to modify and then change the ColDataField property. For example:

Mh3dList1.Col = 1

Mh3dList1.ColDataField = "Field2"

If the ColScale property is set to zero (No column settings, i.e. no columns) the DataField property will be used. Otherwise, the ColDataField property will be used to determine which fields are displayed in each column.

Syntax

ctlname.ColDataField = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col, ColScale


Mh3dCombo: ColFormat

Description

The ColFormat property sets or returns the string that can be used to format individual columns within the list. This property has the same effect and supports the same formats as the VB Format$ function. By default, this property is null, indicating no formatting is performed.

While you can change this property at run time, it is easier to use the dialog box at design time by double-clicking on any of the Colxxx properties. If you will be changing the format string at run time, you must first set the Col property you want to modify and then change the ColFormat property. For example:

Mh3dList1.Col = 1

Mh3dList1.ColFormat = "ddddd"

Syntax

ctlname.ColFormat = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dCombo: ColInstr

Description

The ColInstr property sets or returns the column number that is searched using the FindInstr property. The default value is -1, which indicates the entire string for each item is searched. Placing any other value in this property prior to using the FindInstr property limits the search to that column number for all items in the list. The valid range is -1 to the number of currently active columns - 1.

Syntax

ctlname.ColInstr = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

FindInstr


Mh3dCombo: ColList

Description

The ColList property returns the text in the current column of the specified line. You should first set the Col property to the appropriate column before checking the value of this property. This property allows you to return the data in a specific column of any item within the list. You can use the ColText property to return the data in a specific column of the currently selected line or use the ListIndex value for the array index.

Mh3dList1.Col = 3  'set to the desired column

Col$ = Mh3dList1.ColList(Mh3dList.ListCount-1)

Syntax

ctlname.ColList(element) = string$

Data Type

String Array

Availability

Run-Time Read

See Also

Col, ColText


Mh3dCombo: ColMultiLine

Description

The ColMultiLine sets or returns the multiline status of the column specified by the Col property. In design mode, this property can be set only by using the dialog box described in the Col property. In run mode, you must first set the Col property to the column number you want to address and then read or set the property.

Setting	Description

True (-1)	The text in the selected column is automatically wrapped to multiple lines. The number of lines depends on the length of the text and the width of the column.

False (0)	(Default) All the text in the selected column appears on a single line. The visible text is restricted to the width of the column.

Syntax

ctlname.ColMultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dCombo: ColScale

Description

The ColScale property sets or returns the scale used to interpret the column width settings. Depending on the font used, the width of the text can vary greatly and prevent all of the text from being visible. This property allows you to specify how the ColWidth property is interpreted. You can set it to a fixed width (Twips or Pixels) or a varying width (Average or Largest) based on the font type and size.

The valid settings for the ColScale property follow:

Setting	Description

0	(Default) No column settings. All of the text appears as an individual list item.

1	Twips

2	Average Character. The column width is based on the average character width of the selected font.

3	Pixels

4	Largest Character. The column width is based on the width of the widest character width of the selected font.

Syntax

ctlname.ColScale = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColWidth


Mh3dCombo: ColSizing

Description

The ColSizing property indicates whether the columns can be resized with the mouse at run time. If this property is set to any non-zero value, a column divider is drawn using the style specified by the DividerStyle property. The valid settings for the ColSizing property follow:

Setting	Description

0	(Default) No resizing

1	Left mouse button resizing

2	Right mouse button resizing

3	Vertical borders - no resizing

Syntax

ctlname.ColSizing = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DividerStyle


Mh3dCombo: ColText

Description

The ColText property returns the text in the specified column (determined by the Col property) of the selected line. You should first set the Col property to the appropriate column before checking the value of this property. For example:

Mh3dList1.Col = 3  'set to the desired column

SelectedCol$ = Mh3dList1.ColText

If the ListIndex value is -1 (no line selected) or the current Col is invalid, this property will be null. No errors will be generated by setting the Col property to an invalid value or reading this property when nothing in the list is selected.

Use the ColList property to obtain the data for the current column of any line within the list.

Syntax

ctlname.ColText = string$

Data Type

String

Availability

Run-Time Read

See Also

Col, ColList


Mh3dCombo: ColTitle

Description

The ColTitle property sets or returns the title for the column specified by the Col property. The default value is null, indicating no title. To change a column's title, first set the Col property to the column number you want to change. In design mode, this property can be set only by using the dialog box described in the Col property.

Syntax

ctlname.ColTitle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dCombo: ColWidth

Description

The ColWidth property sets or returns the column width, in terms of the ColScale property, for the specified column. The default value is zero. The valid range is 0 to 32,767.

To change the width of a column, you must first set the Col property to the column number you want to change. In design mode, this property can only be set using the dialog box described in the Col property.

Syntax

ctlname.ColWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col, ColScale


Mh3dCombo: DataFieldList

Description

The DataFieldList property sets or returns the field within the bound DataSourceList that will appear in the edit portion of the control. This property is identical in functionality to the standard VB3 DataField property. If the Style property is set to 2, (DropDown List), all of the fields selected in the ColDataField property will be displayed at the top of the list. If the Style property is either 0 or 1, only the field specified in the DataFieldList property will appear in the edit portion of the combo box.

The field specified in this property must also be listed in the ColDataList property. It is recommended that you use the Auto Configuration dialog to set these properties. The dialog is activated by double-clicking the left mouse button on one of the Colxxx properties.

Syntax

ctlname.DataFieldList = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColDataField


Mh3dCombo: DataSourceList

Description

The DataSourceList property specifies the data control that is used to bind the list portion of  the control to a database. This property is identical in functionality to the standard VB3 DataSource property and is used to specify the data control used to bind the list portion of the control.

Syntax

ctlname.DataSourceList = string$

Data Type

String

Availability

Design-Time

See Also

DataStyleList


Mh3dCombo: DataStyleList

Description

The DataStyleList property indicates how the list and edit portions of the combo box interact. If DataStyleList is 0 (Selection List), then the field specified in the DataFieldList property will be placed in the edit portion of the control whenever an item is selected from the list. Otherwise, the information in the list is updated each time the edit text is set into the control. Only items with the DataStyleList field content that matches the content of the edit portion of the list will be loaded. No update of the edit control will occur when an item is selected if DataStyleList is set to 1. The valid settings for the DataStyleList property follow:

Setting	Description

0	(Default) Selection List

1	Result List

Syntax

ctlname.DataStyleList = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataSourceList


Mh3dCombo: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings 3 and 4 have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCombo: DropWidth

Description

The DropWidth property sets or returns the drop-down width of the list portion of a combo box. The unit of measure for DropWidth is based on ColScale. The valid range is 0 to 32,767. When set to 0 the drop width will not change from it's previous value. If the DropWidth had never been set, it would retain the combo's default setting.

Syntax

ctlname.DropWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColScale


Mh3dCombo: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dCombo: FindInstr

Description

The FindInstr property performs a case-insensitive Instr search of the list items for the specified string. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. Unlike FindString, this property performs an Instr search, looking for the string anywhere within the list items. If the string is found, the FoundIndex property is set to the list index value of the item containing the string. If the string is not found, FoundIndex is set to -1. The position of the string within the item is not returned. You can restrict this property to search an individual column by first setting the ColInstr property.

Syntax

ctlname.FindInstr = string$

Data Type

String

Availability

Run-Time Write

See Also

FoundIndex


Mh3dCombo: FindString

Description

The FindString property  specifies a string to search for within the list. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. The comparison is made starting with the first character in each list item. To search for the string anywhere within the list items, use FindInstr.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindInstr, FoundIndex


Mh3dCombo: FocusColor

Description

The FocusColor property sets or returns the color used to indicate the focus.

Syntax

ctlname.FocusColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor, TextColor


Mh3dCombo: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCombo: FoundIndex

Description

The FoundIndex property is used in conjunction with the FindInstr and FindString properties to both set the starting index for the search and return the ListIndex value of the list item if the string is found. The valid range is -1 to ListCount - 1.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindInstr or FindString property. If the string is found, this property contains the ListIndex value of the matching list item; otherwise, FoundIndex is -1. To continue searching the items for other occurrences of the string, set the string back into the FindString or FindInstr property until the FoundIndex value is less than its starting value. For example:

'search the entire list

Dim IndexHldr%([control].ListCount)

[control].FoundIndex = -1

Do

    [control].FindString = "string to find"

    If [control].FoundIndex < IndexHldr% Then

        'no new ones were found

        Exit Do

    End If

    cntr% = cntr% + 1

    IndexHldr%(cntr%) = [control].FoundIndex

Loop

Syntax

ctlname.FoundIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

FindInstr, FindString


Mh3dCombo: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor, FocusColor


Mh3dCombo: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list. Items added to a control that has the Sorted property set to True can be placed anywhere in the list. This property returns the ListIndex position of the last item that was added in a sorted or unsorted control.

Syntax

ctlname.LastAdded = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

LastReplaced


Mh3dCombo: LastReplaced

Description

The LastReplaced property returns the element number of the last item in the list modified using the List property.

Syntax

ctlname.LastReplaced = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

LastAdded


Mh3dCombo: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dCombo: ListData

Description

The ListData property sets or returns a long integer value associated with each item in the list. The value placed in the ListData property remains associated with the list item even when its ListIndex value is changed. One use for this property is for storing the record number of the associated list item when displaying data from a file. If the data has been changed, you could use this property with the Put statement when writing the data back to the file.  For example:

Open FileName$ For Output as #1

Put #1, [control].LastData(index), [control].List(index)

Close #1

Syntax

ctlname.ListData = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write


Mh3dCombo: ListPicture

Description

The ListPicture property specifies the image displayed on the indicated line while this item is not selected. This property is normally write-only at run time. If you read the ListPicture(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero. Otherwise, an empty or unused ListPicture(index) property is returned as zero. The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is not selected. The ListPictureSel(index) image (if any) is displayed while the line is selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPicture(element) = picture

Data Type

Picture Array

Availability

Run-Time Read

Run-Time Write

See Also

ListPictureSel


Mh3dCombo: ListPictureSel

Description

The ListPictureSel property specifies the image displayed on the indicated line while this item is selected. This property is normally write-only at run time. If you read the ListPictureSel(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero. Otherwise an empty or unused ListPictureSel(index) property is returned as zero. The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is selected. The ListPicture(index) image (if any) is displayed while the line is not selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPictureSel(element) = picture

Data Type

Picture Array

Availability

Run-Time Read

Run-Time Write

See Also

ListPicture


Mh3dCombo: ListTextColor

Description

The ListTextColor property sets or returns the color used for the text in the specified line.

Syntax

ctlname.ListTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dCombo: MaxDrop

Description

The MaxDrop property sets or returns the maximum number of items that are displayed when a combo box drops down. The default value is eight. The valid range is 1 to 32,767.

The default combo box normally displays eight lines when it drops down. This property allows you to change how many items are displayed. Regardless of the value you use, the drop-down list can still be displayed either above or below the control, depending on the control's position on the parent form.

Syntax

ctlname.MaxDrop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCombo: NewItem

Description

The NewItem property returns the index of the last item added to the list. This property is exactly the same as the LastAdded property and is added for compatibility with standard controls.

Syntax

setting% = ctlname.NewItem

Data Type

Integer

Availability

Run-Time Read


Mh3dCombo: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


Mh3dCombo: PictureWidth

Description

The PictureWidth property sets or returns the width (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


Mh3dCombo: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The control is automatically refreshed anytime any item in the list changes. This is similar to the AutoRedraw property in picture-related controls.

False (0)	The control is not automatically refreshed.

If you are loading a large number of items into the list, setting ScreenUpdate to False before doing the first AddItem and then setting it back to True when complete, decreases the amount of time it takes to load the items and cuts down on the amount of flicker caused by the control being repainted.

If you set the ScreenUpdate property to False, the control is not updated and no changes are shown until this property is set to True. The Refresh method does not have any effect on a control that has the ScreenUpdate property set to False.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dCombo: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars, if needed. The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCombo: SelectedColor

Description

The SelectedColor property sets or returns the color used to indicate selected items in the list.

Syntax

ctlname.SelectedColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FocusColor, HighColor


Mh3dCombo: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dCombo: SortOrder

Description

The SortOrder property sets or returns the significance of columns when sorting items in the list. By default, this property is null, which causes the columns to be sorted in numeric order (0,1,2,3...). If the VirtualList property is set to True, this property is ignored.

Caution: Depending on the number of columns and items in the control, using this property can slow the addition of items to the list by a factor of two or more.

Syntax

ctlname.SortOrder = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VirtualList


Mh3dCombo: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCombo: TextLength

Description

The TextLength property sets or returns the maximum number of characters that may be entered into the control. The default value is zero, which indicates no length checking is performed. The valid range is 0 to 32,767. This property is identical to the VB2 MaxLength property.

Syntax

ctlname.TextLength = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dCombo: TitleBevelSize

Description

The TitleBevelSize property sets or returns the size (in twips) of the bevel or border around the outer edge of the title. The default value is zero, which means that no border is drawn around the title of the control. The valid range is 0 to 32,767. You can modify the 3-D appearance of the title by setting the TitleBevelSize property to a value greater than zero and trying different TitleBevelStyle settings.

Syntax

ctlname.TitleBevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleBevelStyle


Mh3dCombo: TitleBevelStyle

Description

The TitleBevelStyle property sets or returns the type of bevel used for the border around the outer edge of the title. If the TitleBevelSize property is zero, TitleBevelStyle is ignored and no bevel is drawn around the title. The valid settings for the TitleBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the edge of the title with the colors specified in the LightColor and ShadowColor properties. The TitleBevelxxx properties effect only the title portion of the control. If the TitleHeight property is set to -1, the TitleBevelxxx properties will be ignored.

Syntax

ctlname.TitleBevelStyle = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleBevelSize


Mh3dCombo: TitleColor

Description

The TitleColor property sets or returns the color of the text in the title portion of the control

Syntax

ctlname.TitleColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dCombo: TitleDividers

Description

The TitleDividers property indicates whether vertical dividers are drawn in the titles. The following settings are valid for the TitleDividers property.

Setting	Description

True	Dividers are drawn in the titles.

False	Dividers are not drawn in the titles.

Syntax

ctlname.TitleDividers = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCombo: TitleFontBold

Description

The TitleFontBold property indicates whether the font used for the title includes the bold attribute.

Syntax

ctlname.TitleFontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCombo: TitleFontItalic

Description

The TitleFontItalic property indicates whether the font used for the title includes the italic attribute.

Syntax

ctlname.TitleFontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCombo: TitleFontName

Description

The TitleFontName property sets or returns the name for the font used to draw the title. The title is the portion of the control that scrolls horizontally, but not vertically and is normally used for column headings.

Syntax

ctlname.TitleFontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize


Mh3dCombo: TitleFontSize

Description

The TitleFontSize property sets or returns the size of the font used to draw the title. The title is the portion of the control that scrolls horizontally, but not vertically and is normally used for column headings.

Syntax

ctlname.TitleFontSize = value!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCombo: TitleFontStrike

Description

The TitleFontStrike property indicates whether the font used for the title includes the strikethrough attribute.

Syntax

ctlname.TitleFontStrike = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCombo: TitleFontStyle

Description

The TitleFontStyle property sets or returns the 3-D effect of the text in the title portion of the control. The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When TitleFontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When TitleFontStyle is set to three or four (lowered), the outline colors are reversed. The valid settings for the TitleFontStyle property follow:

Setting	Description

0	(Default) None

1	Raised (the text appears raised off the control)

2	Raised with more shading

3	Lowered (the text appears inset into the control)

4	Lowered with more shading

Syntax

ctlname.TitleFontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCombo: TitleFontUnder

Description

The TitleFontUnder property indicates whether the font used for the title includes the underline attribute.

Syntax

ctlname.TitleFontUnder = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCombo: TitleHeight

Description

The TitleHeight property sets or returns the height of the title portion of the control. The default value is -1, which indicates that no titles will be displayed. If this property is set to zero, then the title height will be autosized according to the TitleFontxxx settings. If the value of TitleHeight is greater than zero, it is interpreted as the height of the title in pixels.

Syntax

ctlname.TitleHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize, TitleFontStyle


Mh3dCombo: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window. When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write


Mh3dCombo: VirtualList

Description

The VirtualList property indicates whether the control is virtualized. Since a database can be virtually any size, this property causes a bound control to be representative of the entire selected RecordSource within the bound database. This means that you can use the control to display all of the records within the RecordSource and the vertical scrollbar will be representative of the entire file. This property is ignored if the control is not bound to a database. The valid settings for the VirtualList property follow:

Setting	Description

True (-1)	The control is virtualized.

False (0)	(Default) The control is not virtualized.

Syntax

ctlname.VirtualList = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCombo: WallPaper

Description

The WallPaper property sets or returns the method used to display the images in ListPicture and ListPictureSel. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dCombo: CloseUp

Description

The CloseUp event occurs when the list portion of the combo box is closed. You can use this event to trigger any processing that may be required after the user has made or even canceled the selection. This event will never fire if the Style property of a Mh3dCombo control is set to 1 (Simple).

Syntax

Sub ctlname_CloseUp(Index As Integer)


Mh3dCombo: DataLoadComplete

Description

The DataLoadComplete event occurs after a bound list is initially loaded. There will be one DataLoadComplete event for each DataLoadStart event. You can use this event to load pictures into a bound list box or to signal your user that the load operation is completed.

Note:  This event will not fire while a virtual list is positioning.

Syntax

Sub ctlname_DataLoadComplete(Index As Integer)


Mh3dCombo: DataLoadStart

Description

The DataLoadStart event occurs when the list begins to load data from the data control (could be initiated by program start, Refresh, or a list refresh). You can use this event to signal your user that the load operation has started.

Note:  This event will not fire while a virtual list is positioning.

Syntax

Sub ctlname_DataLoadComplete(Index As Integer)


Mh3dCombo: Resize

Description

The Resize event occurs when a column is sized.

Syntax

Sub ctlname_Resize()


Mh3dCombo: TitleClick

Description

The TitleClick event occurs when the user clicks in the title area of the list box. This event returns the Column parameter which specifies the column the user clicked. -1 is returned when the user clicks an unused region of the title area. This event does not occur when the user clicks the list box area.

Syntax

Sub ctlname_TitleClick(Column As Integer)


Mh3dCombo: Overview

The Mh3dCombo control is an enhanced version of the standard Visual Basic combo box control. The Mh3dCombo custom control has all the functionality of the standard Visual Basic combo box and supports all of the same properties, events and methods. In addition, Mh3dCombo offers the following unique features:

-  An optional 3-D appearance, including the font used in the list portion

-  Control of all the colors used in the control

-  Multiple columns for the items in the list box portion of the control

-  The ability to search the items in the control for a string

-  The ability to force the case of all items in the list box section of the control

-  Display two different pictures for every item in the list portion of the control, one when it is selected and another when it is not

-  An optional dividing line that can be displayed between columns

-  Set the number of items that are displayed in the drop-down portion of the control

The following figure shows an example Mh3dCombo control. The following table provides an overview of the Mh3dCombo control.

Mh3dCombo Control Example.

Mh3dCombo Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhCmbo16.OCX MhCmbo32.OCX MHGCMB.VBX	Mh3dCombo	See the MH3DCMB project.		Mh3dList
Development Notes

Note: The OCX and VBX differ slightly in their design time interfaces since the OCX used property pages and the VBX uses dialogs. The differences are italicized and placed in [] immediately following the OCX equivalent.

The 3-D effect is available only for the selected lines in the list portion of the control. To obtain a 3-D appearance for the outer edge of the control, place an Mh3dCombo within an Mh3dFrame control as shown in the previous figure.

The BevelSizeInner and BevelStyleInner properties control the type and width of the 3-D effect. When BevelSizeInner is zero, the control  appears two-dimensional regardless of the other settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor. If you want the colors of the Mh3dCombo control to be the same as the default colors for the standard Visual Basic combo box, change the following color properties to the indicated value:

Color Property	Setting

BackColor 	&H80000005&

FillColor 	&H80000005&

ShadowColor	&H8000000D&

TextColor	&H80000008&

There are some problems associated with modifying the appearance of a combo box that prevent us from drawing a 3-D border around the outside of the control. This is why the Bevel properties end with Inner, indicating they effect only the inner dimensions. If the Style property is set to either zero (DropDown) or one (Simple), the 3-D shading is not drawn in the text portion of the control because editing is allowed in this area. If Style is set to three (DropDown List), the 3-D shading affects both the text and list portions of the control.

Unlike a standard Visual Basic combo box, Mh3dCombo allows you to define multiple columns in the list portion of the control, each with its own alignment, modifiable width and the ability to display multi-line text. Each column is addressed separately, allowing you to have a combination of multi-line and single-line text, with different alignments, all on the same line within the list.

Columns are created by setting the different Colxxx properties for each column you want in the control. The Col property, which is zero-based, indicates the column number. You first change the Col property to the column number you want to change and then modify the other Colxxx properties to achieve the desired effect. You use the ColCharacter property (default value is 9) to tell the control the ASCII value of the character you want to use to delimit (separate) the columns. When the control encounters the ColCharacter within a list item, the text in the line is formatted according to the properties specified for that column.

Depending on the type of font being used, the ColCharacter property may or may not be visible in the edit portion of the control. To prevent this character from appearing in the edit portion, you can either choose a character that is not displayed in the selected font, or strip the ColCharacter from the item when it is selected.

If you have a multi-column control and do not bind it to a Data Control, you can restrict the information displayed in the edit portion of the control to a single column (so you do not have the column separator appearing), by doing the following in your code:

1.  Set Col  to the column number you want displayed in the edit area of the control.

2.  Set the ColDataField and ColDataFieldList properties to the same arbitrary string value.

For example:

Mh3dCombo1.Col = 1    	'display data from column 1

Mh3dCombo1.ColDataField = "anything"       	'set to any string

Mh3dCombo1.ColDataFieldList = "anything"  	'set to same string

If the ColWidth property for a column is zero, the text in that column is not visible. This gives you the ability to hide and show text by expanding and contracting the columns.

If you bind the control to a database, you can assign fields to different columns without inserting a ColCharacter into your data. When the control is bound, it will automatically read the first 64K worth of data from the linked file. Since a file within a database can have much more than 64K worth of data, Mh3dCombo can also be virtualized.  If you set the VirtualList property to True, the control will read the number of records indicated in the BufferSize property each time it accesses the database. The vertical scrollbar will always indicate the relative position of the ListIndex relative to the entire file. In a virtualized control, the ListCount is equal to the lesser of: the value of BufferSize or the number of records in the file.

If you are going to bind a Mh3dCombo control to a database and want to use the edit portion of the control to update the linked field selected in DataField, you must do the following:

1)  The DataSource and DataSourceList properties must be linked to two different Data controls. No other controls can be linked to the DataSourceList Data Control. Since Mh3dCombo will load up to 64K of data if not virtualized or the number of records indicated by the BufferSize property if it is virtualized, you must not manipulate the Data Control that is linked to DataSourceList either in code or by binding them to other controls.

2)  The DataField and DataFieldList must be fields of the same type. While the field name does not matter, the fields selected normally would contain the same data and be the relational link between two tables.

3)  The field selected in the DataFieldList property must also be in the ColDataField property. We recommend you use the Auto Configuration [Gizmo] dialog described below to select the ColDataField properties.

4)  The Style property must be set to 0 or 1. If the Style property is set to 2 (DropDown List), you can only display the data specified in the ColDataField array. Since the control using this style does not have an edit field, no updating of a linked field can be performed.

If the control has multiple columns, the ColDataField property will be used to determine which field is displayed in each column. If the control has only a single column, then the DataField property is used. The field specified in the DataField property will be updated with the data in the edit portion of the control whenever the current record in the table linked to the DataSource property changes.

The DataStyleList property specifies the relation between the fields specified in DataField and DataFieldList. The default value 0 (Selection List) will display the fields in ColDataField() for the table linked in DataSourceList in the list portion of the control. The edit portion of the control will contain the current record for the DataField in the linked DataSource table. If you make a selection from the list, the edit portion of the control will be updated with the field specified in DataFieldList. If the current record for the Data Control specified in DataSource changes, it will be updated with the current value of the edit portion of the control.

If DataStyleList is set to 1 (Result List), then the records displayed in the list portion of the control will be restricted to those that have a value in DataFieldList equal to the current value of the DataField current record. Since the field specified in DataFieldList is used to select all of the records displayed in the list, any selection made will not change the current record of the DataSource. However, if you edit or set different text into the edit portion of the control and then update the DataSource, the selected list will change to show only records that match the DataFieldList. Simply changing the data in the edit control will not automatically generate a new result list.

If you only want to display one or more fields from a single table without the ability to update a linked table, then leave the DataSource and DataField properties blank.

In design mode, most of  the Colxxx properties are set using the Column Setup property page such as the one shown in the following figure [Column Width Settings dialog shown below]. To display the dialog box, either double-click on the Custom [ColWidth] property in the properties bar/list or click on the ellipsis (...) that appears on the properties bar/list when the Custom [ColWidth] property is selected. The values for all 100 columns can be set or viewed by pressing the < and > buttons in the property page [pressing the Next and Previous buttons in the dialog]. In run mode, you must first set the Col property to the column number you want to address and then read or set the desired property.

The Column Setup Property Page (OCX).

The Column Width Settings Dialog (VBX).

If the control is not bound to a database, the Auto Configure [Gizmo] command button and ColDataField [Data Field] combo box are disabled.

The ColDataField property is identical to the standard VB3 DataField property except that it is unique to each column within the control. If the control has multiple columns, the ColDataField property will be used to determine which field is displayed in each column. If the control has only a single column, then the DataField property is used. The ColDataField for column zero will take precedence over the setting for the DataField property.

The ColScale property applies to all columns not just the current column specified by Col. Therefore, its value will stay the same as you scroll through different values of Col. The ColScale property determines how the value of the ColWidth property is interpreted. If you want to insure that a specific number of characters is displayed in a column, you should set this property to four (Largest Character). If you want the width of the column to be fixed in size, regardless of the font or text displayed, use settings one (Twips) or three (Pixels).

Note: The control will force an Apply whenever the < or > buttons are pressed, the Insert Col or Delete Col buttons are pressed, or when you return from the Auto Configuration dialog.

You can use the property page above to set the data fields for individual columns. If you press the Auto Configure [Gizmo] command button, the Column Data Field Configuration dialog, as shown in the following figure, is loaded that displays all of the fields within the bound RecordSource.

The Column Data Field Configuration Dialog.

Each time the Column Data Field Configuration dialog loads, the Available Fields list displays all of the fields available from the RecordSource and the Selected Fields list displays all the fields currently assigned to columns. The Add All button will add all of the fields from the Available Fields listed to the Selected Fields list. The Delete All button will delete all of the fields from the Selected Fields list. You can add individual fields to be displayed by selecting the field in the Available Fields list and pressing the Add button or by double-clicking the left mouse button on the desired field. You can delete individual fields to be displayed by selecting the field in the Selected Fields list and pressing the Delete button or by double-clicking the left mouse button on the desired field. If you want to display the same field in more than one column, you must enter the column information on the property page; this cannot be done using the Column Data Field Configuration dialog.

The Titles check box will automatically assign the corresponding field names as the column titles and the Widths check box will compute a field width for each column. Both of these values can be changed for the individual columns through the Column Setup property page [Column Width dialog] or in code at run time. By default, the column width will be determined by the length of the title. If you check the Widths check box and have not set the ColScale property to a non-zero value, when you press OK in the Auto Configure [Column Width] dialog the control will set the ColScale property to a non-zero value so that the column widths will apply.

The ColSizing property enables and disables the ability to resize the columns at run time by the user. If column re-sizing is enabled, the action can be accomplished with either the left or right mouse button. When the mouse pointer is moved over a column and re-sizing is enabled, the pointer changes to a vertical line with an arrow on both sides. Re-sizing is accomplished by holding down the mouse button and dragging the pointer left or right. When the mouse button is released, the column widths are automatically adjusted.

The TitleHeight property is used to turn the titles on or off. Setting this property to -1 will turn off the tiles. When this property is set to zero, the titles are automatically sized according to the selected TitleFont properties. Any value greater than zero is interpreted as the actual title height in pixels.

To define the individual column titles, you would first set the Column property to the column number and then set the title in the ColTitle property. The easiest way to set all of the Col related properties is by using the Column Setup property page [Column Width dialog] in design mode that is described above.

The ColList and ColText properties are read-only run time properties that allow you to determine what data is within a specific column in any line within the control. The ColText property returns data for only the selected line, while ColList can be used to query any line within the control.

The ColFormat property allows you to use the same formatting properties as in the VB Format$ and can be different for each column. The formatting changes only effect how the caption is displayed, not the actual data placed in the ColDataField.

If  the AutoHScroll property is set to True, the control will allow the user to horizontally scroll through text in the edit portion of the control that exceeds the control width. When this property is set to False, the text in the edit portion of the control is fixed and any text that exceeds the width of the control will not be visible.

Whenever an item is selected, and the item contains multi-line text, the text is displayed on a single line within the edit portion of the control. If the AutoHScroll property is set to True, the user will be able to view and scroll through all of the text.

Changing the value of the ScrollBars property at run time will not have any effect and regardless of the setting of this property, the vertical scrollbar cannot be turned off when the number of items in the list exceeds the maximum height of the drop-down or list area.

If the FocusColor property is set to a color other than black (&H0), then this color will be used to indicate a control has focus instead of the standard focus rectangle  This property will override any other color when the control has focus.

The HighColor property is used to indicate items in the list that have been selected. This property will override the ListTextColor if ListTextColor is the same as TextColor. If ListTextColor has been changed, the item will remain that color even when selected.

The ListPicture() and ListPictureSel() array properties provide a mechanism whereby you can display one of two pictures on each line of the list portion of the control, corresponding to the selected and deselected states. If the PictureHeight and PictureWidth properties are left at their default values of zero, any image loaded into these properties is displayed along the entire width of the specified line and painted using the method indicated by the WallPaper property.

The FindString and FindInstr properties allow you to search all the items in the control for a specific string or portion of a string. The result of the search is returned in the FoundIndex property. You can continue your search for other instances of the string by setting FoundIndex to the element number where the search should begin. Because the search operation can wrap around to the first element and continue searching in an endless loop, the best way to determine if you have found the last matching string is to see if the returned value of FoundIndex is less than the starting value. If the Virtualized property is set to True, the FindString and FindInstr properties will search the entire linked table. With large tables this function can take a long time since the search is sequential.

If the Sorted property is TRUE, you lose control of the AddItem method of specifying the element number where a new item should be placed.

The SortOrder property allows you to specify column precedence in the sorting of the control’s data. You can specify a single column on which to sort the list, or as use as many columns that are in the control. While this is a powerful feature, the more columns used to sort, and the larger the number of items in the list, the longer it takes to add an item to the control. This property has no effect if the Sorted property is False or the VirtualList property is True.

The LastAdded property contains the element number of the last item added to the list. The LastReplaced property contains the element number of the last item that was changed by setting the List property to a string value.

You can force the case of all text displayed in the control to either upper or lower case by changing the Case property.

The ClearBox property, which is write-only at run time, acts much like a method in that setting it to any integer value clears the entire contents of the control.

The MaxDrop property allows you to set the maximum number of lines in the drop-down portion of the control. Whether the list portion drops up or down is controlled by Windows and is determined by the position of the parent window relative to the physical display area. You can also modify the width of the drop-down portion of the list with the DropWidth property.

The ColDivider property determines whether vertical lines are drawn between columns.

Caution:  Changing any of the following properties at run time will cause the control to be recreated and the contents will be lost: AutoHScroll, BevelSizeInner, FontName, FontSize, PictureHeight, PictureWidth, ScollBars, and Style.

Important:  If an Mh3dCombo box is bound, it must be the only control bound to the specified data object. A bound Mh3dCombo control tracks the current record position internally, so any other controls that are bound to the same data object will effect the positioning as well as drastically slow performance.

Note:  The MhCBoxAdd and MhCBoxClear routines in MicroHelp Muscle cannot be used with this control.

Note:  Since TopIndex was not a standard property in VB 1.0, it is marked and documented as a custom property.


Mh3dList: AdjustHeight

Description

The AdjustHeight property indicates whether or not the list box height will automatically adjust to show only complete lines. Depending on the font height and the height of the control, partial lines may be visible at the bottom of the list. If you want the control to automatically adjust the height so that only complete lines are visible, set this property to 1.

The control height is automatically adjusted when the form is loaded and whenever any property that can effect the line height is changed. While you can change this property at run time, if you change AdjustHeight from zero to 1, you must set one of the font properties (even to the same value) to force the control to be resized. For example:

Mh3dList1.AdjustHeight = 1

Mh3dList1.FontSize = Mh3dList1.FontSize

The valid settings for the AdjustHeight property follow:

Setting	Description

0	(Default) None

1	Adjust One Time

Syntax

ctlname.AdjustHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dList: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dList: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control.

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3dList: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in the Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderType


Mh3dList: BorderType

Description

The BorderType property sets or returns the type of border used for the control. The valid settings for the BorderType property follow:

Setting	Description

0	(Default) No border

1	Thin

2	Sizable

3	Thin with Caption

4	Sizable with Caption

Syntax

ctlname.BorderType = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dList: BufferSize

Description

The BufferSize property sets or returns the number of records that are buffered when the control is bound to a data control. The default value is 100. The valid range is 0 to 1000. If the control is not bound or the VirtualList property is set to False, this property is ignored. When the control is bound and virtualized the minimum number of records that will be buffered is two times the number of visible items in the list.

Syntax

ctlname.BufferSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VirtualList


Mh3dList: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The valid settings for the Case property follow:

Setting	Description

0	(Default) Mixed Case; no case conversion performed.

1	Lower Case; all text is converted to lower case.

2	Upper Case; all text is converted to upper case.

Syntax

ctlname.Case = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColText


Mh3dList: ClearBox

Description

The ClearBox property clears specific information from a control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Run-Time Write

See Also

ColText


Mh3dList: Col

Description

The Col property sets or returns the column number being addressed when setting the Colxxx properties. The valid range is 0 to 99 and the default value is zero.

In design mode, all three Colxxx properties are set using a dialog box. To display the dialog box, either double-click on the Col property in the properties window or click on the ellipsis (...) that appears when the Col property is selected. The values for all 100 columns can be set or viewed by pressing the Next/Previous command buttons in the dialog box.

In run mode, you must first set the Col property to the column number you want to address and then read or set the desired property.

Syntax

ctlname.Col = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColAlignment, ColMultiLine, ColWidth


Mh3dList: ColAlignment

Description

The ColAlignment property sets or returns the alignment of text within the specified column. The column affected by this control is specified by the Col property. The valid settings for the ColAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

2	Center

Syntax

ctlname.ColAlignment = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Col


Mh3dList: ColCharacter

Description

The ColCharacter property sets or returns the ASCII character used to separate list items into columns. The default value is 9 (Tab). The valid range is 0 to 255 (any ASCII character). This character is used as the column separator for all columns in the control. Column zero consists of all text from the first character in the list item to the first instance of ColCharacter. Column one is the text between the first and second instances of ColCharacter, etc.

Syntax

ctlname.ColCharacter = ASCIIChar%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dList: ColClicked

Description

The ColClicked property returns the number of the column which received the last click. Returns -1 if no column has been clicked by the user.

Syntax

number% = ctlname.ColClicked

Data Type

Integer

Availability

Run-Time Read

See Also

Col


Mh3dList: ColDataField

Description

The ColDataField provides the same functionality as the VB3 DataField property, but applies to an individual column within the list. While you can set this property at run time, it is easier to use the dialog box at design time by double-clicking on any of the Colxxx properties. If you will be changing the field name at run time, you must first set the Col property you want to modify and then change the ColDataField property. For example:

Mh3dList1.Col = 1

Mh3dList1.ColDataField = "Field2"

If the ColScale property is set to zero (No column settings, i.e. no columns) the DataField property will be used. Otherwise, the ColDataField property will be used to determine which fields are displayed in each column.

Syntax

ctlname.ColDataField = BoundField$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col, ColScale


Mh3dList: ColFormat

Description

The ColFormat property sets or returns the string that can be used to format individual columns within the list. This property has the same effect and supports the same formats as the VB Format$ function. By default, this property is null, indicating no formatting is performed.

While you can change this property at run time, it is easier to use the dialog box at design time by double-clicking on any of the Colxxx properties. If you will be changing the format string at run time, you must first set the Col property you want to modify and then change the ColFormat property. For example:

Mh3dList1.Col = 1

Mh3dList1.ColFormat = "ddddd"

Syntax

ctlname.ColFormat = format$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col, ColText


Mh3dList: ColInstr

Description

The ColInstr property sets or returns the column number that is searched using the FindInstr property. The default value is -1, which indicates the entire string for each item is searched. Placing any other value in this property prior to using the FindInstr property limits the search to that column number for all items in the list. The valid range is -1 to the number of currently active columns - 1.

Syntax

ctlname.ColInstr = colnumber%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

FindInstr


Mh3dList: ColList

Description

The ColList property returns the text in the current column of the specified line. You should first set the Col property to the appropriate column before checking the value of this property. This property allows you to return the data in a specific column of any item within the list. You can use the ColText property to return the data in a specific column of the currently selected line or use the ListIndex value for the array index.

Mh3dList1.Col = 3  'set to the desired column

Col$ = Mh3dList1.ColList(Mh3dList.ListCount-1)

Syntax

string$ = ctlname.ColList(arrayindex)

Data Type

String Array

Availability

Run-Time Read

See Also

Col, ColText


Mh3dList: ColMultiLine

Description

The ColMultiLine sets or returns the multiline status of the column specified by the Col property. To change the multi-line capability for a column in the control, you must first set the Col property to the column number you want to change. In design mode, this property can be set only by using the dialog box described in the Col property. In run mode, you must first set the Col property to the column number you want to address and then read or set the property.

Setting	Description

True (-1)	The text in the selected column is automatically wrapped to multiple lines. The number of lines depends on the length of the text and the width of the column.

False (0)	(Default) All the text in the selected column appears on a single line. The visible text is restricted to the width of the column.

Syntax

ctlname.ColMultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dList: ColScale

Description

The ColScale property sets or returns the scale used to interpret the column width settings. Depending on the font used, the width of the text can vary greatly and prevent all of the text from being visible. This property allows you to specify how the ColWidth property is interpreted. You can set it to a fixed width (Twips or Pixels) or a varying width (Average or Largest) based on the font type and size.

The valid settings for the ColScale property follow:

Setting	Description

0	(Default) No column settings. All of the text appears as an individual list item.

1	Twips

2	Average Character. The column width is based on the average character width of the selected font.

3	Pixels

4	Largest Character. The column width is based on the width of the widest character width of the selected font.

Note: The WrapList and ColScale properties are mutually exclusive. If ColScale is set to a non-zero value, the control will set WrapList to false and if WrapList is set to True, the control will set ColScale to 0 (None).

Syntax

ctlname.ColScale = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColWidth, WrapList


Mh3dList: ColSizing

Description

The ColSizing property indicates whether the columns can be resized with the mouse at run time. If this property is set to any non-zero value, a column divider is drawn using the style specified by the DividerStyle property. The valid settings for the ColSizing property follow:

Setting	Description

0	(Default) No resizing

1	Left mouse button resizing

2	Right mouse button resizing

3	Vertical borders - no resizing

Syntax

ctlname.ColSizing = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DividerStyle


Mh3dList: ColText

Description

The ColText property returns the text in the specified column (determined by the Col property) of the selected line. You should first set the Col property to the appropriate column before checking the value of this property. For example:

Mh3dList1.Col = 3  'set to the desired column

SelectedCol$ = Mh3dList1.ColText

If the ListIndex value is -1 (no line selected) or the current Col is invalid, this property will be null. No errors will be generated by setting the Col property to an invalid value or reading this property when nothing in the list is selected.

Use the ColList property to obtain the data for the current column of any line within the list.

Syntax

string$ = ctlname.ColText

Data Type

String

Availability

Run-Time Read

See Also

Col, ColList


Mh3dList: ColTitle

Description

The ColTitle property sets or returns the title for the column specified by the Col property. The default value is null, indicating no title. To change a column's title, first set the Col property to the column number you want to change. In design mode, this property can be set only by using the dialog box described in the Col property. In run mode, you must first set the Col property to the column number you want to address and then read or set the property.

Syntax

ctlname.ColTitle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dList: ColTitleAlignment

Description

The ColTitleAlignment property sets or returns the horizontal alignment of the column titles. When ColTitleAlignment is set to the default (-1), ColAlignment determines the alignment of the title. The valid settings for the ColTitleAlignment property follow:

Setting	Description

-1	(Default) Same as ColAlignment

0	Left

1	Right

2	Center

To read or write the alignment for a column title, first set the Col property to the column number you want to address.

Syntax

ctlname.ColTitleAlignment = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Col, ColAlignment


Mh3dList: ColTitleButtons

Description

The ColTitleButtons property indicates whether buttons are drawn in the title region of the list box. When set to True, TitleBevelSize and TitleBevelStyle are ignored. The height and width of the buttons are specified by TitleHeight and ColWidth, respectively. The valid settings for the ColTitleButtons property follow:

Setting	Description

True (-1)	Buttons are drawn in the title region of the list box

False (0)	No buttons are drawn

Syntax

ctlname.ColTitleButtons = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col


Mh3dList: ColWidth

Description

The ColWidth property sets or returns the column width, in terms of the ColScale property, for the specified column. The default value is zero. The valid range is 0 to 32,767.

To change the width of a column, you must first set the Col property to the column number you want to change. In design mode, this property can only be set using the dialog box described in the Col property. In run mode, you must first set the Col property to the column number you want to address and then read or set the property.

Syntax

ctlname.ColWidth = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Col, ColScale


Mh3dList: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings 3 and 4 have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dList: DrawItemLeft

Description

The DrawItemLeft property specifies the amount of space left (reserved) for a user-drawn item. This value is specified in the units of the container.

Syntax

ctlname.DrawItemLeft = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DrawItem, FireDrawItem


Mh3dList: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor, TextColor


Mh3dList: FindInstr

Description

The FindInstr property performs a case-insensitive Instr search of the list items for the specified string.  This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. Unlike FindString, this property performs an Instr search, looking for the string anywhere within the list items. If the string is found, the FoundIndex property is set to the list index value of the item containing the string. If the string is not found, FoundIndex is set to -1. The position of the string within the item is not returned. You can restrict this property to search an individual column by first setting the ColInstr property.

Syntax

ctlname.FindInstr = string$

Data Type

String

Availability

Run-Time Write

See Also

FoundIndex


Mh3dList: FindString

Description

The FindString property  specifies a string to search for within the list. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. The comparison is made starting with the first character in each list item. To search for the string anywhere within the list items, use FindInstr.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindInstr, FoundIndex


Mh3dList: FireDrawItem

Description

The FireDrawItem property indicates whether the DrawItem event should be fired.

Syntax

ctlname.FireDrawItem = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DrawItem, DrawItemLeft


Mh3dList: FocusColor

Description

The FocusColor property sets or returns the color used to indicate the focus.

Syntax

ctlname.FocusColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor


Mh3dList: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dList: FoundIndex

Description

The FoundIndex property is used in conjunction with the FindInstr and FindString properties to both set the starting index for the search and return the ListIndex value of the list item if the string is found. The valid range is -1 to [control].ListCount - 1.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindInstr or FindString property. If the string is found, this property contains the ListIndex value of the matching list item; otherwise, FoundIndex is -1. To continue searching the items for other occurrences of the string, set the string back into the FindString or FindInstr property until the FoundIndex value is less than its starting value. For example:

Syntax

ctlname.FoundIndex = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

FindInstr, FindString


Mh3dList: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor, FocusColor


Mh3dList: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list. Items added to a control that has the Sorted property set to True can be placed anywhere in the list. This property returns the ListIndex position of the last item that was added in a sorted or unsorted control.

Syntax

setting% =ctlname.LastAdded

Data Type

Integer

Availability

Run-Time Read

See Also

LastReplaced


Mh3dList: LastReplaced

Description

The LastReplaced property returns the element number of the last item in the list that was changed. The LastReplaced property returns the element number of the last item in the list modified using the List property.

Syntax

integer% = ctlname.LastReplaced

Data Type

Integer

Availability

Run-Time Read

See Also

LastAdded


Mh3dList: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dList: ListData

Description

The ListData property sets or returns a long integer value associated with each item in the list. The value placed in the ListData property remains associated with the list item even when its ListIndex value is changed. One use for this property is for storing the record number of the associated list item when displaying data from a file. If the data has been changed, you could use this property with the Put statement when writing the data back to the file.  For example:

Open FileName$ For Output as #1

Put #1, [control].LastData(index), [control].List(index)

Close #1

Syntax

ctlname.ListData(index) = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dList: ListDividersH

Description

The ListDividersH property sets or returns whether horizontal dividers are to be displayed in the list. When ListDividersH is set to True, the dividers are drawn in the style indicated by the DividerStyle property.

Syntax

ctlname.ListDividers = Boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DividerStyle, ListDividersV


Mh3dList: ListDividersV

Description

The ListDividersV property sets or returns whether vertical dividers are to be displayed in the list. When ListDividersV is set to True, the dividers are drawn in the style indicated by the DividerStyle property. The ColSizing property must also be set to a non-zero value for the vertical dividers to be displayed.

Syntax

ctlname.ListDividers = Boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColSizing, DividerStyle, ListDividersH


Mh3dList: ListPicOffset

Description

The ListPicOffset property sets or returns the number of pixels a picture is indented from the left. The default value is zero. The valid range is 0 to 32,767. This property is respected only if a picture is loaded on the current line.

Syntax

ctlname.ListPicOffset (ListIndex) = integer%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dList: ListPicture

Description

The ListPicture property specifies the image displayed on the indicated line while this item is not selected. This property is normally write-only at run time. If you read the ListPicture(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero. Otherwise, an empty or unused ListPicture(index) property is returned as zero. The default value is zero (no image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is not selected. The ListPictureSel(index) image (if any) is displayed while the line is selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPicture(index) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPictureSel


Mh3dList: ListPictureSel

Description

The ListPictureSel property specifies the image displayed on the indicated line while this item is selected. This property is normally write-only at run time. If you read the ListPictureSel(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero. Otherwise an empty or unused ListPictureSel(index) property is returned as zero. The default value is zero (no image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is selected. The ListPicture(index) image (if any) is displayed while the line is not selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPictureSel(index) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture


Mh3dList: ListTextColor

Description

The ListTextColor property sets or returns the color used for the text in the specified line.

Syntax

ctlname.ListTextColor(index) = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor, TextColor


Mh3dList: MultiSelect

Description

The MultiSelect property sets or returns the method used to select items in the control. The MultiSelect property cannot be used when VirtualList is True. The valid settings for the MultiSelect property follow:

Setting	Description

0	(Default) None. Single select only.

1	Simple. Multiple items can be selected, one at a time, by clicking the left mouse button on the item or pressing the space bar while the item has the focus. If an item is already selected, the same action deselects it.

2	Extended. A group of contiguous items can be selected by pressing and holding the left mouse button while dragging the mouse pointer or pressing one of the shift keys in conjunction with clicking the left mouse button. To select or deselect individual items, use Ctrl and left click.

Syntax

ctlname.MultiSelect = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Tagged, VirtualList


Mh3dList: NewItem

Description

The NewItem property returns the index of the last item added to the list. This property is exactly the same as the LastAdded property and is added for compatibility with standard controls.

Syntax

setting% = ctlname.NewItem

Data Type

Integer

Availability

Run-Time Read


Mh3dList: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


Mh3dList: PictureWidth

Description

The PictureWidth property sets or returns the width (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


Mh3dList: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The control is automatically refreshed anytime any item in the list changes. This is similar to the AutoRedraw property in picture-related controls.

False (0)	The control is not automatically refreshed.

If you are loading a large number of items into the list, setting ScreenUpdate to False before doing the first AddItem and then setting it back to True when complete, decreases the amount of time it takes to load the items and cuts down on the amount of flicker caused by the control being repainted.

If you set the ScreenUpdate property to False, the control is not updated and no changes are shown until this property is set to True. The Refresh method does not have any effect on a control that has the ScreenUpdate property set to False.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dList: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars, if needed. The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScreenUpdate


Mh3dList: SelectAll

Description

The SelectAll property is used to select all of the items in the list. To select all of the items in the list, simply set the property to any non-zero integer value. The MultiSelect property must be set to either 1 (Simple) or 2 (Extended) to use this property.

Syntax

ctlname.SelectAll = setting%

Data Type

Integer

Availability

Run-Time Write

See Also

MultiSelect


Mh3dList: SelectedColor

Description

The SelectedColor property sets or returns the color used to indicate selected items in the list. This property is needed primarily when MultiSelect is set to either 1 or 2.

Syntax

ctlname.SelectedColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FocusColor, HighColor, TextColor


Mh3dList: SelectedCount

Description

The SelectedCount property returns the number of elements in the Tagged array that are currently selected (set to True). If the control's MultiSelect property is enabled (not zero), SelectedCount tells you how many elements in the control have been selected, without having to examine each element of the Tagged array.

Syntax

value% = ctlname.SelectedCount

Data Type

Integer

Availability

Run-Time Read

See Also

MultiSelect, Tagged


Mh3dList: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dList: SortOrder

Description

The SortOrder property sets or returns the significance of columns when sorting items in the list. By default, this property is null, which causes the columns to be sorted in numeric order (0,1,2,3...). If the VirtualList property is set to True, this property is ignored.

Caution: Depending on the number of columns and items in the control, using this property can slow the addition of items to the list by a factor of two or more.

Syntax

ctlname.SortOrder = sortstring$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VirtualList


Mh3dList: Tagged

Description

The Tagged property indicates whether the specified element is currently selected. Each element in the Tagged array corresponds to a ListIndex item in the control. The valid settings for the Tagged property follow:

Setting	Description

True (-1)	The element is selected.

False (0)	The element is not currently selected.

Setting this value from code at run time fires the control's Click event. If you have code in the Click event that can cause this same event to be fired, make sure you include a check to prevent recursion. If recursion occurs, your program may fail with an Out of Stack Space error.

To determine which elements in the control are selected, create a For/Next loop that examines each element of this array.  For example:

For i = 0 to [control].ListCount - 1

If [control].Tagged(i) Then

'This element is selected- save the element number or

'do your processing

End If

Next

Syntax

ctlname.Tagged(element%) = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

MulitSelect


Mh3dList: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dList: TitleBevelSize

Description

The TitleBevelSize property sets or returns the size (in twips) of the bevel or border around the outer edge of the title. The default value is zero, which means that no border is drawn around the title of the control. The valid range is 0 to 32,767. You can modify the 3-D appearance of the title by setting the TitleBevelSize property to a value greater than zero and trying different TitleBevelStyle settings.

Syntax

ctlname.TitleBevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleBevelStyle


Mh3dList: TitleBevelStyle

Description

The TitleBevelStyle property sets or returns the type of bevel used for the border around the outer edge of the title. If the TitleBevelSize property is zero, TitleBevelStyle is ignored and no bevel is drawn around the title. The valid settings for the TitleBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the edge of the title with the colors specified in the LightColor and ShadowColor properties. The TitleBevelxxx properties effect only the title portion of the control. If the TitleHeight property is set to -1, the TitleBevelxxx properties will be ignored.

Syntax

ctlname.TitleBevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleBevelSize


Mh3dList: TitleColor

Description

The TitleColor property sets or returns the color of the text in the title portion of the control.

Syntax

ctlname.TitleColor = colorvalue$

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dList: TitleDividers

Description

The TitleDividers property indicates whether vertical dividers are drawn in the title area of the control. This property is independent of the vertical dividers which may be drawn in the list box area. The valid settings for the TitleDividers property follow:

Setting	Description

False (0)	Do not draw dividers

True (-1)	Draw dividers using the setting in DividerStyle.

Syntax

ctlname.TitleDividers = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DividerStyle


Mh3dList: TitleFillColor

Description

The TitleFillColor property sets or returns the fill color used in the title area.

Syntax

ctlname.TitleFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor, TextColor


Mh3dList: TitleFontBold

Description

The TitleFontBold property indicates whether the font used for the title includes the bold attribute.

Syntax

ctlname.TitleFontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontItalic, TitleFontStrike, TitleFontUnder


Mh3dList: TitleFontItalic

Description

The TitleFontItalic property indicates whether the font used for the title includes the italic attribute.

Syntax

ctlname.TitleFontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontStrike, TitleFontUnder


Mh3dList: TitleFontName

Description

The TitleFontName property sets or returns the name for the font used to draw the title. The title is the portion of the control that scrolls horizontally, but not vertically and is normally used for column headings.

Syntax

ctlname.TitleFontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize


Mh3dList: TitleFontSize

Description

The TitleFontSize property sets or returns the size of the font used to draw the title. The title is the portion of the control that scrolls horizontally, but not vertically and is normally used for column headings.

Syntax

ctlname.TitleFontSize = size!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dList: TitleFontStrike

Description

The TitleFontStrike property indicates whether the font used for the title includes the strikethrough attribute.

Syntax

ctlname.TitleFontStrike = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontItalic, TitleFontUnder


Mh3dList: TitleFontStyle

Description

The TitleFontStyle property sets or returns the 3-D effect of the text in the title portion of the control. The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When TitleFontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When TitleFontStyle is set to three or four (lowered), the outline colors are reversed. The valid settings for the TitleFontStyle property follow:

Setting	Description

0	(Default) None

1	Raised (the text appears raised off the control)

2	Raised with more shading

3	Lowered (the text appears inset into the control)

4	Lowered with more shading

Syntax

ctlname.TitleFontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dList: TitleFontUnder

Description

The TitleFontUnder property indicates whether the font used for the title includes the underline attribute.

Syntax

ctlname.TitleFontUnder = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontItalic, TitleFontStrike


Mh3dList: TitleHeight

Description

The TitleHeight property sets or returns the height of the title portion of the control. The default value is -1, which indicates that no titles will be displayed. If this property is set to zero, then the title height will be autosized according to the TitleFontxxx settings. If the value of TitleHeight is greater than zero, it is interpreted as the height of the title in pixels.

Syntax

ctlname.TitleHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize, TitleFontStyle


Mh3dList: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window. When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write


Mh3dList: Transparent

Description

The Transparent property indicates whether the bitmaps within the control are transparent. If you are using pictures in Mh3dList, you can use the highlight bar to fill in around the bitmap instead of having the picture appear in a white square. To do this, modify the background or surrounding area of your bitmap to use a unique color, then set the TransparentColor value to this color and the Transparent property to True. The valid settings for the Transparent property follow:

Setting	Description

True (-1)	The bitmap will be drawn so the background or current fill color will show through those portions of the bitmap that contain the TransparentColor.

False (0)	(Default) The bitmap will be drawn with its true color

Syntax

ctlname.Transparent = boolean%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TransparentColor


Mh3dList: TransparentColor

Description

The TransparentColor property sets or returns the color that will be replaced by the fill color in bitmaps that are drawn with transparent portions. The default value is black (&H0). This property is ignored unless the Transparent property is set to True. The fill color that will be used in place of this color will be the current fill color (FillColor or SelectedColor).

Syntax

ctlname.TransparentColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Transparent


Mh3dList: VirtualList

Description

The VirtualList property indicates whether the control is virtualized. Since a database can be virtually any size, this property causes a bound control to be representative of the entire selected RecordSource within the bound database. This means that you can use the control to display all of the records within the RecordSource and the vertical scrollbar will be representative of the entire file. This property is ignored if the control is not bound to a database. The valid settings for the VirtualList property follow:

Setting	Description

True (-1)	The control is virtualized.

False (0)	(Default) The control is not virtualized.

Syntax

ctlname.VirtualList = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dList: WallPaper

Description

The WallPaper property sets or returns the method used to display the images in ListPicture and ListPictureSel. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as 	many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dList: WrapList

Description

The WrapList property indicates whether the control displays the contents in multiple columns. The valid settings for the WrapList property follow:

Setting	Description

True (-1)	All items in the list are displayed in a manner similar to the files in the Windows File Manager. A horizontal scrollbar is automatically added (if needed), but the control cannot be scrolled vertically.

False (0)	(Default) The control respects the ScrollBars property and every added item is placed on a separate line.

Caution:  Changing this property at run time causes the contents of the control to be lost. Since the control must be re-created to set this style bit, the original control is destroyed and then re-created.

Caution:  Using multiple columns in conjunction with the WrapList property set to True in an Mh3dList control will produce drawing problems.

Do not confuse this property with creating multiple columns in a list using a delineating character. Setting this property to True causes the items in the list to appear as though they are concatenated when the number exceeds the height of the control. The text in the List items remains unchanged, only the manner in which they are displayed is modified.

Note: The WrapList and ColScale properties are mutually exclusive. If ColScale is set to a non-zero value, the control will set WrapList to false and if WrapList is set to True, the control will set ColScale to 0 (None).

Syntax

ctlname.WrapList = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColScale, ScrollBars, WrapWidth


Mh3dList: WrapWidth

Description

The WrapWidth property sets or returns the column width to use when the WrapList property is set to True. This property is measured in pixels. The default value is zero. The valid range is 0 to 32,767.

If WrapWidth is zero, the column width is set to accommodate the widest item in the list. If WrapList is False, this property is ignored.

Syntax

ctlname.WrapWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColScale, WrapList


Mh3dList: ColumnReSize

Description

The ColumnReSize event occurs after a column has been resized at run-time. The number of the column resized is provided in the Column parameter.

Syntax

Sub ctlname_ColumnReSize(Column As Integer)


Mh3dList: DataLoadComplete

Description

The DataLoadComplete event occurs after a bound list is initially loaded and after a refresh operation. There will be one DataLoadComplete event for each DataLoadStart event. You can use this event to load pictures into a bound list box or to signal your user that the load operation is completed.

Note:  This event will not fire while a virtual list is positioning.

Syntax

Sub ctlname_DataLoadComplete(Index As Integer)


Mh3dList: DataLoadStart

Description

The DataLoadStart event occurs when the list begins to load data from the data control (could be initiated by program start, Refresh, or a list refresh). You can use this event to signal your user that the load operation has started.

Note:  This event will not fire while a virtual list is positioning.

Syntax

Sub ctlname_DataLoadComplete(Index As Integer)


Mh3dList: DrawItem

Description

The DrawItem event occurs each time the control finishes drawing an item in the list. This event will only fire if the FireDrawItem property is set to True.

The parameters provided by the event are as follows:

Parameter	Description

itemIndex	The index number of the item in the list.

itemState	The state of the item is specified by a combination of the following values:

     0	Item not selected

     1	Item is selected

     2	Item is grayed.

     4	Item is to be drawn disabled.

     16	Item has focus.

itemhDC	The handle to the device context of the list.

ItemLeft	The left coordinate of the list item.

ItemTop	The top coordinate of the list item.

ItemRight	The right coordinate of the list item.

ItemBottom	The bottom coordinate of the list item.

Syntax

Sub ctlname_DrawItem (itemIndex As Integer, itemState As Integer, itemhDC As Integer, itemLeft As Integer, itemTop As Integer, itemRight As Integer, itemBottom As Integer)

See Also

DrawItemLeft, FireDrawItem


Mh3dList: TitleClick

Description

The TitleClick event occurs when the user clicks in the title area of the list box. This event returns the Column parameter which specifies the column (or button when ColTitleButtons is True) the user clicked. -1 is returned when the user clicks an unused region of the title area. This event does not occur when the user clicks the list box area.

Syntax

Sub ctlname_TitleClick(Column As Integer)


Mh3dList: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position.

Syntax

Sub ctlname_TopIndexChange()


Mh3dList: Overview

The Mh3dList control is an enhanced version of the standard Visual Basic list box control. The Mh3dList custom control has all the functionality of the standard Visual Basic list box control, with a number of added features including:

-  An optional 3-D appearance, including the font used for the items in the list

-  Control of all the colors used in the control

-  The ability to create multiple columns, each with a unique width, alignment and the ability to be resized at run-time

-  The ability to search the items in the control for a string

-  The ability to force the case of all items in the list box section of the control

-  Display two different pictures for every item in the list: one when it is selected and another when it is not selected

One of the most unique features in this control is the ability to have multiple columns that can be either fixed in width or set to allow the user to adjust the width at run time. You can even have scrolling titles with a separate heading for each column.

The following figure shows an example Mh3dList control. The following table provides an overview of the Mh3dList control.

Mh3dList Control Example.

Mh3dList Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhList16.OCX MhList32.OCX MHGLBX.VBX	Mh3dList	See the MHLIST sample directory.		Mh3dCombo
Development Notes

Like the Mh3dCombo control, the bevel cannot be drawn around the border of the list box. To create a 3-D border around the edge of the control, place the Mh3dList control within an Mh3dFrame control.

Columns are created by setting the different Colxxx properties for each column you want in the control. The Col property, which is zero-based, indicates the column number. You first change the Col property to the column number you want to change and then modify the other Colxxx properties to achieve the desired effect. You use the ColCharacter property (default value is 9) to indicate the ASCII value of the character you want to use to delimit (separate) the columns. When the control encounters the ColCharacter within a list item, the text in the line is formatted according to the properties specified for that column. For example,

Mh3dList1.AddItem  “This is Column 0” & CHR$(9) & “This is Column 1”

If you bind the control to a database, you can assign fields to different columns without inserting a ColCharacter into your data. When the control is bound, it will automatically read the first 64K worth of data from the linked file. Since a file within a database can have much more than 64K worth of data, Mh3dList can also be virtualized.  If you set the VirtualList property to True, the control will read the number of records indicated in the BufferSize property each time it accesses the database. The vertical scrollbar will always indicate the relative position of the ListIndex relative to the entire file. In a virtualized control, ListCount is equal to the lesser of the value of BufferSize or the number of records in the file.

When setting the RecordSource of a data control at run-time it might be necessary to use a DoEvents() after Data.Refresh if you want to use information from the list immediately. Otherwise, the list might not update. For example:

Data1.RecordSource = sql$

Data1.Refresh

Print Mh3dList1.RecordCount

might give incorrect results because the list is not updated. Using a DoEvents() right after the Refresh will allow the results to be accurate.

A bound Mh3dList control can only be used to browse the linked table. It cannot be used to update the data. While you can use the AddItem and RemoveItem methods to add and remove data to the list, these changes will not be reflected in the linked table.

While the ASCII character selected for the ColCharacter is not displayed in the control, it is returned as part of the ListItem. You may want to write a sub-routine with an Instr search to extract this character from the strings or use the MhReplace function in MicroHelp Muscle. We leave the ColCharacter in the ListItem so you can still determine where your column separators are located.

If the ColWidth property for a column is zero, the text in that column is not visible. This gives you the ability to hide and show text by expanding and contracting the columns.

In design mode, most of the Colxxx properties are set using the Column Setup property page shown in the following figure [Column Width Settings dialog shown below]. To display the property page, either double-click on the Custom [ColWidth] property in the properties bar/list or click on the ellipsis (...) that appears on the properties bar/list when the Custom [ColWidth] property is selected. The values for all 100 columns can be set or viewed by pressing the < and > buttons in the property page [pressing the Next and Previous buttons in the dialog]. In run mode, you must first set the Col property to the column number you want to address and then read or set the desired property.

The Column Setup Property Page.

The Column Width Settings Dialog (VBX).

If the control is not bound to a database, the Auto Configure [Gizmo] command button and ColDataField [Data Field] combo box are disabled.

The ColDataField property is identical to the standard VB3 DataField property except that it is unique to each column within the control. If the control has multiple columns, the ColDataField property will be used to determine which field is displayed in each column. If the control has only a single column, then the DataField property is used. The ColDataField for column zero will take precedence over the setting for the DataField property.

The ColScale property applies to all columns not just the current column specified by Col. Therefore, its value will stay the same as you scroll through different values of Col. The ColScale property determines how the value of the ColWidth property is interpreted. If you want to insure that a specific number of characters will be displayed in a column, you should set this property to 4 (Largest Character). If you want the width of the column to be fixed in size, regardless of the font or text displayed, use settings one (Twips) or three (Pixels).

You can use the property page in the previous figure to set the data fields for individual columns. If you press the Auto Configure [Gizmo] command button, the Column Data Field Configuration dialog, shown in the following figure, is loaded that displays all of the fields within the bound RecordSource.

The Column Data Field Configuration Dialog.

Each time the Column Data Field Configuration dialog loads, the Available Fields list displays all of the fields available from the RecordSource and the Selected Fields list displays all the fields currently assigned to columns. The Add All button will add all of the fields from the Available Fields listed to the Selected Fields list. The Delete All button will delete all of the fields from the Selected Fields list. You can add individual fields to be displayed by selecting the field in the Available Fields list and pressing the Add button or by double-clicking the left mouse button on the desired field. You can delete individual fields to be displayed by selecting the field in the Selected Fields list and pressing the Delete button or by double-clicking the left mouse button on the desired field. If you want to display the same field in more than one column, you must enter the column information on the property page; this cannot be done using the Column Data Field Configuration dialog.

The Titles check box will automatically assign the corresponding field names as the column titles and the Widths check box will compute a field width for each column. Both of these values can be changed for the individual columns through the Column Setup property page [Column Width dialog] or in code at run time. By default, the column width will be determined by the length of the title. If you check the Widths check box and have not set the ColScale property to a non-zero value, when you press OK in the Auto Configure [Column Width] dialog the control will set the ColScale property to a non-zero value so that the column widths will apply.

The ColSizing property enables and disables the ability to resize the columns at run time by the user. If column re-sizing is enabled, the action can be accomplished with either the left or right mouse button (depending on the setting of ColSizing). When the mouse pointer is moved over a column and re-sizing is enabled, the pointer changes to a vertical line with an arrow on both sides. Re-sizing is accomplished by holding down the mouse button and dragging the pointer left or right. When the mouse button is released, the column widths are automatically adjusted.

The TitleHeight property is used to turn the titles on or off. Setting this property to -1 will turn off the titles. When this property is set to zero, the titles are automatically sized according to the selected TitleFont properties. Any value greater than zero is interpreted as the actual title height in pixels.

To define the individual column titles, you would first set the Col property to the column number and then set the title in the ColTitle property. The easiest way to set all of the Col related properties is by using the Column Setup property page [Column Width dialog]in design mode that is described above.

The ColList and ColText properties are read-only run time properties that allow you to determine what data is within a specific column in any line within the control. The ColText property returns data for only the selected line, while ColList can be used to query any line within the control.

The ColFormat property allows you to use the same formatting properties as in the VB Format$ and can be different for each column. The formatting changes only effect how the caption is displayed, not the actual data placed in the ColDataField.

The ListPicture and ListPictureSel properties are arrays that allow you to have a different image for the selected and unselected states displayed on each line of the list portion of the control. If the PictureHeight and PictureWidth properties are zero, any image loaded into these properties is displayed along the entire width of the specified line and painted using the method specified by the WallPaper property.

The BevelSizeInner and BevelStyleInner properties control the type and width of the 3-D effect. When BevelSizeInner is zero, the control  appears two-dimensional regardless of the other settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor.

If you want the colors of the Mh3dList control to be the same as the default colors for the standard VB list box, change the following color properties to the indicated value:

Property 	Color Value

BackColor 	&H80000005&

FillColor 	&H80000005&

ShadowColor	&H8000000D&

TextColor	&H80000008&

The BorderType property allows you create a control that has one of five different borders: None, Thin, Sizable, Thin with Caption, and Sizable with Caption. If you choose a border type that has a visible caption, any string placed into the Caption property is displayed at the top of the control. Otherwise, the Caption property is ignored.

If the Sorted property is TRUE, you lose control of the AddItem method of specifying the element number where a new item should be placed. Changing the value of the Sorted property at run time will also cause the list to be recreated and all current items will be lost.

The SortOrder property indicates how items are sorted as they are added to the control. Setting the SortOrder property does not change the order of the items in the control. You can change the order of the items in the control by saving the items in the control to an array, clearing the control, setting SortOrder, then adding the items back into the control. This property has no effect if the Sorted property is False or the VirtualList property is True.

The LastAdded property contains the element number of the last item added to the list, while the LastReplaced property contains the element number of the last item that was changed by setting the List property to a string value.

The FindString and FindInstr properties allow you to search all the items in the control for a specific string or portion of a string. The result of the search is returned in the FoundIndex property. You can continue your search for other instances of the string by setting FoundIndex to the element number where the search should begin. Because the search operation can wrap around to the first element and continue searching in an endless loop, the best way to determine if you have found the last matching string is to see if the returned value of FoundIndex is less than the starting value. If the Mh3dList control is virtualized, the record number placed into the FoundIndex property is not the ListIndex value, but the record number based on the current index of the loaded data set.

The ColInstr property allows you to limit the search to a specific column within each item. By default, the ColInstr property is set to -1, which indicates that the entire string is searched. Any other value limits the search to the specified column number. This property can only be used in conjunction with the FindInstr property.

Unlike the standard VB 1.0 control, Mh3dList allows you to select multiple items, using either the simple or extended select methods. If MultiSelect is enabled, the SelectedCount property returns the number of items currently selected. To determine which items have been selected requires that you examine the Tagged() array property, which is a zero-based integer array with the same number of elements as the control. If an item in Mh3dList is selected, the corresponding element in the Tagged() array is set to -1; Otherwise, it is zero. The Tagged() array works in the same manner as the VB 2.0 Selected property.

If MultiSelect is set to either 1 (Simple) or 2 (Extended), you may want to set the FocusColor and SelectedColor properties to different colors. This allows you to differentiate when the control has focus, even when items have been selected. Changing the value of the MultiSelect property at run time will cause the list to be recreated and all current items will be lost.

The ClearBox property, which is write-only at run time, acts much like a method in that setting it to any integer value clears the contents of the control. This property has the same functionality as the VB 2.0 Clear method. You can select all of the items in the list by setting the SelectAll property to any non-zero value.

The standard VB list box automatically resizes the height of the control based upon the current font settings. By default, Mh3dList does not automatically adjust the height of the control, which means you can have a partial line visible at the bottom of the control. If you want the Mh3dList to automatically resize the control's height based on the font settings, set the AdjustHeight property to 1.

There are four properties that can control the color of items in the list box: ListTextColor, TextColor, HighColor, and FocusColor.

The TextColor property is used to set the ListTextColor when an item is added to the list. The TextColor is never used when the item is displayed -- only when it is added. If you change TextColor while adding items to the list the new items use this color while all existing items will retain the colors in effect when they were added.

If the FocusColor property is set to a color other than black (&H0), then this color will be used to indicate a control has focus instead of the standard focus rectangle. This property will override any other color when the control has focus. The HighColor is used to indicate items in the list that have been selected. This property will override the ListTextColor if ListTextColor is the same as TextColor. If ListTextColor has been changed, the item will remain that color even when selected.

You can force the case of all text displayed in this control to either upper or lower case by changing the Case property.

The ScreenUpdate property, when set to FALSE, prevents the contents of the control from being updated or refreshed until this property is TRUE.

The ScrollBars property allows you to enable and disable the vertical and horizontal scroll bars. Changing ScrollBars at run time causes the list to be recreated and all current items will be lost.

Setting certain properties in the Form_Load event may cause the list control to become invisible (MultiSelect is one that will cause this). There are two solutions:

1.  Do a Form.Show before setting the properties

2.  Set the list's Visible property to true after setting the properties that affect the visibility of the control.

Important:  If an Mh3dList box is bound, it must be the only control bound to the specified data object. A bound Mh3dList control tracks the current record position, so other controls that are bound to the same data object will effect the positioning as well as drastically slow performance.

Important:  You can't use pictures if VirtualList is True. If the list is bound but not virtualized, you can use pictures, in which case you should use the DataLoadComplete event to load them, because if the list (or data control) is refreshed the pictures are lost. When the refresh occurs, the DataLoadComplete event is fired (after loading is completed) and you can re-load the pictures.

Caution:  The MhLBoxAdd and MhLBoxClear routines in Muscle cannot be used with this control. Any attempts to use those routines with an owner-draw list box will result in a GPF.


MhFileDisplay: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhFileDisplay: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhFileDisplay: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhFileDisplay: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhFileDisplay: BottomLineNumber

Description

The BottomLineNumber property sets or returns the line number of the last line within the file that is  displayed in the control.

Syntax

ctlname.BottomLineNumber = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write

See Also

TopLineNumber


MhFileDisplay: ExpandTabs

Description

The ExpandTabs property sets or returns the number of characters to display in place of tab characters contained in the file. The default value is zero.

Syntax

ctlname.ExpandTabs = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileName


MhFileDisplay: FileName

Description

The FileName property sets or returns the name of the file to display.

Syntax

ctlname.FileName = string$

Data Type

String

Availability

Run-Time Read

Run-Time Write

See Also

ExpandTabs


MhFileDisplay: FillColor

Description

The FillColor property sets or returns the control's background color

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor, LightColor, ShadowColor


MhFileDisplay: FindCase

Description

The FindCase property sets or returns the type of search that is performed when using the FindString or SearchDialog properties. The valid settings for the FindCase property follow:

Setting	Description

0	(Default) Case-insensitive search.

1	Case-sensitive search.

Syntax

ctlname.FindCase = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FindString, SearchDialog


MhFileDisplay: FindLimit

Description

The FindLimit property sets or returns the maximum offset within the file to search for a string when using the FindString or SearchDialog properties. When FindLimit is greater than zero, the control will not search beyond that character to find an item. The default value is zero (search to the end of the file).

Syntax

ctlname.FindLimit = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FindString, SearchDialog


MhFileDisplay: FindString

Description

The FindString property specifies a string to search for within the file. When the FindString property is set, the search begins at the SelStart position and continues to the end of the file, or the offset specified in the FindLimit property (if greater than zero). If the search is successful, the text is highlighted within the window and the LineNumber, SelStart, SelLength and SelText properties are set accordingly. Note that you can also use the SearchDialog property to perform a search, allowing the user to specify the search string in a Find dialog box.

The SearchRequest and SearchComplete events occur whenever a search begins or ends. These events allow to you verify or change the starting position before a search, or evaluate the results of a search.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindLimit, SearchDialog


MhFileDisplay: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhFileDisplay: LineNumber

Description

The LineNumber property returns the line number within the file that contains the SelStart character.

Syntax

setting& =ctlname.LineNumber

Data Type

Long Integer

Availability

Run-Time

See Also

MaxLine, MinLine


MhFileDisplay: MaxLine

Description

The MaxLine property sets or returns the maximum line number of the file to display within the control. The default MaxLine setting is zero (no limit).

Syntax

ctlname.MaxLine = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinLine


MhFileDisplay: MinLine

Description

The MinLine property sets or returns the minimum line number of the file to display within the control. The default MinLine setting is one.

Syntax

ctlname.MinLine = setting&

Data Type

Long  Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxLine


MhFileDisplay: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars, if needed. The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileName


MhFileDisplay: SearchDialog

Description

The SearchDialog property displays a Find dialog box that allows the user to specify a search string at run time. When the SearchDialog property is set, its value (even if a null string) becomes the default text string in the Find dialog. When the user selects the Find button in the Find dialog, the search begins at the SelStart position and continues to the end of the file or the offset specified in the FindLimit property (if greater than zero). If the search is successful, the text is highlighted within the window and the LineNumber, SelStart, SelLength and SelText properties are set accordingly.

The SearchRequest and SearchComplete events occur whenever a search begins or ends. These events allow to you verify or change the starting position before a search, or evaluate the results of a search.

Use the SearchHelp property to specify whether you want a Help button to appear on the Find dialog. To perform searches without displaying a Find dialog, use the FindString property.

Syntax

ctlname.SearchDialog = string$

Data Type

String

Availability

Run-Time Write

See Also

SearchHelp


MhFileDisplay: SearchHelp

Description

The SearchHelp property indicates whether a Help button appears in the Find dialog when performing a search with the SearchDialog property. When the users pressed the Help button, the SearchHelp event is fired. The valid settings for the SearchHelp property follow:

Setting	Description

True (-1)	The Help button is displayed in the Find dialog.

False (0)	(Default) The Help button is not displayed in the Find dialog.

Syntax

ctlname.SearchHelp = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SearchDialog


MhFileDisplay: SelText

Description

The SelText property returns a string containing the currently selected text, or a null string if nothing is selected.

Syntax

string$ = ctlname.SelText

Data Type

String

Availability

Run-Time Read

See Also

FindString


MhFileDisplay: SetRedraw

Description

The SetRedraw property sets or returns whether drawing is enabled for the control. The valid settings for the SetRedraw property follow:

Setting	Description

True (-1)	(Default) Drawing is enabled for the control.

False (0)	Drawing is disabled for the control.

Syntax

ctlname.SetRedraw = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScrollBars


MhFileDisplay: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhFileDisplay: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhFileDisplay: TopByteOffset

Description

The TopByteOffset property sets or returns the byte offset within the file that is displayed at the top of the control. To determine the line number of the first line displayed in the control, use the TopLineNumber property.

Syntax

ctlname.TopByteOffset = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write

See Also

TopLineNumber


MhFileDisplay: TopLineNumber

Description

The TopLineNumber property sets or returns the line number within the file that is displayed at the top of the control. To determine the actual byte offset of the first line displayed in the control, use the TopByteOffset property.

Syntax

ctlname.TopLineNumber = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write

See Also

BottomLineNumber, TopByteOffset


MhFileDisplay: TotalBytes

Description

The TotalBytes property returns the total number of bytes contained in the file being displayed. To determine the total number of lines in the file, use the TotalLines property.

Syntax

ctlname.TotalBytes = setting&

Data Type

Long Integer

Availability

Run-Time Read

See Also

TotalLines


MhFileDisplay: TotalLines

Description

The TotalLines property returns the total number of lines contained in the file being displayed. To determine the total number of bytes in the file, use the TotalBytes property.

Syntax

ctlname.Totalines = setting&

Data Type

Long Integer

Availability

Run-Time Read

See Also

TotalBytes


MhFileDisplay: LoadComplete

Description

The LoadComplete event occurs when the control is finished loading the file.

Syntax

Sub ctlname_LoadComplete()

See Also

LoadStart


MhFileDisplay: LoadStart

Description

The LoadStart event occurs just before the control starts loading the file.

Syntax

Sub ctlname_LoadStart()

See Also

LoadComplete


MhFileDisplay: SearchComplete

Description

The SearchComplete event occurs when a search is complete.

A search may be initiated with the FindString or SearchDialog properties, or when the user presses the Find Next button in the Find dialog. By placing code in the SearchComplete event, you can evaluate the results of each search, as shown below:

Sub MhFileDisplay1_SearchComplete ()

  If MhFileDisplay1.SelLength = 0 Then

    MsgBox "Sorry, no match was found."

  Else

    Matches = Matches + 1 ' Count matches

  End If

End Sub

Use the SelLength property to determine the outcome of each search. If SelLength is zero, the text string was not found.

Syntax

Sub ctlname_SearchComplete()


MhFileDisplay: SearchHelp

Description

The SearchHelp event occurs when the user presses the Help button in the Find dialog.

The SearchHelp event only occurs when the SearchHelp property is set to True. The Find dialog is invoked by setting the SearchDialog property.

Syntax

Sub ctlname_SearchHelp()


MhFileDisplay: SearchRequest

Description

The SearchRequest event occurs when a search is initiated with the FindString or SearchDialog properties, or when the user presses the Find Next button in the Find dialog.

Since this event occurs whenever a search is performed, you can place code within the event to ensure that the search is starting in the desired location.

For example:

Sub MhFileDisplay1_SearchRequest()

  If MhFileDisplay1.SelStart Then

    ' Starting search *after* the currently

    ' selected text, which in this case may be

    ' the result of a previous search

    x = MhFileDisplay1.SelStart

    y = MhFileDisplay1.SelLength

    MhFileDisplay1.SelStart = x + y

    MhFileDisplay1.SelLength = 0

  End If

End Sub

Syntax

Sub ctlname_SearchRequest()


MhFileDisplay: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position.

Use the TopLineNumber or TopByteOffset properties to determine the new line number or byte offset displayed at the top of the control.

Syntax

Sub ctlname_TopIndexChange()


MhFileDisplay: Overview

The MhFileDisplay control is a high-performance file viewer that allows you to display and browse any ASCII text file, regardless of size. The MhFileDisplay control has many useful features to give your programs superb file-viewing capabilities:

-  Extremely fast scrolling with the ability to move instantly to any location in the file.

-  Highlight a portion of the file with the mouse and retrieve the text contained in the selection.

-  A built-in search feature with optional Find dialog box.

-  Optional 3-D effects.

-  User-defined tab expansion.

-  Limit the display to a specific portion of the file.

The following table provides an overview of the MhFileDisplay control.

MhFileDisplay Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhFDis16.OCX MhFDis32.OCX MHPFST.VBX	MhFileDisplay	See the MHFDIS sample directory.		MhFileList
Development Notes

In addition to simply displaying a text file, the MhFileDisplay control allows you to highlight a portion of the file with the mouse (the keyboard is used exclusively for scrolling through the file). The highlighted text is returned in the SelText property. The SelStart property returns the zero-based byte offset of the first character of the selection. The SelLength property returns the total number of bytes in the selection (including carriage return-line feed pairs at the end of each line). The LineNumber property returns the line number containing the SelStart character.

The current display position within the file may be determined with the TopByteOffset and TopLineNumber properties. If you wish to limit the display to only a portion of the file, specify the desired line numbers in the MinLine and MaxLine properties.

You can search for any string within the file by using the FindString or SearchDialog properties. When the FindString property is set with the string to find, the search begins at the SelStart position and continues to the end of the file or to the offset specified in the FindLimit property (if greater than zero). If the search is successful, the text is highlighted within the window and the LineNumber, SelStart, SelLength and SelText properties are set accordingly. Use the FindCase property to specify the case-sensitivity of the search.

When the SearchDialog property is set at run time, a Find dialog box is displayed. The string you assign to the SearchDialog property will appear in the dialog box as the default Find What text. If you set the SearchHelp property to True, a Help button is included in the Find dialog box. When the user presses the Help button, the SearchHelp event is fired.

The SearchRequest and SearchComplete events occur whenever a search begins or ends. These events allow to you verify or change the starting position before a search or evaluate the results of a search.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

Note:  When a file is opened for display, MhFileDisplay first determines the offset of every line in the file before the text appears in the control. This approach results in extremely fast scrolling, as well as the ability to move instantly to any location in the file. The drawback is that when you are viewing large files, there may a noticeable delay before the text is displayed in the control.


Mh3dDir: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dDir: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control.

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner, LightColor, ShadowColor


Mh3dDir: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderType


Mh3dDir: BorderType

Description

The BorderType property sets or returns the type of border used for the control. The valid settings for the BorderType property follow:

Setting	Description

0	(Default) No border

1	Thin

2	Sizable

3	Thin with Caption

4	Sizable with Caption

Syntax

ctlname.BorderType = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dDir: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The valid settings for the Case property follow:

Setting	Description

0	(Default) Mixed Case: No case conversion performed.

1	Lower Case: All text is converted to lower case.

2	Upper Case: All text is converted to upper case.

Syntax

ctlname.Case = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dDir: ClearBox

Description

The ClearBox property is used like a method to clear specific information from a control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Run-Time Write


Mh3dDir: DefaultPics

Description

The DefaultPics property indicates whether the default pictures are used for the control. You can use your own pictures by setting an image in the ListPictureand ListPictureSel properties. The valid settings for the DefaultPics property follow:

Setting	Description

True (-1)	(Default) The default pictures are displayed.

False (0)	The default pictures are not displayed.

Syntax

ctlname.DefaultPics = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dDir: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDir: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor, TextColor


Mh3dDir: FindInstr

Description

The FindInstr property performs a Instr search of the list items for the specified string. The search is not case-sensitive. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. Unlike FindString, this property performs an Instr search, looking for the string anywhere within the list items. If the string is found, the FoundIndex property is set to the list index value of the item containing the string. If the string is not found, FoundIndex is set to -1. The position of the string within the item is not returned.

Syntax

ctlname.FindInstr = string$

Data Type

String

Availability

Run-Time Write

See Also

FindString, FoundIndex


Mh3dDir: FindString

Description

The FindString property specifies a string to search for within the list. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. The comparison is made starting with the first character in each list item. To search for the string anywhere within the list items, use FindInstr.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindInstr, FoundIndex


Mh3dDir: FocusColor

Description

The FocusColor property defines the color used to indicate the focus.

Syntax

ctlname.FocusColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor, TextColor


Mh3dDir: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDir: FoundIndex

Description

The FoundIndex property is used in conjunction with the FindInstr and FindString properties to both set the starting index for the search and return the ListIndex value of the list item if the string is found. The valid range for the FoundIndex property is -1 to [control].ListCount - 1.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindInstr or FindString property. If the string is found, this property contains the ListIndex value of the matching list item; otherwise, FoundIndex is -1. To continue searching the items for other occurrences of the string, set the string back into the FindString or FindInstr property until the FoundIndex value is less than its starting value.

Example:

'search the entire list

Dim IndexHldr%([control].ListCount)

[control].FoundIndex = -1

Do

    [control].FindString = "string to find"

    If [control].FoundIndex < IndexHldr% Then

        'no new ones were found

        Exit Do

    End If

    cntr% = cntr% + 1

    IndexHldr%(cntr%) = [control].FoundIndex

Loop

Syntax

ctlname.FoundIndex = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FindInstr, FindString


Mh3dDir: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text. The default is the same as the color defined in Control Panel for the Highlighted Text. This color is used for selected items regardless of the MultiSelect property setting.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MultiSelect


Mh3dDir: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list.

Syntax

setting% = ctlname.LastAdded

Data Type

Integer

Availability

Run-Time Read

See Also

LastReplaced


Mh3dDir: LastReplaced

Description

The LastReplaced property returns the element number of the last item in the list that was changed. The LastReplaced property returns the element number of the last item in the list modified using the List property.

Syntax

setting% = ctlname.LastReplaced

Data Type

Integer

Availability

Run-Time Read

See Also

LastAdded


Mh3dDir: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dDir: ListData

Description

The ListData property sets or returns a long integer value associated with each item in the list. The value placed in the ListData property remains associated with the list item even when its ListIndex value is changed. One use for this property is for storing the record number of the associated list item when displaying data from a file. If the data has been changed, you could use this property with the Put statement when writing the data back to the file. For example:

Open FileName$ For Output as #1

Put #1, [control].LastData(index), [control].List(index)

Close #1

Syntax

ctlname.ListData(index) = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture


Mh3dDir: ListPicture

Description

The ListPicture property specifies the graphics image displayed on the indicated line while this item is not selected.  If you read the ListPicture(index) property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused ListPicture(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is not selected. The ListPictureSel(index) image (if any) is displayed while the line is selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPicture(index) = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPictureSel


Mh3dDir: ListPictureSel
K Mh3dDir: ListPictureSel

Description

The ListPictureSel property specifies the graphics image displayed on the indicated line while this item is selected. If you read the ListPictureSel(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise, an empty or unused ListPictureSel(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is selected. The ListPicture(index) image (if any) is displayed while the line is not selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPictureSel(index) = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPicture


Mh3dDir: ListTextColor

Description

The ListTextColor property sets or returns the color used for the text in the specified line.

Syntax

ctlname.ListTextColor(index) = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dDir: MultiSelect

Description

The MultiSelect property sets or returns the method used to select items in the control. The valid settings for the MultiSelect property follows:

Setting	Description

0	(Default) None. Single select only.

1	Simple. Multiple items can be selected, one at a time, by clicking the left mouse button on the item or pressing the space bar while the item has the focus. If an item is already selected, the same action deselects it.

2	Extended. A group of contiguous items can be selected by pressing and holding the left mouse button while dragging the mouse pointer or pressing one of the shift keys in conjunction with clicking the left mouse button. To select or deselect individual items, use Ctrl and left click.

Syntax

ctlname.MultiSelect = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelectedCount


Mh3dDir: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


Mh3dDir: PictureWidth

Description

The PictureWidth property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


Mh3dDir: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. If you are loading a large number of items into the list, setting ScreenUpdate to False before doing the first AddItem and then setting it back to True when complete, decreases the amount of time it takes to load the items and cuts down on the amount of flicker caused by the control being repainted.

If you set the ScreenUpdate property to False, the control is not updated, and no changes shown, until this property is set to True. The Refresh method does not have any effect on a control that has the ScreenUpdate property set to False. The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The control is automatically refreshed anytime any item in the list changes. Similar to the AutoRedraw property in picture-related controls.

False (0)	The control is not automatically refreshed.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dDir: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars when needed. The standard Visual Basic list and combo box controls have vertical scrollbars added automatically whenever the number of items in the list exceeds the number that can be displayed. This property allows you to control both the presence and type of scroll bars on the control. Like the standard controls, the scrollbars become visible only when required.

The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dDir: SelectedCount

Description

The SelectedCount property returns the number of elements in the Tagged array that are currently selected (set to True). If the control's MultiSelect property is enabled (not zero), this property tells you how many elements in the control have been selected, without examining each element of the Tagged array and accumulating those that are set to True.

Syntax

value% = [form.]ctlname.SelectedCount

Data Type

Integer

Availability

Run-Time Read

See Also

MultiSelect, Tagged


Mh3dDir: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dDir: Tagged

Description

The Tagged property indicates whether the specified element is currently selected. Each element in the Tagged array corresponds to the same ListIndex item in the control.

Setting this value from code at run-time fires the control's Click event. If you have code in the Click event that can cause this same event to be fired, make sure you include a check to prevent recursion or your program may fail with an Out of Stack Space error.

To determine which elements in the control are selected, create a For/Next loop that examines each element of this array.  For example:

For i = 0 to [control].ListCount - 1

If [control].Tagged(i) Then

'This element is selected- save the element number or

'do your processing

End If

Next

The valid settings for the Tagged property follow:

Setting	Description

True (-1)	The element is selected.

False (0)	The element is not currently selected.

Syntax

ctlname.Tagged = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dDir: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDir: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window. When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write


Mh3dDir: Transparent

Description

The Transparent property indicates whether the bitmaps within the control are transparent. The valid settings for the Transparent property follow:

Setting	Description

True (-1)	The pixels in the bitmap that are the transparent color are drawn so the control background shows through.

False (0)	No portion of the background shows through the bitmap.

Syntax

ctlname.Transparent = setting%

Data Type

Integer

Availability

Design Time

Run-Time Read

Run-Time Write

See Also

TransparentColor


Mh3dDir: TransparentColor

Description

The TransparentColor property sets or returns transparent color of a bitmap. When the bitmap is drawn, any pixel set to the transparent color will not be drawn allowing the background to show through.

Syntax

ctlname.TransparentColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design Time

Run-Time Read

Run-Time Write

See Also

Transparent


Mh3dDir: WallPaper

Description

The WallPaper property specifies the method used to display the images in the control. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dDir: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position.

Syntax

Sub ctlname_TopIndexChange()


Mh3dDir: Overview

The Mh3dDir control is an enhanced version of the standard Visual Basic directory list box control. The Mh3dDir custom control has all the functionality of the standard Visual Basic directory list box and supports all of the same properties, events and methods. In addition, Mh3dDir has several unique features as follows:

-  An optional 3-D appearance, including special 3-D directory pictures and the font used for the directory names.

-  Control of all the colors used in the control.

-  The ability to search the items in the control for a string.

-  The ability to force the case of all items in the list box section of the control.

-  Display two pictures for every item in the list portion of the control, one when it's selected and another when it's not (available only when you are not using the default 3-D pictures).

-  Single or multi-select capability.

-  An optional caption.

-  Supports the AddItem and RemoveItem methods.

The following figure shows an example Mh3dDir control. The following table provides an overview of the Mh3dDir control.

Mh3dDir Control Example.

Mh3dDir Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhDir16.OCX MhDir32.OCX MHGDIR.VBX	Mh3dDir	See the MHDIR sample directory.		Mh3dDrive Mh3dFile

Development Notes

The bevel cannot be drawn around the border of the list box. To create a 3-D border around the edge of the control, place the Mh3dDir control within an Mh3dFrame control.

The BevelSizeInner and BevelStyleInner properties control the type and width of the 3-D effect. If BevelSizeInner is zero, the control appears two-dimensional regardless of the other settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor.

By default, the control uses our special 3-D pictures for the opened and closed directories. If you want to use your own pictures in the control, set the DefaultPics property to FALSE and load your images into the ListPicture and ListPictureSel picture arrays. These arrays let you display different images for the selected and deselected states for each line in the list portion of the control. If the PictureHeight and PictureWidth properties are both zero, any image loaded into these properties is displayed along the entire width of the specified line and painted using the method specified by the WallPaper property.

The FindString and FindInstr properties let you search all items in the control for a specific string (or portion). The search result is returned in the FoundIndex property. You can continue the search for other instances of the string by setting FoundIndex to the element number where the search should begin. Because the search operation can wrap around to the first element and continue searching in an endless loop, the best way to determine if you have found the last matching string is to check if the returned value of FoundIndex is less than the starting value.

Unlike the standard VB control, Mh3dDir allows you to select multiple items in the control, using either the simple or extended multi-select methods. If MultiSelect is enabled, the SelectedCount property returns the number of items currently selected. To determine which items have been selected requires that you examine the Tagged property, which is a zero-based integer array with the same number of elements as the control. If a directory in Mh3dDir is selected, the corresponding element in the Tagged array is set to -1, otherwise it is zero.

If the FocusColor property is set to a color other than black (&H0), then this color will be used to indicate a control has focus instead of the standard focus rectangle This property will override any other color when the control has focus.

The HighColor is used to indicate items in the list that have been selected. This property will override the ListTextColor if ListTextColor is the same as TextColor. If ListTextColor has been changed, the item will remain that color even when selected.

Mh3dDir supports both the AddItem and RemoveItem methods. While this allows you a new level of flexibility, anything that causes a Refresh method will cause the contents of the control to be updated and any changes made through these methods will be lost. The Mh3dDir control forces a Refresh when the Change event is fired.

The LastAdded property contains the element number of the last item added to the list,. while the LastReplaced property contains the element number of the last item that was changed by setting the List property to a string value.

The ListData property allows you to associate a long integer value with every item in the control. One of the more common uses for this property is to store a record number or other identifying value associated with each item in the list.

You can force the case of all text displayed in this control to either upper or lower case by changing the Case property.

The ClearBox property, which is write-only at run time, acts much like a method in that setting it to any integer value clears the contents of the control.

The ScreenUpdate property, when set to FALSE, prevents the contents of the control from being updated or refreshed until this property is TRUE.

If you want the control to have the appearance of a standard VB directory control, set the BackColor and FillColor properties both to &H80000005&, the ShadowColor to &H8000000D&, and the PictureHeight and PictureWidth to zero.

This control uses three standard VB properties that are not available in the standard directory control: List, ListCount, and TopIndex.  Since these properties act in the same manner as the standard properties, they are not documented as custom properties.


MhInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhInput Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Position


MhInput: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Thin border

2	Thick border

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhInput: CaretInsert

Description

The CaretInsert property sets or returns the caret width, in pixels, when the keyboard is in the insert mode. The default is zero. The range is zero to 32,767. If CaretInsert is set to zero, it is treated as one.

Syntax

ctlname.CaretInsert = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretOverStrike


MhInput: CaretOverStrike

Description

The CaretOverStrike property sets or returns the caret width, in pixels, when the keyboard is in the overstrike mode. Setting the CaretOverStrike property to zero causes the control to make the caret the same width as the character.

Syntax

ctlname.CaretOverStrike = pixels%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretInsert


MhInput: FieldType

Description

The FieldType property sets or returns the programmer-defined or predefined mask. When you set the FieldType property to one of the following pre-defined types, the Mask, Text, and TextLen properties are automatically set for you. If you choose zero, for a programmer-defined input mask, you must define the Mask, Text, and TextLen properties.

Setting	Description	Mask	Text	TextLen

1	Social Security Number	999 99 9999	"   -  -    "	11

2	Phone Number	999  999 9999 99999	"(   )   - Ext(    )"	23

3	Five digit Zip	99999	"     "	5

4	Nine digit Zip	99999 9999	“     -    "	10

5	Time Hours:Minutes	99 99	“  :  "	5

6	Time Hours:Minutes:Sec	99 99 99	"  :  ."	8

7	US Date (mm-dd-yy)	99 99 99	"  -  -  "	8

8	US Date (mm-dd-yyyy)	99 99 9999	"  -  -    "	10

9	Euro Date (dd-mm-yy)	99 99 99	"  -  -  "	8

10	Euro Date (dd-mm-yyyy)	99 99 9999	"  -  -    "	10

11	Japan Date (yyyy-mm-dd)	9999 99 99	"  -  -  "	10

Syntax

ctlname.FieldType = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Mask, TextLen


MhInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Setting	Description

True (-1)	All text in the control is automatically selected when the control receives the focus.

False (0)	The text in the control is not automatically selected.

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhInput: Indent

Description

The Indent property sets or returns the amount of space (in pixels) between characters in the control and the control's border. This property is used only when MultiLine is True. The default is zero. The range is zero-32767. This property is useful when you specify a thin border and the control is in insert mode.

Syntax

ctlname.Indent = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FieldType


MhInput: Mask

Description

The Mask property determines the valid characters that can be entered by the user at the corresponding position in the text box. If the TextLen property is larger than the length of Mask, the last character in the string applies to all characters exceeding the length of Mask. As an example, if you set the TextLen property to 100, and you pass a Mask property of "Aaa?", then the question mark is used as the mask for all characters from 4 to 100 in the Control. The Mask property can contain any of the following characters:

Character	Masking action

Space	A constant character. No input is allowed at this position in the string.

?	Any character is allowed.

#	0-9, minus sign, space and decimal point.

9	0-9 only.

@	0-9 plus space.

A	Alpha upper case (A-Z).

a	Alpha lower case (a-z).

B	Alpha upper case plus space (A-Z).

b	Alpha lower case plus space (a-z).

Note:  If the control encounters an invalid mask character, the character is treated like a "?", where any character is allowed.

Syntax

ctlname.Mask = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FieldType, PassChar


MhInput: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhInput: PassChar

Description

The PassChar property sets or returns the character used to hide the actual input. If you set this property to anything other than a null string, this character is displayed in the control, instead of the characters typed by the user. However, the Text property contains the actual characters entered. This is useful when you want the user to enter passwords or other confidential information.

Note:  The PassChar property is valid only if MultiLine is False, WordWrap is False, ScrollBars is zero, and Alignment is zero.

Syntax

ctlname.PassChar = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhInput: Position

Description

The Position property sets or returns the current position of the caret within the control. This property is useful when the user frequently moves between controls or forms. The MhInput control automatically uses the Position property to position the caret exactly where the user left off when they re-enter the field. The first position in the string is position zero.

Syntax

position& = ctlname.Position

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write

See Also

CaretInsert, CaretOverStrike


MhInput: RejectEnter

Description

The RejectEnter property indicates whether the Enter key will be rejected or passed through to the control. Setting this property to True prevents any of the associated key events from being fired when the Enter key is pressed. When this property is set to True, no events will be fired but the PC will still beep indicating an invalid key has been pressed. If you want to trap the Enter key to prevent the beep or to use it to change the focus, set this property to False and monitor the keystrokes in the KeyPress event. The valid settings for the RejectEnter property follow:

Setting	Description

True (-1)	The Enter key will not be passed through to the control.

False (0)	(Default) The Enter key will be passed through to the control, causing it to act like a standard text control.

Syntax

ctlname.RejectEnter = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhInput: TextDefault

Description

The TextDefault property sets or returns the default text that appears in the control.

Syntax

ctlname.TextDefault = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextRaw


MhInput: TextLen

Description

The TextLen property sets or returns the maximum number of characters that may be entered into the control. The default value is 32,767. The range is 1 to 32,767.

Syntax

ctlname.TextLen = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextRaw


MhInput: TextRaw

Description

The TextRaw property sets or returns a string that contains a copy of the Text property excluding the constant characters. When you write to the TextRaw property, constant characters are inserted into the text at the proper locations. When reading the TextRaw property, constant characters are stripped from the text.

Syntax

ctlname.TextRaw = string$

Data Type

String

Availability

Run-Time Read

Run-Time Write

See Also

TextLen


MhInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = setting%

Data Type

Integer

Availability

Run-Time Write


MhInput: WordWrap

Description

The WordWrap property indicates whether word wrap is in effect. The WordWrap property applies only when MultiLine is True and horizontal scrollbars are disabled. The valid settings for the WordWrap property follow:

Setting	Description

True (-1)	Word wrap is in effect.

False (0)	(Default) Word wrap is not in effect.

Syntax

ctlname.WordWrap = boolean%

Data Type

Boolean

Availability

Run-Time Read

See Also

Alignment


MhInput: AutoTerminate

Description

The AutoTerminate event occurs when a valid key is pressed while the caret is on the last character of the control. The AutoTerminate event lets you automatically SetFocus to another control when the user has filled the control with the desired number of characters. The maximum number of characters allowed is determined by the TextLen property. The KeyAscii parameter returns a numeric ASCII value, just like the KeyAscii parameter in the standard VB KeyPress event.

Syntax

CtlName_AutoTerminate(KeyAscii As Integer)


MhInput: Overview

The MhInput control is an enhanced version of the standard VB text box control. Since MhInput controls contain all the capabilities of standard VB text box controls, you can use an MhInput control in place of any standard text box control. Most importantly, MhInput's custom properties let you easily implement features (using a single instruction) that would take several VB instructions to perform. MhInput's many advantages include the following:

-  Masked input characters. This allows you to specify the nature of the characters that may be entered in the first 50 positions of the control.

-  Pre-defined input types. These include Social Security and phone numbers, five- and nine-digit zip codes, times and dates.

-  An extra thick BorderStyle.

-  Insert and overstrike modes, including separate Caret sizes for each mode. Standard VB text box controls do not provide overstrike mode.

-  Programmer-defined maximum text length.

-  An Alignment property.

-  An undo option.

-  An AutoTerminate event that occurs when the user enters the last character of a control in which you've specified a maximum text length.

The following table provides an overview of the MhInput control.

MhInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhInp16.OCX MhInp32.OCX MHIN200.VBX	MhInput	See the MHINP sample directory.		MhDateInput MhIntInput MhMaskInput MhRealInput
Development Notes

If you create an MhInput control that uses a proportional font and you want the user to see at one time all the text they type in the control, be sure to make the width of the control as large as the largest string you want to enter. This is especially important for instances of the control that use input masks. For all MhInput instances, if you enter text with a length that exceeds the width of the control, the previously entered characters scroll left as you type.

You can specify whether or not an MhInput control wraps words at the end of each line. To enable word wrapping, set the WordWrap and MultiLine properties to True. In this case, you can't display a horizontal scrollbar. Thus the ScrollBars property can assume the values zero (for no scrollbars) and two (for a vertical scrollbar only).

The custom properties FieldType, Mask, Text, and TextLen work together to provide input validation. If you set FieldType to one of the pre-defined types, MhInput automatically sets the Mask, Text and TextLen properties. When you reset the FieldType property from one of the pre-defined types to the user-defined input mask, MhInput does not clear these other related properties.

If you want to duplicate the same type of functionality of our predefined masks by using the Mask and Text properties, follow the steps below.

For a Social Security field:

1) Set the MhInput1.Mask property to "999 99 9999" [three 9's, a space, two 9's, a space, and four 9's].

2) Set the MhInput1.Text property to "   -  -    " [three spaces, a dash, two spaces, a dash, and four spaces.].  The last four spaces are actually not needed since no other constant characters follow them, but they are included in this example for clarity.

3) Set the MhInput1.TextLen property to 11.

4) The location of the "-" dashes in the Text property correspond to the same location of the spaces in the Mask property and become constants in the mask. Using this guideline, you can add this same functionality to any instance of the MhInput control.

Please note that the mask in MhInput is limited to 50 characters.

Note:  Sometimes the MhInput control will not work properly under Windows 3.1 when the text height is small, the control is not left justified and a thin border is used. The problem is that the control will not display the text. This can usually be solved by setting the Indent property to -2. Note that if the font is too large for the height the text could still be clipped.


MhAlarm: Interval

Description

The Interval property sets or returns the interval (in milliseconds) between changes in the bitmap displays when the RingOn property is non-zero. The default value is determined by the Style property. See the Style property for possible defaults. The range is 1 to 2,147,483,647.

Syntax

ctlname.Interval = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

RingOn, Style


MhAlarm: PauseTime

Description

The PauseTime property sets or returns the length of the silence between ringing sounds.

Syntax

ctlname.PauseTime = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhAlarm: Picture1

Description

The Picture1 property sets or returns the picture used with the PictureMask1 property. This property is used only when the Style property is set to 3 (User-supplied bitmaps). See the PictureMask1 property for more information on how this property is used to display irregularly-shaped images.

Syntax

ctlname.Picture1 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask1, Style


MhAlarm: Picture2

Description

The Picture2 property sets or returns the picture used with the PictureMask2 property. This property is used only when the Style property is set to 3 (User-supplied bitmaps). See the PictureMask2 property for more information on how this property is used to display irregularly-shaped images.

Syntax

ctlname.Picture2 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask2, Style


MhAlarm: Picture3

Description

The Picture3 property sets or returns the picture used with the PictureMask3 property. This property is used only when the Style property is set to 3 (User-supplied bitmaps). See the PictureMask3 property for more information on how this property is used to display irregularly-shaped images.

Syntax

ctlname.Picture3 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask3, Style


MhAlarm: PictureMask1

Description

The PictureMask1 property sets or returns the mask picture used with the Picture1 property. This picture masks the main picture defined in Picture1, allowing the background to show through in certain areas.

This property is used only when the Style property is set to 3 (User-supplied bitmaps). Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureMask1 property equal to the picture property of another control. By default, no picture is loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

When you design a bitmap for use with this property, draw the image using black and white only. Use white to specify the areas of PictureMask1 that should let the background show through. Fill with black those areas of PictureMask1 that should let the Picture1 image show. You may select .BMP or .ICO files for this property. For information on creating the bitmaps for MhAlarm controls, please refer to the MhSlide control. The same technique applies to MhAlarm bitmaps.

Syntax

ctlname.PictureMask1 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Style


MhAlarm: PictureMask2

Description

The PictureMask2 property sets or returns the mask picture used with the Picture2 property. This picture masks the main picture defined in Picture2, allowing the background to show through in certain areas.

This property is used only when the Style property is set to 3 (User-supplied bitmaps). Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureMask2 property equal to the picture property of another control. By default, no picture is loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

When you design a bitmap for use with this property, draw the image using black and white only. Use white to specify the areas of PictureMask2 that should let the background show through. Fill with black those areas of PictureMask2 that should let the Picture2 image show. You may select .BMP or .ICO files for this property. For information on creating the bitmaps for MhAlarm controls, please refer to the MhSlide control. The same technique applies to MhAlarm bitmaps.

Syntax

ctlname.PictureMask2 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture2, Style


MhAlarm: PictureMask3

Description

The PictureMask3 property sets or returns the mask picture used with the Picture3 property. This picture masks the main picture defined in Picture3, allowing the background to show through in certain areas.

This property is used only when the Style property is set to 3 (User-supplied bitmaps). Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureMask3 property equal to the picture property of another control. By default, no picture is loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

When you design a bitmap for use with this property, draw the image using black and white only. Use white to specify the areas of PictureMask3 that should let the background show through. Fill with black those areas of PictureMask3 that should let the Picture3 image show. You may select .BMP or .ICO files for this property. For information on creating the bitmaps for MhAlarm controls, please refer to the MhSlide control. The same technique applies to MhAlarm bitmaps.

Syntax

ctlname.PictureMask3 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture3, Style


MhAlarm: RingOn

Description

The RingOn property indicates whether the control is active and, if so, how frequently the alarm rings. The valid settings for the RingOn property follow:

Setting	Description

0	(Default) Ring off - do not sound tones or toggle bitmaps.

1	Flash ring - single ring only.

2	Ring on - continuous ring.

3	No Flash Ring - do not ring on mouse click.

Syntax

ctlname.RingOn = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhAlarm: Style

Description

The Style property sets or returns which icon(s) are displayed by the control. The valid settings for the Style property follow:

Setting	Description

0	(Default) Telephone

1	Alarm clock

2	Wrist alarm

3	User-supplied bitmaps

Whenever you change the Style property to a value other than 3, certain properties are automatically adjusted for optimum results (no properties are adjusted when Style is set to 3). The following table shows the default values of the properties affected by the Style property:

Style:	Style:	Style:

Property	Phone	Alarm Clock	Wrist Watch

PauseTime	1000	500	1000

Interval	29	62	29

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Interval, PauseTime


MhAlarm: WindowState

Description

The WindowState property indicates whether the MhAlarm bitmaps are to be displayed when the form is minimized (instead of the form's icon). The valid settings for the WindowState property follow:

Setting	Description

0	(Default) Normal display.

1	Alarm bitmaps are displayed in place of form icon.

If you set the WindowState property to one when your form is minimized, the control displays its bitmaps in place of the icon associated with the form, provided that the MhAlarm control is activated. At all other times, this property should be zero. The best time to set this property is in the Resize event. For example:

Sub Form1_Resize

  If Form1.WindowState = 1 Then

    MhAlarm1.WindowState = 1

  Else

    MhAlarm1.WindowState = 0

  End If

End Sub

Syntax

ctlname.WindowState = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhAlarm: Ring

Description

The Ring event occurs whenever the specified time interval has elapsed. You can use this event to update your program's status or execute any other task you want to perform while waiting for the user to respond to the alarm.

Syntax

Sub ctlname_Ring()


MhAlarm: WaveFilename

Description

The WaveFilename property specifies the name of the wave file to play when Style is set to Custom.

Syntax

ctlname.WaveFilename = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveName


MhAlarm: WaveName

Description

The WaveName property specifies the name of the wave file to play.

Syntax

ctlname.WaveName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveSource


MhAlarm: WaveSource

Description

The WaveSource property specifies the source of the sound file. The valid settings for the WaveSource property follow:

Setting	Description

0	Resource

1	System

2	File

Syntax

ctlname.WaveSource = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveName


MhAlarm: Overview

The MhAlarm control is an audio-visual attention getter that comes in three default styles: telephone, alarm clock, or wrist alarm. You can also define your own images. You can display MhAlarm controls on your forms and use the associated bitmaps in place of your form's icon when the form is minimized. The following figure shows the MhAlarm bitmaps. The following table provides an overview of the MhAlarm control.

The MhAlarm Bitmaps.

MhAlarm Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhAlrm16.OCX MhAlrm32.OCX MHAL200.VBX	MhAlarm	See the MHALRM sample directory.	N/A	MhClock MhMulti MhTimer
Development Notes

The MhAlarm control is useful when you want to let the user know that your program has completed a task or needs attention. The ability to display an MhAlarm icon in place of the form's icon is especially helpful when the user minimizes your program to work with other applications.

You have your choice of a ringing telephone, an alarm clock, a wrist alarm or your own bitmaps (specified with the Picturexxx and PictureMaskxxx properties). You may change the style at run time.

Whenever you activate the control, it quickly generates sounds and changes bitmaps to give the appearance of activity. You have complete control over the sounds the control generates, using the PauseTime, WaveName, and WaveSource properties. The control remains in an idle state until you turn it on with the RingOn property.

You can use the WindowState property to instruct the control to display its bitmaps where the icon is normally displayed when a form is minimized. When you replace the form's icon, the MhAlarm control isn't displayed until the alarm triggers for the first time.

The MhAlarm contains a custom event, named Ring, that occurs when the alarm rings. You can place code in this event procedure to execute any other task you want to perform while waiting for the user to respond to the alarm. For example, you can enable a timer that turns the alarm off if the user doesn't respond within a specified time.

The control does not draw when the parent is iconized.

Note:  In 16-bit, setting WaveSource to System and File are equivalent. The behavior for these settings follow: WIN.INI or the Registration Database (Win 95) is searched for the string specified in WaveName; if no match is found, the control then looks for a file of that name.

Note:  Default values for most custom properties depend on the style of MhAlarm control. Please consult the table shown with the Style property for a complete list of default values.

Note:  The Interval property applies only to the toggling of bitmap displays when the RingOn property is non-zero. The sound effects are controlled via the WaveName and WaveSource properties.

Caution:  If you want to take advantage of the control's ability to display its bitmaps in place of your form's icon, be sure to set the AutoSize property to True.


Mh3dCalendar: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dCalendar Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


Mh3dCalendar: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dCalendar: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeCap, BevelSizeDate, BevelStyle


Mh3dCalendar: BevelSizeCap

Description

The BevelSizeCap property sets or returns the size (in pixels) of the bevel or border around the outer edge of the caption. The default value for the BevelSizeCap property is zero. A value of zero indicates no border is drawn around the edge of the caption. The valid range of the BevelSizeCap property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeCap property to a value greater than zero. Try different BevelStyleCap settings to find the effect you want.

Syntax

ctlname.BevelSizeCap = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize, BevelSizeDate


Mh3dCalendar: BevelSizeDate

Description

The BevelSizeDate property sets or returns the size (in pixels) of the bevel or border around the outer edge of the selected day of the month. The default value for the BevelSizeDate property is zero. A value of zero indicates no border is drawn around the edge of the selected day. The valid range of the BevelSizeDate property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeDate property to a value greater than zero. Try different BevelStyleDate settings to find the effect you want.

Syntax

ctlname.BevelSizeDate = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize, BevelSizeCap


Mh3dCalendar: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCalendar: BevelStyleCap

Description

The BevelStyleCap property sets or returns the type of bevel used for the border around the caption.  If the BevelSizeCap property is zero, BevelStyleCap is ignored and no bevel is drawn around the caption. The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. The valid settings for the BevelStyleCap property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleCap = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeCap


Mh3dCalendar: BevelStyleDate

Description

The BevelStyleDate property sets or returns the type of bevel used for the border around the selected day of the month. If the BevelSizeDate property is zero, BevelStyleDate is ignored and no bevel is drawn around the selected day. The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. The valid settings for the BevelStyleDate property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleDate = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeDate


Mh3dCalendar: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dCalendar: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dCalendar: CalendarStyle

Description

The CalendarStyle property sets or returns the style of the calendar. When the CalendarStyle is zero (Normal) and an image is loaded into the Picture property, the image is displayed as the background of the calendar. If the calendar style is one (CenterFold), the Picture image is displayed only in the top half of the control. Any image loaded in the Picture property is displayed using the method selected in the WallPaper property. The valid settings for the CalendarStyle property follow:

Setting	Description

0	(Default) Normal.  The entire height and width of the control is used to display the calendar.

1	CenterFold.  The control is split in half vertically, with the top half displaying the image in the Picture property and the lower half displaying the calendar.

Syntax

ctlname.CalendarStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dCalendar: CalStatic

Description

The CalStatic property indicates whether the control is static. A static control is one that does not allow the user to change the months or year displayed. The valid settings for the CalStatic property follow:

Setting	Description

True (-1)	The control is static, meaning the arrows that allow the user to click on them with the mouse and change the displayed months and year are not visible.

False (0)	(Default) The control is not static.  The arrows that allow the user to change months and year are visible.

Syntax

ctlname.CalStatic = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCalendar: Date

Description

The Date property returns a string containing the last selected date. If the MultiSelect property is non-zero, this property returns the last date selected. The date is returned in the format specified by the DateFormat property. If Date is set to an empty string (“”), the current date will be set in the control.

Syntax

ctlname.Date = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DateFormat


Mh3dCalendar: DateArr

Description

The DateArr property is a string array that contains a list of the selected dates. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the dates in the order in which they were selected.  The dates in this array are returned in the format specified by the DateFormat property.

Syntax

ctlname.DateArr(element) = string$

Data Type

String Array

Availability

Run-Time Read

See Also

DateFormat


Mh3dCalendar: DateFormat

Description

The DateFormat property specifies the format of the Date and DateArr properties. The valid settings for the DateFormat property follow:

Setting	Description

0	(Default) Normal (12/31/95)

1	Julian (2450083)

2	Verbose (December 31, 1995)

3	Verbose with weekday (Sunday, December 31, 1995)

4	General (Microsoft Access format)

5	Long (determined by your WIN.INI setting)

6	Medium (31-DEC-95)

7	Short (determined by your WIN.INI setting)

Syntax

ctlname.DateFormat = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Date, DateArr


Mh3dCalendar: DateSelOn

Description

The DateSelOn property causes a date to be added to or removed from the DateArr property. The date to be added or removed is specified by setting the DaySel, MonthSel and YearSel properties prior to setting this property. Once you have placed values into these properties, setting DateSelOn to True places the date in the next available element number in DateArr. If the specified date already exists in DateArr, it is not added again. Setting this property to False causes the specified date to be removed from the DateArr. If the date specified is not in DateArr, no action is taken. The valid settings for the DateSelOn property follow:

Setting	Description

True (-1)	The date is placed in the DateArr string array property.

False (0)	The date is removed from the DateArr string array property.

Syntax

ctlname.DateSelOn = boolean%

Data Type

Boolean

Availability

Run-Time Write

See Also

DateArr, DaySel


Mh3dCalendar: Day

Description

The Day property sets or returns the currently selected day. The default value is the day of the month, based on the PC's system date. The valid range is 1 - (max days in the month). If you set this to a value greater than is possible for the current month, the date is automatically adjusted the correct number of days [Mod(Days in the Month)]. For instance, if the currently selected date is October 30, 1992 and you set the Day property to 32, the control adjusts the date to November 01, 1992 and this property is set to one.

Syntax

ctlname.Day = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DayArr


Mh3dCalendar: DayArr

Description

The DayArr property is an integer array that contains a list of the selected days of the month. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the days of the month in the order in which they were selected.

Syntax

ctlname.DayArr(element) = integer%

Data Type

Integer Array

Availability

Run-Time Read

See Also

MultiSelect


Mh3dCalendar: DayDropped

Description

The DayDropped property returns the number of the day where an item was dropped during a drag-drop event. This property is set just before the DragDrop event is fired and contains the number of the day where the item was dropped. In addition, during the DragOver, the day that you are over is highlighted so you have a visual reference.

Syntax

ctlname.DayDropped = integer%

Data Type

Integer

Availability

Run-Time Read


Mh3dCalendar: DayHeight

Description

The DayHeight property returns the height of the boxes for each day as well as the height of the arrows used to change the month and year.

The coordinates returned by DayHeight, DayLeft, DayTop, and DayWidth for the scrolling arrows are in twips and can be assigned directly to the Left, Top, Width and Height properties of other controls.

Since the calendar allows child controls, these properties are provided to allow you to position other controls over a particular day. For example to position a text control over a day 1 you could do the following:

daynum% = 1

text1.visible = -1

text1.top = Mh3dCalendar1.DayTop(daynum%)

text1.left = Mh3dCalendar1.DayLeft(daynum%)

text1.width = Mh3dCalendar1.DayWidth(daynum%)

text1.height = Mh3dCalendar1.DayHeight(daynum%)

text1.setfocus

In addition to the days, the coordinates of the scrolling arrows are available. Coordinates for the days on the calendar go from element 1 through 31. The arrows use elements 32 through 35 as follows:

32 - Month minus

33 - Month plus

34 - Year minus

35 - Year plus

These coordinates could be used to put your own custom buttons on the calendar in place of the arrows provided.

Syntax

ctlname.DayHeight(element) = setting&

Data Type

Long Integer Array

Availability

Run-Time Read

See Also

DayLeft, DayTop, DayWidth


Mh3dCalendar: DayLeft

Description

The DayLeft property returns the left coordinate of the boxes for each day as well as the left coordinate of the arrows used to change the month and year. See DayHeight for more information.

Syntax

ctlname.DayLeft(element) = setting&

Data Type

Long Integer Array

Availability

Run-Time Read

See Also

DayHeight, DayTop, DayWidth


Mh3dCalendar: DayMath

Description

The DayMath property indicates how invalid dates are handled. This property determines what date will be shown when you change months and the currently selected day is not valid for the new month. Example: The calendar is showing March 31. You change the month to February, but since February doesn't have 31 days, the calendar is set to February 28th. If this property is set to True, the control will perform day math, meaning it would change the month to February which only has 28 days, then add 3 days for the difference between 31 and 28, making the new date 3 March.

It is recommended that this property be set to the default value of False, especially if the CalStatic property is False. The valid settings for the DayMath property follow:

Setting	Description

True (-1)	Both the month and day can be adjusted.  Setting this property to True can cause unexpected behavior when a user manually changes the control.

False (0)	(Default) Only the day will be adjusted to account for the invalid or out of range date.

Syntax

ctlname.DayMath = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Day


Mh3dCalendar: DaySel

Description

The DaySel property sets or returns the day of the month that is used with the DateSelOn property. This property is used in conjunction with the MonthSel and YearSel properties to add or remove a date from the DateArr property. These three properties can be set in any order.

Syntax

ctlname.DaySel = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

MonthSel, YearSel


Mh3dCalendar: DayStart

Description

The DayStart property sets or returns the day of the week used as the starting day. The valid range is 0 - 6, where 0 is Sunday and 6 is Saturday. The default value is zero (Sunday).

Syntax

ctlname.DayStart = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Day, DaySel


Mh3dCalendar: DayTop

Description

The DayTop property returns the top coordinate of the boxes for each day as well as the top coordinate of the arrows used to change the month and year. See DayHeight for more information.

Syntax

ctlname.DayTop(element) = setting&

Data Type

Long Integer Array

Availability

Run-Time Read

See Also

DayLeft


Mh3dCalendar: DayWidth

Description

The DayWidth property returns the width of the boxes for each day as well as the width of the arrows used to change the month and year. See DayHeight for more information.

Syntax

ctlname.DayWidth(element) = setting&

Data Type

Long Integer Array

Availability

Run-Time Read

See Also

DayHeight


Mh3dCalendar: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting.  Only settings three and four have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCalendar: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = setting&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FocusColor


Mh3dCalendar: FocusColor

Description

The FocusColor property sets or returns the color used to indicate focus on the control.

Syntax

ctlname.FocusColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


Mh3dCalendar: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCalendar: HighBackColor

Description

The HighBackColor property sets or returns the color used for the background of selected days. The default value is the same as the color defined in Control Panel for the Button Shadow. To ensure that a consistent color is used to show selected dates on any system, you should set this property to your chosen color.

Syntax

ctlname.HighBackColor = setting&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor


Mh3dCalendar: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text. The default is the same as the color defined in Control Panel for the Highlighted Text. This color is used for selected items regardless of the MultiSelect property setting.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighBackColor


Mh3dCalendar: Language

Description

The Language property sets or returns the language used to display the date in the control. The LanguageNumber property has the same functionality as Language, but uses an integer instead of a 3-character string. The valid settings for the Language property follow:

Setting	Description

WWW	(Default) Use the language currently specified in WIN.INI

DAN	Danish

DEU	German

ENG	UK Eng

ENU	US Eng

ESN	New Spanish

ESP	Old Spanish

FIN	Finnish

FRA	French

FRC	French Canadian

ISL	Icelandic (US right now)

ITA	Italian

NLD	Dutch

NOR	Norwegian

PTG	Portuguese

SVE	Swedish

EPT	Esperanto

SER	Serbo-Croatian

Syntax

ctlname.Language = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LanguageNumber


Mh3dCalendar: LanguageNumber

Description

The LanguageNumber property sets or returns the language used to display the date in the control. The Language property has the same functionality as LanguageNumber, but uses a 3-character string instead of an integer. The valid settings for the LanguageNumber property follow:

Setting	Description

0	(Default) Use the language currently specified in WIN.INI

1	Danish

2	German

3	UK Eng

4	US Eng

5	New Spanish

6	Old Spanish

7	Finnish

8	French

9	French Canadian

10	Icelandic (US right now)

11	Italian

12	Dutch

13	Norwegian

14	Portuguese

15	Swedish

16	Esperanto

17	Serbo-Croatian

Syntax

ctlname.LanguageNumber = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Language


Mh3dCalendar: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor


Mh3dCalendar: MaxYear

Description

The MaxYear property sets or returns the maximum year for the calendar.

Syntax

ctlname.MaxYear = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinYear


Mh3dCalendar: MinYear

Description

The MinYear property sets or returns minimum year for the calendar.

Syntax

ctlname.MinYear = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxYear


Mh3dCalendar: Month

Description

The Month property sets or returns the currently selected month. The default value is the month based on the PC's system date. The valid range is 1 to 12. If you set this to a value greater than 12, the date is automatically adjusted the correct number of months. For instance, if the current date selected is October 30, 1992 and you set the Month property to 13, the control is adjusted to January 30, 1993 and this property is set to one.

Syntax

ctlname.Month = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MonthArr


Mh3dCalendar: MonthArr

Description

The MonthArr property is an integer array that contains a list of the selected months of the year. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the months of the year in the order in which they were selected.

Syntax

ctlname.MonthArr = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

Month


Mh3dCalendar: MonthSel

Description

The MonthSel property sets or returns the month of the year that is used with the DateSelOn property. This property is used in conjunction with the DaySel and YearSel properties to add or remove a date from the DateArr property.

Syntax

ctlname.MonthSel = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

DaySel, YearSel


Mh3dCalendar: MonthText

Description

The MonthText property returns the descriptive name of the currently selected month. The default value is the month based on the PC's system date. The month names are returned as mixed case, with the first character in the name capitalized. Example: January, February, etc.

Syntax

ctlname.MonthText = string$

Data Type

String

Availability

Run-Time Read

See Also

Month


Mh3dCalendar: MonthTextArr

Description

The MonthTextArr property is a string array that contains the descriptive names of the selected dates in the DateArr property. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error.  The array is zero-based and contains the days of the month in the order in which they were selected.

Syntax

ctlname.MonthTextArr(element) = string$

Data Type

String Array

Availability

Run-Time Read

See Also

DateArr, MultiSelect


Mh3dCalendar: MouseExpand

Description

The MouseExpand property sets or returns the number of pixels around the month and year arrows that act as the hot-spot for changing these values. If the control is small, the arrows that allow the user to change the month and year at the top of the control may be so small that they are difficult to use. This property allows you to increase the size of the hot-spot around the arrows in all four directions. This property does not change the size of the arrows. The default value is zero. The valid range is zero to 32,767 but the hot-spot area will not extend outside of the title area of the control.

Syntax

ctlname.MouseExpand = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCalendar: MultiSelect

Description

The MultiSelect property sets or returns the method used to select items in the control. The valid settings for the MultiSelect property follow:

Setting	Description

0	(Default) None.  Single select only.

1	Simple.  Multiple items can be selected, one at a time, by clicking the left mouse button on the item or pressing the space bar while the item has the focus. If an item is already selected, the same action deselects it.

Syntax

ctlname.MultiSelect = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MultiStatic


Mh3dCalendar: MultiStatic

Description

The MultiStatic property indicates whether or not the user can select and de-select dates using the keyboard and mouse when the MultiSelect property is set to one. This property allows the programmer to set the selection status of dates to indicate that other information is attached to that date, but precludes the user from changing that status by simply clicking on the date. If the MultiSelect property is set to zero, this property has no effect. The valid settings for the MultiStatic property follow:

Setting	Description

True (-1)	If the MultiSelect property is set to 1 (Simple) then multiple dates can only be selected and de-selected in your code. The user cannot use the mouse or keyboard to change the selected dates.

False (0)	(Default) If the MultiSelect property is set to 1 (Simple) then the user can select and de-select dates using the mouse and keyboard.

Syntax

ctlname.MultiStatic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MultiSelect


Mh3dCalendar: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicturefunction to load any external bitmap, icon, or metafile and SavePictureto save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded.  For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WallPaper


Mh3dCalendar: SelectedCount

Description

The SelectedCount property returns the number of elements in the Tagged array that are currently selected (set to True). If the control's MultiSelect property is enabled (not zero), this property indicates the number of elements in the control have been selected, without examining each element of the Tagged array and accumulating those that are set to True.

Syntax

ctlname.SelectedCount = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

MultiSelect


Mh3dCalendar: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = setting&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor


Mh3dCalendar: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = setting&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCalendar: TitleColor

Description

The TitleColor property sets or returns the color of the text in the title portion of the control.

Syntax

ctlname.TitleColor = setting&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCalendar: TitleFont

Description

The TitleFont property returns a Font object for the Title of the control.

Use the TitleFont property of a calendar object to identify a specific font object whose properties you want to use.  For example, the following code changes the Bold property setting of a TitleFont object identified by the TitleFont property of a calendar control:

calProjects.TitleFont.Bold = True

Syntax

ctlname.TitleFont.property = value

Data Type

Object

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontItalic, TitleFontStrike, TitleFontUnder


Mh3dCalendar: TitleFontBold

Description

The TitleFontBold property sets or returns the bold attribute for the title font.

Syntax

ctlname.TitleFontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontItalic, TitleFontStrike, TitleFontUnder


Mh3dCalendar: TitleFontItalic

Description

The TitleFontItalic property sets or returns the italic attribute for the title font.

Syntax

ctlname.TitleFontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontStrike, TitleFontUnder


Mh3dCalendar: TitleFontName

Description

The TitleFontName property sets or returns the name for the TitleFont. This property is identical in functionality to the standard VB FontName property. The title is that area of the control that contains the current month and year setting.

Syntax

ctlname.TitleFontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize


Mh3dCalendar: TitleFontSize

Description

The TitleFontSize property sets or returns the value for the size of the font used for the title. This property is identical in functionality to the standard VB FontSize property. The title is that area of the control that contains the current month and year setting.

Syntax

ctlname.TitleFontSize = single

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontName


Mh3dCalendar: TitleFontStrike

Description

The TitleFontStrike property sets or returns the strikethrough attribute for the title font.

Syntax

ctlname.TitleFontStrike = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontItalic, TitleFontUnder


Mh3dCalendar: TitleFontStyle

Description

The TitleFontStyle property sets or returns the 3-D effect of the text in the title portion of the control. The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When TitleFontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When TitleFontStyle is set to three or four (lowered), the outline colors are reversed.

The valid settings for the TitleFontStyle property follow:

Setting	Description

0	(Default) None

1	Raised (the text appears raised off the control)

2	Raised with more shading

3	Lowered (the text appears inset into the control)

4	Lowered with more shading

Syntax

ctlname.TitleFontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCalendar: TitleFontUnder

Description

The TitleFontUnder property sets or returns the underline attribute for the title font.

Syntax

ctlname.TitleFontUnder = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontBold, TitleFontItalic, TitleFontStrike


Mh3dCalendar: TitleHeight

Description

The TitleHeight property sets or returns the height of the title portion of the control. The default value is -1, which indicates that no titles will be displayed. If this property is set to zero, then the title height will be automatically sized according to the TitleFontxxx settings. If the value of TitleHeight is greater than zero, it is interpreted as the height of the title in pixels

Syntax

ctlname.TitleHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleFontSize


Mh3dCalendar: VAlignment

Description

The VAlignment property is used to vertically align the individual days within the box. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	(Default) Center

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


Mh3dCalendar: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.  The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as any times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


Mh3dCalendar: WeekDay

Description

The WeekDay property returns the day of the week for the currently selected date. The valid range is 1 - 7, where 1 is Sunday and 7 is Saturday.

Syntax

ctlname.WeekDay = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

WeekDayArr


Mh3dCalendar: WeekDayArr

Description

The WeekDayArr property is an integer array that contains a list of the selected days of the week for the dates in the DateArr property. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the days of the week in the order in which they were selected.

Syntax

ctlname.WeekDayArr(element) = integer%

Data Type

Integer Array

Availability

Run-Time Read

See Also

WeekDay


Mh3dCalendar: WeekDayText

Description

The WeekDayText property returns the descriptive name of the currently selected day of the week. The default value is the WeekDay based on the PC's system date. The days of the week names are returned as mixed case, with the first character in the name capitalized. Example: Sunday, Monday, etc..

Syntax

ctlname.WeekDayText = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

WeekDayTextArr


Mh3dCalendar: WeekDayTextArr

Description

The WeekDayTextArr property is a string array that contains the descriptive names of the selected days of the week in the DateArr property. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the days of the week in the order in which they were selected

Syntax

ctlname.WeekDayTextArr(element) = string$

Data Type

String Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WeekDayText


Mh3dCalendar: WeekNumbers

Description

The WeekNumbers property indicates whether or not an integer value from 1 to 52 (representing the week numbers) appears in the left column of the control. The week number is displayed using the color specified in the TitleColor property.

The valid settings for the WeekNumbers property follow:

Setting	Description

True (-1)	The week number from 1 to 52 is displayed in the left column of the control.

False (0)	(Default) The week number is not displayed.

Syntax

ctlname.WeekNumbers = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleColor


Mh3dCalendar: Year

Description

The Year property sets or returns the currently selected year. The default value is the year based on the PC's system date. The valid range is -32,768-32,767.

Syntax

ctlname.Year = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

YearArr


Mh3dCalendar: YearArr

Description

The YearArr property is an integer array that contains a list of the selected years in the DateArr. This property is valid only if the MultiSelect property is enabled (non-zero). Unless MultiSelect is enabled, attempting to read this property at run time generates an Invalid property value error. The array is zero-based and contains the years in the order in which they were selected.

Syntax

ctlname.YearArr(element) = integer%

Data Type

Integer Array

Availability

Run-Time Read

See Also

Year


Mh3dCalendar: YearSel

Description

The YearSel property sets or returns the year that is used with the DateSelOn property. This property is used in conjunction with the DaySel and MonthSel properties to add or remove a date from the DateArr property.

Syntax

ctlname.YearSel = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

DaySel, MonthSel


Mh3dCalendar: DayChange

Description

The DayChange event occurs when the selected day changes. You can use this event to trigger any processing that may be required whenever the selected day is changed.

Syntax

Sub ctlname_DayChange(Index As Integer)


Mh3dCalendar: MonthChange

Description

The MonthChange event occurs when the selected month changes. You can use this event to trigger any processing that may be required whenever the selected month is changed.

See Also

Sub ctlname_MonthChange(Index As Integer)


Mh3dCalendar: YearChange

Description

The YearChange event occurs when the selected year changes. You can use this event to trigger any processing that may be required whenever the selected year is changed.

Syntax

Sub ctlname_YearChange(Index As Integer)


Mh3dCalendar: Overview

The Mh3dCalendar control is used to display and select dates from a monthly calendar. Some of the unique features of the Mh3dCalendar control include:

-  The ability to display and select multiple dates

-  An optional 3-D appearance drawn around the edge of the control as well as the currently selected date

-  Control of all the colors used in the control

-  The ability to display an image on the background of the control or on the top half of  the control (similar to a fold-out calendar)

-  Multi-language support

The following figure shows an example Mh3dCalendar control. The following table provides an overview of the Mh3dCalendar control.

Mh3dCalendar Control Example.

Mh3dCalendar Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhCal16.OCX MhCal32.OCX MHGCAL.VBX	Mh3dCalendar	See the MHCAL sample directory.		MhDateInput

Development Notes

The selected dates can be returned in the following eight formats:

-  Normal ("10/17/92")

-  Julian (2448913)

-  Verbose ("October 17, 1992")

-  Verbose with Weekday ("Saturday October 17, 1992").

-  General (MS Access format).

-  Long (determined by your WIN.INI settings).

-  Medium ("10 Oct 1992").

-  Short(determined by your WIN.INI settings).

This control has properties that will return the entire date (month, day, year and day of week) or any of its parts.

Due to the large number of properties available with this control, especially the color properties, you may want to spend some time running the example program, then changing the different color values to see their effect. If you will be using the control with the standard 3-D colors, the only color properties you may want to change are FocusColor, HighColor, and HighBackColor. These three properties affect the foreground and background colors of the individual days of the month.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent.  While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

If the MultiSelect property is set to zero (None), then the currently selected date uses the FocusColor for the day number when the control has focus and the HighColor when it doesn't have the focus. The background of the selected color is set to the ShadowColor when the focus is both on and off the control.

If the MultiSelect property is set to one (Simple), then the current date is indicated by the FocusColor when the color has the focus and the HighColor when it does not have the focus. The inside border of the current date also reverses the LightColor and ShadowColor properties to indicate which day is currently active. Days that are tagged or selected are indicated by setting the background color for those days to the HighBackColor value.

The BevelSizeDate and BevelStyleDate properties are used to display a 3-D border around the currently selected day of the month. If BevelSizeDate is zero, no border is drawn around the selected day of the month.

The BevelSizeCap and BevelStyleCap properties are used to display a 3-D border around the month and year at the top of the control. If BevelSizeCap is zero, no border is drawn around the month and year.

While Mh3dCalendar has a Caption property, any string set into the property is not displayed. You can use this property to set an accelerator key to allow the focus to be set with an ALT+<keypress>, or storage in a manner similar to the Tag property.

By default, a triangular shaped arrow appears on each side of the month and year at the top of the calendar. The arrows are used to increment (right arrow) and decrement (left arrow) the month and year and can be activated only by a left mouse click. The arrows are auto-repeating, meaning that holding down the left mouse button on the arrow causes the month or year to change until the mouse button is released.

The CalendarStyle property determines where the Picture property image is displayed on the control. If CalendarStyle is zero (Normal), the entire height of the control is used to display the calendar and any image loaded into the Picture property is used to create the background of the control. When CalendarStyle is set to one (CenterFold), the control is split in half horizontally, with the calendar displayed in the bottom half and the image (in the Picture property) displayed in the top half. The method used to paint the picture is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. The AutoSize property determines whether the control is automatically sized to the image in Picture.

If MultiSelect is non-zero, a maximum of 365 different dates can be selected.  The selected dates can be retrieved from one of seven different arrays, all of which are read-only, run time properties.  (Attempting to read one of these properties when MultiSelect is zero will result in an Invalid property value error.)  The selected dates are stored in the arrays in the order in which they were selected.  The seven arrays are:

-  The DateArr property is a string array that stores the entire date in the format specified by the DateFormat property.

-  The DayArr property is an integer array that stores the numeric value of the days of the month (1-31).

-  The MonthArr property is an integer array that stores the numeric values of the selected months (1 - 12).

-  The MonthArrText property is a string array that returns the descriptive names of the selected months (January, February, etc.)

-  The WeekDayArr property is an integer array that returns a numeric values of the selected days of the week (1 - 7), where 1 = Sunday.

-  The WeekDayTextArr property is a string array that returns the descriptive names for the selected days of the week (Sunday, Monday, etc.)

-  The YearArr property is an integer array that returns the numeric values of the selected years.

The format of the dates returned in the Date and DateArr() properties is based on the setting of the DateFormat property.

You can use code to add or delete selected dates from the DateArr() property by setting the DaySel, MonthSel and YearSel properties to the desired date. Once a value is placed in all three properties, setting the DateSelOn property to TRUE stores the date in the next available element in the arrays. If the specified date is already present in the arrays, it is not added again. Setting DateSelOn to FALSE removes the date from the arrays. If the selected date is not present in the arrays, no action is taken. To clear all of the selected dates, use the standard VB2 Clear method.

The CalStatic and MultiStatic properties allow you to keep the end-user from changing and selecting or de-selecting dates, while still giving you the ability to perform these functions in code.

The Alignment and VAlignment properties allow you to position the day number within the rectangle drawn for each day. The DayHeight, DayLeft,  DayTop and DayWidth properties are long integer arrays that return the size of the rectangle for each day in the month as well as the location of the arrows used to change the month and year.  Together, these properties will allow you to place child controls on a calendar giving you the ability to associate notes or pictures with any day of the month or use your own custom bitmaps to replace the default arrows.

If you replace the arrows used to change the month and year, you may need to increase the size of the hot-spot area that responds to the left mouse click. This is accomplished with the MouseExpand property which, by default, is set to zero. Setting MouseExpand to any positive value increases the hot-spot area by that number of pixels in all four directions, but will never extend outside of  the section that contains the name of the month.

The DividerStyle property determines the style of horizontal and vertical lines drawn between the days of the month.

If the WeekNumbers property is set to True, a column is added to the left side of the control that displays the number for each week in the range 1 to 52. The TitleColor value also affects WeekNumbers.

Mh3dCalendar supports drag and drop. As an object is dragged over the control, the day of the month that the object is over is highlighted using the ShadowColor property. If the object is dropped onto the control, the day of the month where the object was dropped is returned in the DayDropped property.

If you are using VB3 and bind Mh3dCalendar to a data control, the DataField property should be linked to a date field and DateFormat should be set to four (General).


Mh3dCheck: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dCheck Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxAlignment


Mh3dCheck: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxSize


Mh3dCheck: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dCheck: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dCheck: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dCheck: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dCheck: BoxAlignment

Description

The BoxAlignment property sets or returns the alignment of the check box. The valid settings for the BoxAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

Syntax

ctlname.BoxAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxSize


Mh3dCheck: BoxSize

Description

The BoxSize property sets or returns the size (in pixels) of the check box. The default value is 13. The valid range is 0 to 32,767. The check box is always a square, with each side BoxSize twips in length.

Syntax

ctlname.BoxSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxAlignment


Mh3dCheck: CheckBox2d

Description

The CheckBox2d property indicates whether the check box is drawn with or without 3-D effects. The valid settings for the CheckBox2d property follow:

Setting	Description

True (-1)	The check box will not be drawn with a 3-D appearance.

False (0)	(Default) The check box will be drawn with a 3-D appearance.

Syntax

ctlname.CheckBox2d = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle, BorderStyle


Mh3dCheck: DataChecked

Description

The DataChecked property sets or returns a string containing the data set into the bound field when the control is set to the checked state. This property is only used when DataStyle = 1  (string).

Note: Property only applies to VBX.

Syntax

ctlname.DataChecked = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataGrayed, DataUnchecked


Mh3dCheck: DataGrayed

Description

The DataGrayed property sets or returns a string containing the data set into the bound field when the control is set to the grayed state. This property is only used when DataStyle = 1  (string).

Note: Property only applies to VBX.

Syntax

ctlname.DataGrayed = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataChecked, DataUnchecked


Mh3dCheck: DataStyle

Description

The DataStyle property specifies the type of data that is the linked to the specified DataField and defines how the data is evaluated. The valid settings for the DataStyle property follow:

Setting	Description

0	(Default) Boolean

1	String

2	Numeric

Note: Property only applies to VBX.

Syntax

ctlname.DataStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCheck: DataStyleCaseSens

Description

The DataStyleCaseSens property specifies whether the comparison made to a linked text field is case sensitive. This property is used only when DataStyle is set to Text. The comparison made to the linked field that, in turn, affects the Value property can be made case-sensitive by setting this property to True. The valid settings for the DataStyleCaseSens property follow:

Setting	Description

True (-1)	The comparison made with the linked text field will be case sensitive.

False (0)	(Default) The comparison made with the linked text field will not be case sensitive.

Note: Property only applies to VBX.

Syntax

ctlname.DataStyleCaseSens = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataStyle


Mh3dCheck: DataUnchecked

Description

The DataUnchecked property sets or returns a string containing the data set into the bound field when the control is set to the unchecked state. This property is only used when DataStyle = 1  (string).

Note: Property only applies to VBX.

Syntax

ctlname.DataUnchecked = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataChecked, DataGrayed


Mh3dCheck: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dCheck: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCheck: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dCheck: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCheck: Picture

Description

The Picture property specifies the graphics image to be loaded into the control's Picture property. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

To set this property at design time, click on the ellipsis (...) on the properties bar (or in VB 2.0 double-click on the property name) and a common dialog box is displayed to load the image. At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded.  For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked, PictureGrayed, PicturePressed, PictureUnchecked


Mh3dCheck: PictureChecked

Description

The PictureChecked property specifies the graphics image to be displayed when the control is checked. If an image is loaded into this property, it is displayed whenever the control's Value property is set to 1, indicating that the check box is selected. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PictureChecked property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureChecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureGrayed, PicturePressed, PictureUnchecked


Mh3dCheck: PictureGrayed

Description

The PictureGrayed property specifies the graphics image to be displayed when the control is disabled.

If an image is loaded into this property, it is displayed whenever the control's Enabled property is set to False, indicating that the check box is grayed/disabled.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties.

This property is normally write-only. If you read the PictureGrayed property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused PictureGrayed property is returned as zero.

The valid settings for the PictureGrayed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureGrayed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked, PicturePressed, PictureUnchecked


Mh3dCheck: PicturePressed

Description

The PicturePressed property specifies the graphics image to be displayed while the control is pressed. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PicturePressed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PicturePressed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked, PictureGrayed, PictureUnchecked


Mh3dCheck: PictureUnchecked

Description

The PictureUnchecked property specifies the graphics image to be displayed when the control is not checked. This property is normally write-only.

If an image is loaded into this property, it is displayed whenever the control's Value property is set to zero, indicating that the check box is not selected.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties.

The valid settings for the PictureUnchecked property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureUnchecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked, PictureGrayed, PicturePressed


Mh3dCheck: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dCheck: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colovalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCheck: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dCheck: Overview
Overview

The Mh3dCheck control is an enhanced version of the standard Visual Basic check box control. The Mh3dCheck custom control has all the functionality of the standard Visual Basic check box, supporting all of the same properties, events and methods. In addition to supporting all the properties and features of the standard control, Mh3dCheck has several unique features including:

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  A multi or single line caption that can be aligned

-  Ability to change the check box as well as to display pictures for the different states

The following figure shows an example Mh3dCheck control. The following table provides an overview of the Mh3dCheck control.

Mh3dCheck Control Example.

Mh3dCheck Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhChk16.OCX MhChk32.OCX MHGCHK.VBX	Mh3dCheck	See the MHCHK sample directory.		Mh3dOption
Development Notes

The BevelSize and BevelStyle properties control the type and width of the 3-D effect for the control. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

Setting the MultiLine property to TRUE causes the caption to be word-wrapped like the standard Visual Basic text control.

The Alignment property controls the horizontal alignment of the caption within the control in the same manner as a standard Visual Basic label, while the BoxAlignment property allows you to place the check box on the left or right side of the control.

By default, Mh3dCheck uses a black X to show the checked state and a blank square for the unchecked state. The default size of the check box is the same size as the standard VB control. You control the size of the check box using the BoxSize property and you can specify different pictures for each of the three default values: Checked, UnChecked, and Grayed (disabled). The images are loaded via the PictureChecked, PictureUnChecked , PictureGrayed and PicturePressed properties. If you load a picture into one of the Picturexxx properties, you must load an image into all four - otherwise the default picture is used for all of the Picture related properties.

Note:  Only the Picture property supports the .ICO format in this control. All of the other Picturexxx-related properties do not support icons because this graphic format is not intended to have the aspect ratio modified.

If you load an image into the Picture property, the image appears on the background of the control but it does not effect what is displayed in the check box. The painting of the Picture property image is controlled by the WallPaper property giving you three different options for the way the image is displayed. The other Picture related properties are not effected by the WallPaper setting.

You may want to set the AutoSize property to FALSE before loading an image into the Picture property so that the size of the control is not changed.

If you load dark images into the Picture property, you may want to change the TextColor property to a brighter color so the caption remains legible.


Mh3dMultiLabel: Align

Description

The Align property indicates whether the control can appear anywhere on the form or if it is forced to the top or bottom of the form and automatically sized to the form's width. The valid settings for the Align property follow:

Setting	Description

0	(Default) None: The control can be placed anywhere on the parent and resized at both design and run time.

1	Align to Top: The control is automatically moved to the top of the parent and the control's width set equal to the scale width of the parent.

2	Align to Bottom: The control is automatically moved to the bottom of the parent and the control's width set equal to the scale width of the parent.

Syntax

ctlname.Align = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


Mh3dMultiLabel: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture bitmap. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the Picture bitmap.

False (0)	Stretch or shrink the picture areas of the control based on the value of WallPaper.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dMultiLabel: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dMultiLabel: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dMultiLabel: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


Mh3dMultiLabel: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dMultiLabel: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dMultiLabel: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dMultiLabel: LastClickedSegment

Description

The LastClickedSegment property returns the segment number of the last segment the user clicked with the left mouse button.

Syntax

ctlname.LastClickedSegment = value&

Data Type

Long Integer

Availability

Run-Time Read


Mh3dMultiLabel: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Two colors are used when creating the 3-D effect for the control border and text: LightColor and ShadowColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor


Mh3dMultiLabel: Picture

Description

The Picture property specifies the graphics image to be displayed in the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size. If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded. For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, WallPaper


Mh3dMultiLabel: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. This property is identical to the standard VB ScaleMode property except for the limitation on the number of valid settings. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


Mh3dMultiLabel: SegAlignment

Description

The SegAlignment property sets or returns the horizontal alignment of the text displayed in the current segment. The current segment is defined by Segment. The valid settings for the SegAlignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.SegAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegAutoSize

Description

The SegAutoSize property indicates whether the current segment should automatically size the picture area according to the size of the SegPicture bitmap. The current segment is defined by Segment. The valid settings for the SegAutoSize property follow:

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the SegPicture bitmap.

False (0)	Stretch or shrink the picture areas of the control based on the value of SegWallPaper.

Syntax

ctlname.SegAutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegPicture, SegWallPaper


Mh3dMultiLabel: SegBackColor

Description

The SegBackColor property sets or returns the background color for the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegBackColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFillColor


Mh3dMultiLabel: SegBevelSize

Description

The SegBevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the current segment. The current segment is defined by Segment. The default value for the SegBevelSize property is zero. A value of zero indicates no border is drawn around the edge of the segment. The valid range of the SegBevelSize property is zero to 32,767. You can modify the 3-D appearance of the segment by setting the SegBevelSize property to a value greater than zero. Try different SegBevelStyle settings to find the effect you want.

Syntax

ctlname.SegBevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegBevelStyle


Mh3dMultiLabel: SegBevelStyle

Description

The SegBevelStyle property sets or returns the type of bevel used for the border around the outer edge of the current segment. The current segment is defined by Segment. When SegBevelSize is set to 0, SegBevelStyle is ignored and no bevel is drawn around the control. The valid settings for the SegBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the SegLightColor and SegShadowColor properties. When SegBevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When SegBevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.SegBevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegBevelSize


Mh3dMultiLabel: SegBorderStyle

Description

The SegBorderStyle property sets or returns the current segment’s border style. The current segment is defined by Segment. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.SegBorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dMultiLabel: SegCaption
SegCaption

Description

The SegCaption property defines the caption for the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegCaption = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegDataField

Description

The SegDataField property binds the current segment to a data field. The current segment is defined by Segment.

Syntax

ctlname.SegDataField = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegFillColor

Description

The SegFillColor property sets or returns the color used to fill the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dMultiLabel: SegFillStyle

Description

The SegFillStyle property defines the style used to fill the current segment. The current segment is defined by Segment. The valid settings for SegFillStyle follow:

Setting	Description

0	Solid

1	(Default) Transparent

2	Horizontal Line

3	Vertical Line

4	Upward Diagonal

5	Downward Diagonal

6	Cross

7	Diagonal Cross

Syntax

ctlname.SegFillStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFillColor


Mh3dMultiLabel: SegFillValue

Description

The SegFillValue property sets or returns the fill value used when painting the current segment as a Percent Complete bar. The current segment is defined by Segment. The default value is zero. The valid range is SegMin to SegMax.

Syntax

ctlname.SegFillValue = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegMax, SegMin


Mh3dMultiLabel: SegFontBold

Description

The SegFontBold property indicates whether the font style for the control includes bold. The current segment is defined by Segment.

Syntax

ctlname.SegFontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFontItalic, SegFontStrikeThru, SegFontUnderline


Mh3dMultiLabel: SegFontItalic

Description

The SegFontItalic property indicates whether the font style for the control includes italic. The current segment is defined by Segment.

Syntax

ctlname.SegFontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFontBold, SegFontStrikeThru, SegFontUnderline


Mh3dMultiLabel: SegFontName

Description

The SetFontName property sets or returns the name of the font to use for the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegFontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegFontSize

Description

The SegFontSize property sets or returns the size of the font for the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegFontSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegFontStrikeThru

Description

The SegFontStrikeThru property indicates whether the font style for the control includes strikethrough. The current segment is defined by Segment.

Syntax

ctlname.SegFontStrikeThru = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFontBold, SegFontItalic, SegFontUnderline


Mh3dMultiLabel: SegFontStyle

Description

The SegFontStyle property sets or returns the 3-D effect of the text or caption that is printed on the current segment. The current segment is defined by Segment. The valid settings for the SegFontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the SegLightColor and SegShadowColor properties. When SegFontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the SegLightColor value and the right and lower portions with the SegShadowColor value. When SegFontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.SegFontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegLightColor, SegShadowColor


Mh3dMultiLabel: SegFontTransparent

Description

The SegFontTransparent property determines whether background text or graphics are included with the characters in the font for the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegFontTransparent = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegFontUnderline

Description

The SegFontUnderline property indicates whether the font style for the control includes underline. The current segment is defined by Segment.

Syntax

ctlname.SegFontUnderline = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFontBold, SegFontItalic, SegFontStrikeThru


Mh3dMultiLabel: SegFormat

Description

The SegFormat property specifies the format when sending data to or getting data from an application. This property applies to the current segment defined by Segment.

Syntax

ctlname.SegFormat = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegHeight

Description

The SegHeight property specifies the height of the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegWidth


Mh3dMultiLabel: SegLeft

Description

The SegLeft property specifies the distance between the inner left edge of the current segment and the left edge of the control. The current segment is defined by Segment.

Syntax

ctlname.SegLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegLightColor

Description

The SegLightColor property sets or returns the light color (as opposed to the shadow color) of the current segment. The current segment is defined by Segment. Three colors are used when creating the 3-D effect for the control border and text: SegLightColor, SegShadowColor, and SegTextColor.

Syntax

ctlname.SegLightColor = setting%

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegShadowColor, SegTextColor


Mh3dMultiLabel: SegMax

Description

The SegMax property defines the maximum value for SegFillValue. This property applies to the current segment defined by Segment.

Syntax

ctlname.SegMax = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFillValue, SegMin


Mh3dMultiLabel: Segment

Description

The Segment property sets or returns the current segment being addressed in the control. The default value and first segment number is always zero. The valid range is zero to Segments - 1.

Whenever you want to modify any of the segments in one of the multi-segmented controls, you must first set this property to the segment number you want to change. All of the Segxxx related properties work with the segment number selected in this property.

Syntax

ctlname.Segment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segments


Mh3dMultiLabel: Segments

Description

The Segments property sets or returns the number of active segments in the control. The default value is one. The valid range is 1 to 100.

Whenever the value of this property is changed, all of the segments may be automatically resized and rearranged, depending on the setting of the SegmentStyle property.

Syntax

ctlname.Segments = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegmentStyle


Mh3dMultiLabel: SegmentStyle

Description

The SegmentStyle property sets or returns the default positioning of the individual segments in a multi-segmented control. The valid settings for the SegmentStyle property follow:

Setting	Description

0	None. The segments are not moved when the control is resized.

1	(Default) Tile horizontal. The segments are positioned horizontally, across the width of the control.

2	Tile vertical. The segments are positioned vertically, across the height of the control.

If this property is set to either one or two, the size and position of the segments are automatically changed when the size of the control or the number of segments are changed. Which segment(s) are resized is controlled by the SegmentVarSize property.

Syntax

ctlname.SegmentStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegmentVarSize


Mh3dMultiLabel: SegmentVarSize

Description

The SegmentVarSize property sets or returns the segment number that is resized if the control is resized and the SegmentStyle is not zero. The default value is -1, indicating that all segments are automatically resized. The valid range is -1 to Segments - 1. Remember that the segments are zero-based, so if you want the first segment to be resized, set this property to zero.

Anytime the control is resized, the size and positioning of the segments will probably need to be changed so they can retain their size and relative position.

This property helps automatically adjust the segments by allowing you to select which of the segments stretch or shrink with the control, so the remaining segments retain their size and relative position.

If the SegmentStyle property is set to either one or two, the size and position of SegmentVarSize segment is automatically changed whenever the size of the control changes. All other segments in the control retain their original height and width.

Syntax

ctlname.SegmentVarSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegmentStyle


Mh3dMultiLabel: SegMin

Description

The SegMin property defines the minimum value for SegFillValue. This property applies to the current segment defined by Segment.

Syntax

ctlname.SegMin = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegFillValue, SegMax


Mh3dMultiLabel: SegMultiLine

Description

The SegMultiLine property indicates whether the caption for the current segment extends over more than one line. The current segment is defined by Segment. The valid settings for the SegMultiLine property follow:

Setting	Description

True (-1)	The caption can extend to multiple lines.

False (0)	The caption is limited to a single line.

Syntax

ctlname.SegMultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Segment


Mh3dMultiLabel: SegPicture

Description

The SegPicture property specifies the graphics image to be displayed in the current segment. The current segment is defined by Segment. This property is normally write-only. If you read the SegPicture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused SegPicture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's SegPicture property, the background area of the object is drawn using this image instead of the color specified in the SegFillColor property. If the SegAutoSize property is set to False, the image is drawn using the method selected in the SegWallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded.  For example:

MyControl.SegPicture = YourControl.SegPicture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's SegFillColor property is not used.

The valid settings for the SegPicture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.SegPicture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegAutoSize, SegWallPaper


Mh3dMultiLabel: SegShadowColor

Description

The SegShadowColor property sets or returns the color used for shadows in the current segment. The current segment is defined by Segment. Three colors are used when creating the 3-D effect for the control border and text: SegLightColor, SegShadowColor, and SegTextColor.

Syntax

ctlname.SegShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegLightColor, SegTextColor


Mh3dMultiLabel: SegTextColor

Description

The SegTextColor property sets or returns the foreground color of the caption for the current segment. The current segment is defined by Segment. Three colors are used when creating the 3-D effect for the control border and text: SegLightColor, SegShadowColor, and SegTextColor.

Syntax

ctlname.SegTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegLightColor, SegShadowColor


Mh3dMultiLabel: SegTop

Description

The SegTop property indicates the distance between the internal top edge of the current segment and the top edge of the control. The current segment is defined by Segment.

Syntax

ctlname.SegTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegLeft


Mh3dMultiLabel: SegWallPaper

Description

The SegWallPaper property sets or returns the method to use when displaying the image in the SegPicture property if the SegAutoSize property is False. This property applies to the current segment defined by Segment. The valid settings for the SegWallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.SegWallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegAutoSize, SegPicture


Mh3dMultiLabel: SegWidth

Description

The SegWidth property defines the width of the current segment. The current segment is defined by Segment.

Syntax

ctlname.SegWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SegHeight


Mh3dMultiLabel: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Two colors are used when creating the 3-D effect for the control border: LightColor and ShadowColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor


Mh3dMultiLabel: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as 	many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dMultiLabel: Overview

The Mh3dMultiLabel control is an enhanced version of the standard Visual Basic label control. In addition to supporting all of the properties and features of the standard control, Mh3dMultiLabel has the following unique features:

-  An optional 3-D appearance, including the fonts used in the segment captions

-  Control of all the colors used in the control

-  The ability to automatically align the control to the top or bottom of the parent when using VB version 2.0 or later.

The most unique aspect of this control is its ability to have up to 100 different and individually addressable segments. Each segment has its own set of properties, which allow you to display captions, pictures and even a Percent Complete bar.

The following figure shows an example Mh3dMultiLabel control. The following table provides an overview of the Mh3dMultiLabel control.

Mh3dMultiLabel Control Example.

Mh3dMultiLabel Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhMLbl16.OCX MhMLbl32.OCX MHGMUL.VBX	Mh3dMulLabel	See the MHMLBL sample directory.		Mh3dLabel
Development Notes

Like the Mh3dLabel control, you can vary the color, width and type of bevel around the inner and outer edges of the control and display a picture for the control's background. The only functionality from the Mh3dLabel that is not in this control is the ability to rotate the text through the FontEscapement and FontOrientation properties.

What is unique about Mh3dMultiLabel is the ability to create up to 100 independent segments within the same instance of the control. One of the most common uses for this control is a status bar similar to the one used at the bottom of the display in Microsoft Word for Windows.

The Segxxx properties are identical in functionality to the properties without the Seg prefix. All properties that have the Seg prefix operate on a specified segment. To access and manipulate the segments:

-  Set the Segments property to the maximum number of segments you want in the control.

-  Change the Segment property to the segment number that you want to modify and then change the other Segxxx properties.

In design mode you can use the right mouse button to move and resize each of the segments on the control. As the mouse pointer moves over each segment, the mouse pointer changes shape. When the four-directional arrow is visible, holding down the right button and dragging allows you to move the segment within the control.

To resize a segment, position the mouse pointer near the edge of the segment. When the mouse pointer changes to a straight line with two arrows, holding the right button down and dragging allows you to change the height and width properties.

Each segment has its own BevelSize and BevelStyle properties, which control the width and style of the bevel around the individual segments. By default, the SegBevelSize is set to two and the SegBevelStyle to zero (Lowered).

The SegmentVarSize property allows you to specify a segment that will automatically adjust in size if the control is resized. If this property is set to -1, then all of the segments within the control will be resized whenever the control is resized, maintaining their overall relative width. Otherwise, this property indicates the individual segment that will be resized while all other segments within the control maintain their original width.

If an Mh3dMultiLabel control is bound to a database, you must use the SegDataField property to set the linked fields. Even though the DataField property appears in the property list, it is not used to link the control.

Note:  This control does not support updating of the linked file. It can only display fields from the current record in the linked file.

Mh3dMultiLabel also lets you display images, text and even a Percent Complete fill bar in each segment of the control.

To create one or more segments that display a Percent Complete bar, set the SegMin and SegMax values to your minimum and maximum values, then set the SegFillColor to the color to be used for the bar. At either design or run time, setting the SegFillValue causes the segment to be filled using the SegFillColor. The percentage that is filled is computed as: ((SegFillValue - SegMin) / (SegMax - SegMin)).

If an image is loaded into the Picture property, it is displayed on the portion of the control outside the segments. The method used to paint the picture is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. The SegPicture property array is used to load images into the individual segments and these pictures respect the setting of the individual SegWallPaper properties.

The Align property lets you place an Mh3dMultiLabel control on an MDI parent control in VB 2.0, automatically aligning the control to the top or bottom of the parent form.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.


Mh3dOption: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dOption Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxAlignment


Mh3dOption: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxSize


Mh3dOption: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dOption: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dOption: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dOption: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dOption: BoxAlignment

Description

The BoxAlignment property sets or returns the alignment of the option circle. The valid settings for the BoxAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

Syntax

ctlname.BoxAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment, BoxSize


Mh3dOption: BoxSize

Description

The BoxSize property sets or returns the size (in pixels) of the check box. The default value is 13. The valid range is 0 to 32,767. The check box is always a square, with each side BoxSize twips in length.

Syntax

ctlname.BoxSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BoxAlignment


Mh3dOption: CheckBox2d

Description

The CheckBox2d property indicates whether the check box is drawn with or without 3-D effects. The valid settings for the CheckBox2d property follow:

Setting	Description

True (-1)	The check box will not be drawn with a 3-D appearance.

False (0)	(Default) The check box will be drawn with a 3-D appearance.

Syntax

ctlname.CheckBox2d = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle, BorderStyle


Mh3dOption: DataStyle

Description

The DataStyle property specifies the type of data that is the linked to the specified DataField and defines how the data is evaluated. The valid settings for the DataStyle property follow:

Setting	Description

0	(Default) Boolean

1	String

Note: Property only applies to VBX.

Syntax

ctlname.DataStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dOption: DataStyleCaseSens

Description

The DataStyleCaseSens property specifies whether the comparison made to a linked text field is case sensitive. This property is used only when DataStyle is set to Text. The comparison made to the linked field that, in turn, affects the Value property can be made case-sensitive by setting this property to True. The valid settings for the DataStyleCaseSens property follow:

Setting	Description

True (-1)	The comparison made with the linked text field will be case sensitive.

False (0)	(Default) The comparison made with the linked text field will not be case sensitive.

Note: Property only applies to VBX.

Syntax

ctlname.DataStyleCaseSens = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataStyle


Mh3dOption: DataText

Description

The DataText property sets or returns the text that is linked to the DataField when the DataStyle property is set to 1 (Text). When a Mh3dOption control is bound to a DataField, the value and type of data in that field affects the state of the control. The type of data in the bound control is specified by the DataStyle property. When DataStyle is set to 1 (Text), this property is used as the link to the DataField, not the Caption. Should you want the caption of the control to reflect the data in the DataField, do a variable assignment:

Mh3dOption1.Caption = Mh3dOption1.DataText

Syntax

ctlname.DataText = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataStyle


Mh3dOption: FillColor

Description

The FillColor property sets or returns the color used to fill the control. If an image is being used for the Picture property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dOption: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dOption: Group

Description

The Group property sets or returns the group number for the control. The default group number is zero. The valid range is zero to 32,767. All controls assigned the same group number have the same functionality as a group of option buttons, in that only one control in the group can be selected or depressed at any one time. The controls do not have to be placed within a container object (i.e., frame or picture) to be assigned to a group -- all that is required is that their Group property be set to the same value and they are placed on the same parent (which can be a form).

Syntax

ctlname.Group = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dOption: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dOption: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dOption: Picture

Description

The Picture property specifies the graphics image to be loaded into the control's Picture property. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded.  For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dOption: PictureChecked

Description

The PictureChecked property specifies the graphics image to be displayed when the control is selected. If an image is loaded into this property, it is displayed whenever the control's Value property is set to 1, indicating that the option button is selected. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PictureChecked property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureChecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUnchecked


Mh3dOption: PictureGrayed

Description

The PictureGrayed property specifies the graphics image to be displayed when the control is disabled.

If an image is loaded into this property, it is displayed whenever the control's Enabled property is set to False, indicating that the option button is grayed/disabled.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties.

This property is normally write-only. If you read the PictureGrayed property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused PictureGrayed property is returned as zero.

The valid settings for the PictureGrayed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureGrayed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PicturePressed


Mh3dOption: PicturePressed

Description

The PicturePressed property specifies the graphics image to be displayed while the control is pressed. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PicturePressed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PicturePressed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureGrayed


Mh3dOption: PictureUnchecked

Description

The PictureUnchecked property specifies the graphics image to be displayed when the control is not selected. This property is normally write-only.

If an image is loaded into this property, it is displayed whenever the control's Value property is set to zero, indicating that the option button is not selected.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture-related properties.

The valid settings for the PictureUnchecked property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureUnchecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked


Mh3dOption: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dOption: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dOption: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.  The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dOption: Overview

The Mh3dOption control is an enhanced version of the standard Visual Basic option button control. Mh3dOption has all the functionality of the standard Visual Basic option button plus the following unique features:

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  A multi or single line caption that can be aligned

-  The ability to change the size of the Option box as well as display pictures for the different states

-  You can display your own pictures for the checked, unchecked, grayed (disabled) and pressed states.

-  You can align the option button to the left or right side of the control and even modify the size of the option button itself.

The following figure shows an example Mh3dOption control. The following table provides an overview of the Mh3dOption control.

Mh3dOption Control Example.

Mh3dOption Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhOpt16.OCX MhOpt32.OCX MHGOPT.VBX	Mh3dOption	See the MHOPT sample directory.		Mh3dCheck
Development Notes

By default, Mh3dOption uses a black dot to show the checked state and a blank circle for the unchecked state. The default size of the option button is the same size as the standard VB control.

Using the PictureChecked, PictureGrayed, PicturePressed and PictureUnChecked properties, you can display a different image for the background to graphically represent the different states. If you are using dark images in any of these properties, you may want to set the TextColor property to a lighter color so the caption will remain legible. You must load an image into all four properties or the default picture is used.

Note:  Only the Picture property supports the .ICO format in this control. All of the other Picturexxx-related properties do not support icons because this graphic format is not intended to have the aspect ratio modified.

An image placed in the Picture property appears on the background of the control, but does not affect what is displayed in the option button. The painting of this image is controlled by the WallPaper property giving you three different options for the way the image is displayed. The other Picture-related properties are not affected by the WallPaper setting. You may want to set the AutoSize property to FALSE before loading an image into the Picture property so the size of the control is not changed. If you are loading dark images into the Picture property, you may want to change the TextColor to a brighter color so the caption remains legible.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor. If you want this control to have a non 3-D appearance, change the colors to reflect the system colors and set the CheckBox2d property to True.

Setting the Multiline property to TRUE causes the caption to be word-wrapped like the standard VB text control.

The Alignment property controls the horizontal alignment of the caption within the control in the same manner as a standard VB label.

When an Mh3dOption control is bound to a DataField, the value and type of data in that field affects the state of the control. The type of data in the bound control  is specified by the DataStyle property. When DataStyle is set to 1 - Text, this property is used as the link to the DataField, not the Caption. Should you want the caption of the control to reflect the data in the DataField, do a variable assignment:

Mh3dOption1.Caption = Mh3dOption1.DataText

When the DataStyle property is set to 1 - Text, the Value property of the control is evaluated as the LEN of the DataField. If the DataField is null (Len = 0), the control's Value property is set to zero (False).  If the DataField contains any data (Len >  0), then the Value property is set to -1 (True). The DataStyleCaseSens property determines if the comparison made to the linked field is case sensitive.

When using Mh3dOption as a bound control and DataStyle = Text. The DataChanged property will be set to True only for the option button that has a value.  So if you want to examine DataChanged for the Mh3dOption used in this way, examine the DataChanged property of the one with a value.  For example:

'has the data been changed??

For i = 0 to 3

    If mh3doption1(i).value Then

        If mh3doption1(i).datachanged Then

            Print "Data has changed"

        End If

    End If

Next

This does not apply if the DataStyle of Boolean is used. In that case the DataChanged property is examined in a normal manner.


Mh3dText: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dText Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText:BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dText: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dText: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dText: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dText: DataLength

Description

The DataLength property indicates whether the text length is automatically limited to the width of the linked data field. The following settings are valid for the DataLength property:

Setting	Description

True (-1)	The TextLength of the control is automatically limited to the length of the linked data field.

False (0)	(Default) The TextLength is not effected by the length of the linked data field.

Syntax

ctlname.DataLength = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dText: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dText: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	(Default) The text in the control can be edited.

False (0)	The text in the control cannot be edited directly by the user, but the caret will still appear, allowing the text to be highlighted and copied to the clipboard. The text can still be changed in code (by setting the Text property).

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars, if needed. The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dText: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dText: TextLength

Description

The TextLength property sets or returns the maximum number of characters that may be entered into the control. The default value is zero, which indicates no length checking is performed. The valid range is 0 to 32,767. This property is identical to the VB2 MaxLength property.

Syntax

ctlname.TextLength = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dText: Overview

The Mh3dText control is an enhanced version of the standard Visual Basic text control. The Mh3dText custom control has all the functionality of the standard Visual Basic text control and supports all the same properties, events and methods with the following exception: the Mh3dText custom control cannot support the PasswordChar property that is standard in Visual Basic. That style cannot be combined with the style that is required to allow us to draw the bevel around the edge of the control. Mh3dText provides the following unique features:

-  An optional 3-D appearance

-  Control of all the colors used in the control

-  The ability to horizontally align the text in the control

The following figure shows an example Mh3dText control. The following table provides an overview of the Mh3dText control.

Mh3dText Control Example.

Mh3dText Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhText16.OCX MhText32.OCX MHGTXT.VBX	Mh3dText	See the MHTEXT sample directory.		Mh3dLabel
Development Notes

The Alignment property lets you horizontally align the text in the control in the same manner as a standard Visual Basic label. If you choose right or center alignment, Mh3dText will automatically support multiline text, regardless of the MultiLine property setting. This is because Windows requires the mulitline style whenever the alignment for a text control is set to anything other than left.

The TextLength property allows you to limit the number of characters that can be entered by the user. The default setting is zero, which in fact disables this property, meaning Mh3dText has the same limits as a standard VB text control. When Alignment is set to left and MultiLine is FALSE, the control's capacity is 32K. If Alignment is set to center or left, or MultiLine is TRUE, the control can hold approximately 30K of data.

If the control is bound to a data field, the DataLength property allows you to automatically set the TextLength equal to the length of the DataField.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.


MhFileList: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


MhFileList: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


MhFileList: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhFileList: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhFileList: ClearBox

Description

The ClearBox property clears specific information from a control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Run-Time Write


MhFileList: ColAlignment

Description

The ColAlignment property sets or returns the alignment of text within the specified column. When FileList is True, the control automatically maintains this property. The valid settings for the ColAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

2	Center

Syntax

ctlname.ColAlignment(column%) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

ColumnWidth


MhFileList: ColumnWidth

Description

The ColumnWidth property sets or returns the width of a column used to display one of the elements of information. The value of the ColumnWidth property is expressed in characters. The columns are separated by embedded tabs within the text of a list item. The columns are numbered from zero to 30. Note that when FileList is True, the control automatically maintains this property.

Syntax

ctlname.ColumnWidth(column%) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

ColAlignment


MhFileList: ControlBox

Description

The ControlBox property indicates whether a control box is available on the control. You must set both the MDI and ControlBox properties to True for the control to display a control box. The valid settings for the ControlBox property follow:

Setting	Description

True (-1)	The control box is displayed.

False (0)	(Default) The control box is not displayed.

Syntax

ctlname.ControlBox = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: Dir

Description

The Dir property indicates whether the list box includes directory entries. This property is only used when FileList is True. Directory names are displayed at the beginning of the list. The valid settings for the Dir property follow:

Setting	Description

True (-1)	Include directory entries in the list box. The FileList property must be True if you want directory entries to appear.

False (0)	(Default) Exclude directory entries from the list box.

Syntax

ctlname.Dir = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileList


MhFileList: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor.

Syntax

ctlname.DividerStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhFileList: Drive

Description

The Drive property indicates whether the list box displays the list of valid drives. This property is only used when FileList is True. Drive names are displayed after directory names (if they're displayed) and before file names. The valid settings for the Drive property follow:

Setting	Description

True (-1)	Include drive entries in the list box. The FileList property must be True if you want drive entries to appear.

False (0)	(Default) Exclude drive entries from the list box.

Syntax

ctlname.Drive = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Dir


MhFileList: ExtendedSelect

Description

The ExtendedSelect property indicates whether the mouse can be used for extended selection. Extended selection refers to the way multiple items can be selected in a list.

The ExtendedSelect property allows the selection of multiple contiguous items when using the Shift key. Multiple, non-contiguous items can be selected when using the Ctrl key. The SingleSelect property allows the user to select multiple items, whether or not they are contiguous. If you set this property to True, the SingleSelect property is automatically set to False. The valid settings for the ExtendedSelect property follow:

Setting	Description

True (-1)	Allows use of the mouse for extended selection.

False (0)	(Default) Does not allow extended selection.

Syntax

ctlname.ExtendedSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SingleSelect


MhFileList: FileAtt

Description

The FileAtt property returns the specified file's attributes. This property is only used when FileList and ShowFAtt are both True. The attribute value is a string, seven bytes long. The first character in the string is either an asterisk (*), which indicates that the file has non-standard attributes set, or a space, which means that the file does not have any non-standard bits set. The second through seventh characters contain either the first letter of an attribute (in lowercase) if the attribute is True, or a dot to indicate that attribute is False.

The following lists each attribute, along with its abbreviation, in the order that it appears in the FileAtt string:

Abbreviation	Attribute

(space or *)	Non-standard attribute bits set if *

r	Read-only

h	Hidden

s	System

v	Volume

d	Directory

a	Archive

For example, the string "rhs.da" indicates a read-only, system, hidden directory with the archive attribute set.

Syntax

attribute$ = ctlname.FileAtt(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileList


MhFileList: FileDate

Description

The FileDate property returns the date (in the current system format) of the specified file. This property is only used when the FileList and ShowFDate properties are both True.

Syntax

fdate$ = ctlname.FileDate(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileList, ShowFDate


MhFileList: FileExtension

Description

The FileExtension property  returns the extension of the specified file when FileList is True. If the file is a directory, brackets [ ] are placed around the string. This property is not valid when FileList is False.

Syntax

extension$ = ctlname.FileExtension(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileName


MhFileList: FileList

Description

The FileList property indicates whether the list box automatically displays any file, drive and directory information. If FileList is False, the control does not automatically manage the contents. In other words, it behaves like an enhanced List Box control... you must use the AddItem method to display information in the list box. The valid settings for the FileList property follow:

Setting	Description

True (-1)	The control manages the contents of the list.

False (0)	(Default) The programmer manages the contents of the list.

Syntax

ctlname.FileList = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: FileName

Description

The FileName property returns the name of the specified file when FileList is True. The file name includes the primary file name and the extension (if any), separated by a period. If the file is a directory, brackets [ ] are placed around the string. FileName is not valid if the FileList property is False.

Syntax

filename$ = [form.]ctlname.FileName(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileDate, FileExtension, FileSize


MhFileList: FileSize

Description

The FileSize property returns the size (in bytes) of the specified file when FileList and ShowFSize are both True.

Syntax

filesize$ = ctlname.FileSize(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileName


MhFileList: FileTime

Description

The FileTime property returns the time (in the current system format) of the specified file. This property is only used when the FileList and ShowFTime properties are both True.

Syntax

ftime$ = [form.]ctlname.FileTime(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileName


MhFileList: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhFileList: FindString

Description

The FindString property specifies a string to search for within the list. The search takes place on the first n characters of each line in the control, where n is the length of string$. The result of the search is returned in the FoundString property. Please see the FoundString property for an example of using FindString and FoundString. When FileList is True, you can search only for file names.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FoundString


MhFileList: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to three or four (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhFileList: FoundString

Description

The FoundString property is used in conjunction with the FindString property to both set the starting index for the search and return the ListIndex value of the list item where the string is found.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindString property. If the string is found, this property contains the ListIndex value of the matching list item. Otherwise, FoundString is set to -1. To continue searching the items for other occurrences of the string, set the string back into the FindString property until the FoundString value is less than its starting value. For example:

'search the entire list

ReDim IndexHldr%([control].ListCount)

[control].FoundIndex = -1

Do

  [control].FindString = "string to find"

  If [control].FoundIndex < IndexHldr% Then

    'no new ones were found

    Exit Do

  End If

  cntr% = cntr% + 1

  IndexHldr%(cntr%) = [control].FoundIndex

Loop

Syntax

linenumber% = ctlname.FoundString

Data Type

Integer

Availability

Run-Time Read

See Also

FindString


MhFileList: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelectedColor


MhFileList: HorizScroll

Description

The HorizScroll property indicates whether the control displays a horizontal scroll bar, when required. The valid settings for the HorizScroll property follow:

Setting	Description

True (-1)	The control displays a horizontal scroll bar when required.

False (0)	(Default) If the width of the control is less than the width of the information being displayed, the control clips the right side of the list box information.

Syntax

ctlname.HorizScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VerticalDivider


MhFileList: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list. Items added to a control that have the SortColumn property set to True can be placed anywhere in the list. This property returns the ListIndex position of the last item that was added in a sorted or unsorted control.

Syntax

setting% = ctlname.LastAdded

Data Type

Integer

Availability

Run-Time Read

See Also

SortColumn


MhFileList: LightColor

Description

The LightColor property sets or returns the light color, as opposed to the shadow color of the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhFileList: MDI

Description

The MDI property indicates whether the control displays a caption, has MDI properties and can be resized by the user at run time. If the MDI property is False, the control does not display the Control Box, the Minimize Button or the Maximize Button, even if those properties are True. The valid settings for the MDI property follow:

Setting	Description

True (-1)	The control has MDI characteristics.

False (0)	(Default) The control does not have MDI characteristics.

Syntax

ctlname.MDI = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ControlBox


MhFileList: PrimaryFileName

Description

The PrimaryFileName property returns the raw file name (the portion of the file name to the left of the period) of the specified element. This property is only used when FileList is True. If the file is a directory, brackets [ ] are placed around the string.

Syntax

filename$ = [form.]ctlname.PrimaryFileName(element%)

Data Type

String Array

Availability

Run-Time Read

See Also

FileList


MhFileList: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. This property is ideal for situations where you want to fill a control with data and then display all the contents at once. Note that setting the property to True does not cause an immediate refresh. The Refresh method can be used to cause the display to update. The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The screen is updated with every change to the contents of the control.

False (0)	Changes to the contents of the control are not visible on the screen.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


MhFileList: SelectedColor

Description

The SelectedColor property sets or returns the color used to indicate selected items in the list

Syntax

ctlname.SelectedColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor


MhFileList: SelectedCount

Description

The SelectedCount property returns the number of elements in the Tagged array that are currently selected (set to True). The range is zero to ListCount.

Syntax

value% = [form.]ctlname.SelectedCount

Data Type

Integer

Availability

Run-Time Write

See Also

Tagged


MhFileList: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhFileList: ShowFAtt

Description

The ShowFAtt property indicates whether the file list display includes the attributes. The valid settings for the ShowFAtt property follow:

Setting	Description

True (-1)	Display the file attributes in the list box. The FileList property must be True for this setting to have an effect.

False (0)	(Default) Do not display the associated information in the list box.

Syntax

ctlname.ShowFAtt = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: ShowFDate

Description

The ShowFDate property indicates whether the file list display includes the date stamp. The valid settings for the ShowFDate property follow:

Setting	Description

True (-1)	Display the file dates in the list box. The FileList property must be True for this setting to have an effect.

False (0)	(Default) Do not display the associated information in the list box.

Syntax

ctlname.ShowFDate = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: ShowFSize

Description

The ShowFSize property indicates whether the file list display includes the file size. The valid settings for the ShowFSize property follow:

Setting	Description

True (-1)	Display the file sizes in the list box. The FileList property must be True for this setting to have an effect.

False (0)	(Default) Do not display the associated information in the list box.

Syntax

ctlname.ShowFSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: ShowFTime

Description

The ShowFTime property indicates whether the file list display includes the file size. The valid settings for the ShowFTime property follow:

Setting	Description

True (-1)	Display the file times in the list box. The FileList property must be True for this setting to have an effect.

False (0)	(Default) Do not display the associated information in the list box.

Syntax

ctlname.ShowFTime = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhFileList: SingleSelect

Description

The SingleSelect property indicates whether the control can be used to select multiple, non-contiguous items. Setting SingleSelect to False allows the user to select multiple items, whether or not they are contiguous. The ExtendedSelect property allows the selection of multiple contiguous items. If you set this property to True, the ExtendedSelect property is automatically set to False. The valid settings for the SingleSelect property follow:

Setting	Description

True (-1)	Restricts the user to selecting one item.

False (0)	(Default) Allows the user to select multiple, non-contiguous items.

Syntax

ctlname.SingleSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ExtendedSelect


MhFileList: Sizeable

Description

The Sizeable property indicates whether the control can be sized by the user at run time. This property is only used when the MDI property is True. The valid settings for the Sizeable property follow:

Setting	Description

True (-1)	The control can be resized at run time.

False (0)	(Default) The size of the control is determined at design time.

Syntax

ctlname.Sizeable = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MDI


MhFileList: SortColumn

Description

The SortColumn property sets or returns the type of sort performed on the list box contents. The valid settings for the SortColumn property follow:

Setting	Description

0	(Default) Not Sorted

1	Sorted

2	Sort on File Name

3	Sort on File Extension

4	Sort on File Date/Time

5	Sort on File Size

6	Sort on File Attributes

Settings zero and one are valid regardless of the value of the FileList property. Settings two through six are valid only if FileList is True.

Syntax

ctlname.SortColumn = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileList


MhFileList: Tagged

Description

The Tagged property indicates whether the specified element is currently selected. Each element corresponds to a line in the list box. The first line is zero. The valid settings for the Tagged property follow:

Setting	Description

True (-1)	The element is currently selected.

False (0)	The element is not currently selected.

The following example demonstrates how to determine if element three is selected:

If MhFIleList.Tagged(3) Then

  ' Element 3 has been selected

End If

Syntax

boolean% = ctlname.Tagged(element%)

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

ExtendedSelect, SingleSelect


MhFileList: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhFileList: Title

Description

The Title property sets or returns the title. This property is only used when FileList is False. The title is displayed in an area just below the caption bar (if MDI is True) or at the top of the list box (if MDI is False). The string can have embedded tabs in order to cause portions of the title to align with the columns in the list box.

If you specify a title, it is always visible. The title doesn't scroll vertically when the control has a vertical scroll bar. However, it does scroll horizontally with the items in the list box if the control has a horizontal scroll bar. The default value is a null string.

Syntax

ctlname.Title = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleBold, TitleHeight


MhFileList: TitleBold

Description

The TitleBold property indicates whether the list box title is displayed in bold type. The valid settings for the TitleBold property follow:

Setting	Description

True (-1)	Display the title in bold type.

False (0)	(Default) Don't display the title in bold type.

Syntax

ctlname.TitleBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Title, TitleHeight


MhFileList: TitleHeight

Description

The TitleHeight property sets or returns the height of the title area. The default value is zero, which effectively turns off the title display. The range is zero to 32,767.

Syntax

ctlname.TitleHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Title, TitleBold


MhFileList: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window.

When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write


MhFileList: UserData

Description

The UserData property sets or returns a programmer-defined data value associated with the specified element.

The value of the UserData property and its list box item are linked as long as the list box is available. This property lets you establish a link between items in the list box and data external to the list box. For example, you can use the UserData property to store an element number of a related array of information.

Syntax

ctlname.UserData(element%) = value&

Data Type

Long Integer Array

Availability

Run-Time Read

Run-Time Write


MhFileList: VerticalDivider

Description

The VerticalDivider property indicates whether vertical divider lines are displayed in the control. The valid settings for the VerticalDivider property follow:

Setting	Description

True (-1)	The control displays vertical divider lines.

False (0)	(Default) The control does not display vertical divider lines.

Syntax

ctlname.VerticalDivider = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HorizScroll


MhFileList: Change

Description

The Change event occurs when the Tagged array value of an item is changed. This occurs when the user selects or deselects an item, as well as when the Tagged array is manipulated from code.

Syntax

Sub ctlname_Change()


MhFileList: ChangePath

Description

The ChangePath event occurs when the value of the Path property changes.

Syntax

Sub ctlname_ChangePath()


MhFileList: ChangePattern

Description

The ChangePattern event occurs when the value of the Pattern property changes.

Syntax

Sub ctlname_ChangePattern()


MhFileList: Close

Description

The Close event occurs when the Close option is selected from the control box menu. This event occurs only when MDI is True and ControlBox is True.

Syntax

Sub ctlname_Close()


MhFileList: Move

Description

The Move property occurs when the control is moved (by dragging it with the mouse or moving it via the control box menu). This event can occur only when MDI is True and ControlBox is True.

Syntax

Sub ctlname_Move()


MhFileList: Resize

Description

The Resize event occurs when the control is resized (with the mouse or via the control box menu). This event can occur only when MDI is True and Sizeable is True.

Syntax

Sub ctlname_Resize()


MhFileList: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position. Use the TopIndex property to determine the new element number that is displayed at the top of the control.

Syntax

Sub ctlname_TopIndexChange()


MhFileList: Overview

The MhFileList control is an enhanced version of the standard VB file list box control. In addition to displaying information about files, it can display directory names and list the available drives. The following figure shows an example MhFileList control. The following table provides an overview of the MhFileList control.

MhFileList Control Example.

MhFileList Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhFLst16.OCX MhFLst32.OCX MHFL200.VBX	MhFileList	See the MHFLST sample directory.		MhFileDisplay
Development Notes

The MhFileList control combines the capabilities of the standard VB file-oriented controls (the drive list box, directory list box and file list box). This makes it easier to manage files, since you don't have to pass values between separate controls to keep them synchronized. You set the property values for a single control and the control determines which files, directories and drives to display. You can also display multiple columns of varying widths, with unique titles and alignments for each column.

Note:  The operating system treats directories as though they were files. Therefore, many of the properties that refer to files also refer to directories. As an example, directories have date and time stamps, as well as attributes.

Note:  The FileList property must be True for the list box to automatically display file, drive or directory information. Only a few properties, such as the Title and Caption properties, change the appearance and content of the box if the FileList property is False. We wrote the control this way so you can use it as an enhanced list box control with MDI features, simply by setting FileList to False.

The ShowFxxx properties determine which elements of file information are displayed. The list box always displays the elements in the order: name, extension, date, time, size and attribute. If you don't display an element, the control displays the next element without reserving room for the missing element. You can sort the contents of the list box on any of these elements.

The contents of the list box (the specific files and whether drives or directories are listed) are determined by the Dir, Drive, Normal, Archive, ReadOnly, System, Hidden, Path and Pattern properties.

The control uses the Filexxx properties to return the values of the file information elements. Note that you must display a file element if you want to access its value. For instance, if you want to use the FileDate property to access a file's date, you must display the date element by setting ShowFDate to True. You access these properties just like the List array in VB list box controls. The element number you pass refers to the line item in the list box, where zero is the first element and ListIndex-1 is the last element.

As you assign values to the ShowFxxx properties in design mode, the control's appearance changes - you don't have to run the program to see the effects. This way, you can spend some time experimenting with different property values and still create a file list box quickly.

The Drive and Dir properties let you specify whether drive letters and directory names appear in the list box.

When the FileList property is False, and you are maintaining the contents of the control, you can specify multiple columns. You can also set the Title, ColumnWidth and ColAlignment properties in order to manage those aspects of the control. When FileList is True, the control automatically manages all of those properties.

Because this control optionally allows selection of multiple items (when SingleSelect is set to False), the Tagged array is used to determine which items have been selected.

One of the most unique features of the MhFileList control is the UserData property array. This long integer array has one element for each line of file information. The control associates any value you store in the array with the corresponding line of file information, even if you change the sort order for the list box. One possible use of this array is to store the index number of an entry in an array or file of information related to the list item.

Even though the MhFileList control provides the AddItem and RemoveItem methods, we recommend you don't use them when you set FileList to True. When the FileList property is True, the control maintains the contents of the list box for you by reading the directory from the disk as the properties are set. If you use the AddItem and RemoveItem methods, the control may reload the file list after you have changed it and obviate your changes.

If you want to set the title for this control in code, you must separate

the columns with a Chr$(9) and follow the last column with a Chr$(9) as well.

The Bevelxxx properties can be used to create 3-D effects. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

Caution:  All owner draw list boxes have a problem if you use them in conjunction with SetParent. The symptom is that after the call to SetParent the control will not display any contents. You can get around this problem by setting a property that will cause the control to be recreated, such as changing the value of the SingleSelect property. This is a problem with all owner draw list boxes in VB, not just ours.

Note: Since TopIndex was not a standard property in VB 1.0, it is marked and documented as a custom property.


MhMaskInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhMaskInput Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhMaskInput: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	(Default) The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMaskInput: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhMaskInput: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMaskInput: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhMaskInput: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhMaskInput: CaretColor

Description

The CaretColor property sets or returns the color of the caret.

Syntax

ctlname.CaretColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhMaskInput: CaretHeight

Description

The CaretHeight property sets or returns the height of the caret. The default setting is zero, in which case the caret is sized according to the current font.

Syntax

ctlname.CaretHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretWidth


MhMaskInput: CaretInterval

Description

The CaretInterval property sets or returns the timer interval (in milliseconds) for the flashing caret. The default setting is zero, in which case the caret uses the system's default blink time.

Syntax

ctlname.CaretInterval = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhMaskInput: CaretStyle

Description

The CaretStyle property sets or returns the shape of the caret. The valid settings for the CaretStyle property follow:

Setting	Description

0	(Default) Block.

1	Up arrow.

2	Down arrow.

Syntax

ctlname.CaretStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretColor, CaretInterval


MhMaskInput: CaretVAlign

Description

The CaretVAlign property specifies where the caret is displayed within the control. The valid settings for the CaretVAlign property follow:

Setting	Description

0	(Default) The caret is positioned over the text.

1	The caret is positioned below the text.

2	The caret is positioned above the text.

Syntax

ctlname.CaretVAlign = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVisible


MhMaskInput: CaretVisible

Description

The CaretVisible property indicates whether the caret is visible. The valid settings for the CaretVisible property follow:

Setting	Description

True (-1)	(Default) The caret is visible within the control.

False (0)	The caret is not visible within the control.

Syntax

ctlname.CaretVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVAlign


MhMaskInput: CaretWidth

Description

The CaretWidth property sets or returns the width of the caret. The default setting is zero, in which case the caret is sized according to the system's border width.

Syntax

ctlname.CaretWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretHeight


MhMaskInput: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The following settings are valid for the Case property.

Setting	Description

0	(Default) Mixed Case — no case conversion performed.

1	Upper Case — all text is converted to upper case.

2	Lower Case — all text is converted to lower case.

3	Proper — The first letter of each word is automatically converted to upper case, and the remaining text is displayed unaltered.

4	Proper Plus — Each letter that follows a matching pattern (as defined by the CaseProper array) is automatically converted to upper case, and the remaining text is displayed unaltered.

Syntax

ctlname.Case = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaseProper


MhMaskInput: CaseProper

Description

The CaseProper property sets or returns the characters that invoke automatic case conversion when the Case property is set to four (Proper Plus).

Each element of the CaseProper array should contain a character or series of characters that, when entered into the control, result in the automatic capitalization of the next letter entered into the control.  For example:

MhMaskInput1.CaseProper(0) = " "

MhMaskInput1.CaseProper(1) = "'"

MhMaskInput1.CaseProper(2) = " Mac"

MhMaskInput1.CaseProper(3) = " Mc"

Setting the properties as above will cause any letter that follows a space, a space plus Mac, a space plus Mc, or an apostrophe to be automatically capitalized. In addition, when a CaseProper element begins with a space, and that pattern appears at the beginning the control text (without the leading space), the next letter is automatically capitalized.

If you want to ensure that the first letter of each word is automatically capitalized, be sure to set a CaseProper element to a single space, as shown in the above example.

Syntax

ctlname.CaseProper = integer%

Data Type

String Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Case


MhMaskInput: CMask

Description

The CMask property sets or returns the custom mask characters used in the Mask property. The valid characters allowed for each mask character are defined in the CMaskChars property. You may define as many custom mask characters as required for any control, although typically you might need to define only one or two. Each element in the CMask array must have a corresponding element in the CMaskChars array that defines the valid characters for the associated CMask element.  For example:

‘ Define the custom mask character "9"

MhMaskInput1.CMask(0) = "9"

' The valid characters for the "9" mask are:

MhMaskInput1.CMaskChars(0) = "0123456789"

' Define the custom mask character "A"

MhMaskInput1.CMask(1) = "A"

' The valid characters for the "A" mask are:

MhMaskInput1.CMaskChars(1) = "ABCDEFGabcdefg"

' Define the input mask using our custom mask chars:

MhMaskInput1.Mask = "999AAA"

MhMaskInput1.TextLength = 6

In the above example, the user can enter up to 6 characters (TextLength = 6). The first 3 characters must be a digit from 0 to 9 (as defined in element zero of CMaskChars), and the next 3 characters must be an upper or lower case A through G (as defined by element one of CMaskChars).

Note that <space> and ? mask characters are automatically defined by the control. See the Mask property for details.

Syntax

ctlname.CMask = integer%

Data Type

String Array

Availability

Run-Time Read

Run-Time Write

See Also

CMaskChars


MhMaskInput: CMaskChars

Description

The CMaskChars property sets or returns the valid ANSI characters for each custom mask character defined in the CMask array. Each element in the CMaskChar array specifies the valid characters allowed for the associated CMask element. The characters in the CMask elements are then used in the Mask property to define a custom mask. For example:

' Define the custom mask character "9"

MhMaskInput1.CMask(0) = "9"

' The valid characters for the "9" mask are:

MhMaskInput1.CMaskChars(0) = "0123456789"

' Define the custom mask character "A"

MhMaskInput1.CMask(1) = "A"

' The valid characters for the "A" mask are:

MhMaskInput1.CMaskChars(1) = "AaBbCcDdEeFfGg"

' Define the input mask using our custom mask chars:

MhMaskInput1.Mask = "999AAA"

MhMaskInput1.TextLength = 6

In the above example, the user can enter up to 6 characters (TextLength = 6).  The first 3 characters must be a digit from 0 to 9 (as defined in element zero of CMaskChars), and the next 3 characters must be an upper or lower case A through G (as defined by element one of CMaskChars).

Syntax

ctlname.CMaskChars(element) = string$

Data Type

String Array

Availability

Run-Time Read

Run-Time Write

See Also

CMask


MhMaskInput: DataDestination

Description

The DataDestination property sets or returns the property that is set when the control is bound. The valid settings for the DataDestination property follow:

Setting	Description

0	(Default) Use the Text property

1	Use the TextRaw property

Syntax

ctlname.DataDestination = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextRaw


MhMaskInput: DataLength

Description

The DataLength property indicates whether the text length is automatically limited to the width of the linked data field.

Setting	Description

True (-1)	The TextLength of the control is automatically limited to the length of the linked data field.

False (0)	(Default) The TextLength is not affected by the length of the linked data field.

Syntax

ctlname.DataLength = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextLength


MhMaskInput: FieldType

Description

The FieldType property sets or returns the name of the configuration (a section within the control's .INI file) to use for the control. The configuration can include values for any property that can be set at design time.

The FieldType names appear as section headings in the control's .INI file (specified with the INIFile property). Under each heading are property names and their corresponding values. For example, the following section defines a Social Security mask:

' Stored in MYMASKS.INI

[Social Security Number]

Mask = "999 99 9999"

TextDefault = "   -  -    "

TextLength = 11

CMask(0) = "9"

CMaskChars(0) = "0123456789"

When you set the INIFile property at design time with a valid configuration file, you can click on the FieldType property in the Properties list to load the section names into the FieldType list. When you select a FieldType, the properties defined in the .INI file for that field type are automatically set. Any property that can be set at design time can be configured in the .INI file. If an error occurs when attempting to read the .INI file, the control generates a log file and displays an error message.

The values shown in the previous example can be loaded into the control at run time as follows:

MhMaskInput1.INIFile = "MYMASKS.INI"

MhMaskInput1.FieldType = "Social Security Number"

The control will then reset itself with the values that follow each property name in the specified section. Since the FieldType property may be set at run time, you can conceivably give your users the ability to define or customize their own field types in the .INI file — without requiring you to modify your application.

Syntax

ctlname.FieldType = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

INIFile


MhMaskInput: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhMaskInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Setting	Description

True (-1)	All text in the control is automatically selected when the control receives the focus.

False (0)	The text in the control is not automatically selected.

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMaskInput: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMaskInput: Indent

Description

The Indent property sets or returns the amount of space (in pixels) between characters in the control and the control's border. The default is zero. The range is zero to 32767. You can also use the VAlignment property to specify the vertical alignment (top, bottom or center) of the text within the control.

Syntax

ctlname.Indent = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhMaskInput: INIFile

Description

The INIFile property sets or returns the name of the configuration file that contains FieldType definitions. The configuration file (.INI file) is similar to WIN.INI — a text file consisting of section names and their corresponding settings.  See the FieldType property for details on the contents of an .INI file.

When you set the INIFile property at design time with a valid configuration file, you can click on the FieldType property in the Properties list to load the section names into the FieldType list. When you select a FieldType, the properties defined in the .INI file for that field type are automatically set. Any property that can be set at design time can be configured in the .INI file. If an error occurs when attempting to read the .INI file, the control generates a log file and displays an error message.

Note that since the FieldType property may be set at run time, you can conceivably give your users the ability to define or customize their own field types in the .INI file — without requiring you to modify your application.

Syntax

ctlname.INIFile = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FieldType


MhMaskInput: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhMaskInput: Mask

Description

The Mask property determines the valid characters that can be entered by the user at the corresponding position in the text box. This control supports custom mask characters, which are defined in the CMask and CMaskChars arrays. In addition to the custom mask characters, the following mask characters are pre-defined by the control:

Character	Mask Action

Space	A constant character. No input is allowed at this position in the string.

?	Any character is allowed.

Syntax

ctlname.Mask = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CMask, CMaskChars


MhMaskInput: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	The control does not allow its contents to be edited.

False (0)	(Default) The control allows its contents to be edited.

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMaskInput: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhMaskInput: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMaskInput: TextDefault

Description

The TextDefault property sets or returns the default text that is initially displayed in the control at run time, or whenever the Text property of the control is cleared.

Syntax

ctlname.TextDefault = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMaskInput: TextLength

Description

The TextLength property sets or returns the maximum number of characters that may be entered into the control. The default value is 0 (equivalent to 1,024). The range is zero to 1,024.

Syntax

ctlname.TextLength = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextDefault


MhMaskInput: TextRaw

Description

The TextRaw property sets or returns a string that contains a copy of the Text property excluding the constant characters. When you write to the TextRaw property, constant characters are inserted into the text at the proper locations. When reading the TextRaw property, constant characters are stripped from the text

Syntax

ctlname.TextRaw = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMaskInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = integer%

Data Type

Integer

Availability

Run-Time Write


MhMaskInput: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhMaskInput: AutoTerminate

Description

The AutoTerminate event occurs when a valid key is pressed while the caret is on the last character of the control. The AutoTerminate event lets you automatically SetFocus to another control when the user has filled the control with the desired number of characters. The maximum number of characters allowed is determined by the TextLength property.

Syntax

CtlName_AutoTerminate(KeyAscii As Integer)


MhMaskInput: InvalidEntry

Description

The InvalidEntry event occurs when the date within the control is outside the valid range and the control loses the focus.

Syntax

Sub ctlname_InvalidEntry()


MhMaskInput: InvalidSetText

Description

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The Cancel parameter determines whether the invalid text is accepted by the control. If you set Cancel to True, the invalid text is not accepted. If Cancel is False, and you do not change the InvalidText string yourself, the text is accepted regardless of any invalid characters.

The InvalidText parameter contains the invalid text string that is being set into the control. You can clean up or override the invalid text simply by setting the InvalidText string to the desired string. If you do not set Cancel to True, the control will receive the modified InvalidText string.

Syntax

Sub ctlname_InvalidSetText(Cancel As Integer, InvalidText As String)


MhMaskInput: Overview

The MhMaskInput control is a powerful text box control that allows you to define your own edit masks. MhMaskInput offers the following features:

-  Design time or run time configuration via an initialization (.INI) file.

-  Optional case conversion, with mixed-case support for proper names.

-  Optional horizontal scrolling when the text length exceeds the physical width of the control.

-  Horizontal and vertical alignment of the text.

-  Optional 3-D effects.

-  Complete control over the size, appearance and behavior of the caret.

-  A custom event that occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The following figure shows examples of MhMaskInput controls. The following table provides an overview of the MhMaskInput control.

MhMaskInput Control Examples.

MhMaskInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhMInp16.OCX MhMInp32.OCX MHINMSK.VBX	MhMaskInput	See the MHMINP sample directory.		MhDateInput MhInput MhIntInput MhRealInput
Development Notes

The configuration file (specified with the INIFile property) uses the same format as WIN.INI - a text file consisting of section names and their corresponding settings. As used by the MhMaskInput control, each line following a [SectionName] indicates the name and value of an MhMaskInput property. When you set the FieldType property equal to a [SectionName], the control reads the lines in that section of the configuration file and resets the indicated properties to the specified values. For example, the following section defines a Social Security mask:

' Stored in MYMASKS.INI

[Social Security Number]

Mask = "999 99 9999"

TextDefault = "   -  -    "

TextLength = 11

CMask(0) = "9"

CMaskChars(0) = "0123456789"

If you set the FieldType property to Social Security Number, the control locates the appropriate section in the configuration file and resets the Mask, TextDefault, TextLength, CMask, and CMaskChars properties.

When you set the INIFile property at design time with a valid configuration file, you can click on the FieldType property in the Properties list to load the section names into the FieldType list.

Any property that can be set at design time can be configured in the .INI file. If an error occurs when attempting to read the .INI file, the control generates a log file and displays an error message.

Note that since the FieldType property may be set at run time, you can conceivably give your users the ability to define or customize their own field types in the .INI file - without requiring you to modify your application.

For your convenience, we have provided an .INI file editor in the EXAMPLES directory. The project name is MHINIED.MAK.

The Mask, CMask, and CMaskChars properties define the edit mask to use for text input. The Case and CaseProper properties determine the type of case conversion (if any) to perform on the contents of the control. Together, these five properties allow you to perform virtually any type of input validation.

The AutoHScroll property determines whether the text is scrolled horizontally when its length exceeds the physical width of the control. When AutoHScroll is False, the number of characters that can be entered in the text box is limited by the physical width of the control.

The Alignment and VAlignment properties allow you to align the text horizontally and vertically within the control.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the FillColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's FillColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

The Caretxxx properties give you complete control over the size, appearance and behavior of the caret.

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

Caution:  When using MhMaskInput with Visual C++, place your .INI file in the Windows sub-directory instead of the current working directory.


MhSplitter: Align

Description

The Align property sets or returns how the control aligns itself to the parent container. The valid settings for the Align property follow:

Setting	Description

0	(Default) None - the control can be placed anywhere on the parent and resized at both design and run time.

1	Align to Top - the control is automatically moved to the top of the parent and the control's width set equal to the scale width of the parent.

2	Align to Bottom - the control is automatically moved to the bottom of the parent and the control's width set equal to the scale width of the parent.

3	Align to Left - the control is automatically moved to the left of the parent and the control's width set equal to the scale width of the parent.

4	Align to Right - the control is automatically moved to the right of the parent and the	control's width set equal to the scale width of the parent.

5	Fill Container - the control is automatically sized to fill its parent.

Syntax

ctlname.Align = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhSplitter: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhSplitter Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhSplitter: AutoSize

Description

The AutoSize property indicates whether the container should size to the image in the Picture property. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	Size the control to the size of the bitmap.

False (0)	(Default) Do not resize to the size of the bitmap.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSplitter: BevelChildren

Description

The BevelChildren property indicates the type of controls that are drawn with 3-D beveling. The valid settings for the BevelChildren property follow:

Setting	Description

0	(Default) None

1	Bevel only Non-Graphical child controls

2	Bevel only Graphical child controls

3	Bevel all child controls

Syntax

ctlname.BevelChildren = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildBevelSize


MhSplitter: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhSplitter: BevelSizeInner

Description

The BevelSizeInner property specifies the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


MhSplitter: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhSplitter: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhSplitter: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderSize


MhSplitter: BorderSize

Description

The BorderSize property sets or returns the width of the border (in pixels) around the child MhSplitter control. The default setting is zero.

Syntax

ctlname.BorderSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhSplitter: BorderStyle

Description

The BorderStyle property sets or returns the border style for the control. The valid settings for the BorderStyle property follow:

Setting	Description

0	None

1	Fixed single

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSplitter: ChildAutoSize

Description

The ChildAutoSize property indicates how MhSplitter children should be sized when the container is sized. The valid settings for the ChildAutoSize property follow:

Setting	Description

0	(Default) None. Child controls are not moved or sized

1	Horizontal. The Height of each child control is set to the Height of the MhSplitter that contains them, while the Width of the parent control is split evenly among all the child controls. The effect is that the child controls are all the same height and placed side by side within the parent.

2	Horizontal Uneven.  Same as Horizontal except the widths of the child controls can be different, but the controls will never overlap. Thus, if the Width of one child changes, the parent moves the other controls over to compensate for the change.

3	Vertical. The Width of each child control is set to the Width of the MhSplitter that contains them, while the Height of the parent control is split evenly among all the child controls. The effect is that the controls are all the same width and placed one above the other within the parent.

4	Vertical Uneven. Same as Vertical except the heights of the child controls can be different, but the controls will never overlap. Thus, if the Height of one child changes, the parent moves the other controls to compensate for the change.

5	Only MhSplitter controls are Horizontal. Same as Horizontal, but affects only other MhSplitter controls.

6	Only MhSplitter controls are Vertical. Same as Vertical, but affects only other MhSplitter controls.

7	Proportional. When the parent is resized, the child controls are resized and repositioned proportionally. In other words if the parent becomes large, you have a large version of your child control layout, while if the parent becomes small, you get a small version of the child control layout.

Syntax

ctlname.ChildAutoSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSplitter: ChildBevelSize

Description

The ChildBevelSize property sets or returns the bevel size (in pixels) used for child MhSplitter controls contained within the parent MhSplitter control. The default is one. Use this property in conjunction with the BevelChildren and ChildBevelStyle properties to automatically bevel the MhSplitter's child controls.

Syntax

ctlname.ChildBevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelChildren, ChildBevelStyle


MhSplitter: ChildBevelStyle

Description

The ChildBevelStyle property sets or returns the bevel style for the child MhSplitter controls. The valid settings for the ChildBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised.

Syntax

ctlname.ChildBevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildBevelSize


MhSplitter: ChildHeightMax

Description

The ChildHeightMax property sets or returns the maximum height for a child MhSplitter control when ChildAutoSize is used. The default is zero. When set to zero, there is no maximum child height.

Syntax

ctlname.ChildHeightMax = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildAutoSize, ChildHeightMin


MhSplitter: ChildHeightMin

Description

The ChildHeightMin property sets or returns the minimum height for a child MhSplitter control when ChildAutoSize is used. The default is zero. When set to zero, there is no minimum child height.

Syntax

ctlname.ChildHeightMin = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildAutoSize, ChildHeightMax


MhSplitter: ChildSpacing

Description

The ChildSpacing property sets or returns the spacing to maintain between child MhSplitter controls when ChildAutoSize is used. The default is six pixels.

Syntax

ctlname.ChildSpacing = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildAutoSize


MhSplitter: ChildWidthMax

Description

The ChildWidthMax property sets or returns the maximum width for a child MhSplitter Control when ChildAutoSize is used. The default is zero. When set to zero, there is no maximum child width.

Syntax

ctlname.ChildWidthMax = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildWidthMin


MhSplitter: ChildWidthMin

Description

The ChildWidthMin property sets or returns the minimum width for a child MhSplitter control when ChildAutoSize is used. The default is zero. When set to zero, there is no minimum child width.

Syntax

ctlname.ChildWidthMin = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildWidthMax


MhSplitter: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhSplitter: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhSplitter: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhSplitter: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSplitter: NoPrefix

Description

The NoPrefix property specifies whether ampersand characters (&)are displayed in the caption without requiring the use of double ampersands (&&). Note that the character immediately following the ampersand character is used as the access key for the control, regardless of the NoPrefix setting. The valid settings for the NoPrefix property follow:

Setting	Description

True (-1)	Ampersand characters are displayed and do not cause the next character to be underlined.

False (0)	(Default) Ampersand characters are not displayed unless you embed a double ampersand in the string. The next character after the ampersand is underlined.

Syntax

ctlname.NoPrefix = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSplitter: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer , OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhSplitter: SplitterStyle

Description

The SplitterStyle property sets or returns the type of splitter. Set this property to one and ChildAutoSize to two or four to allow the user to resize the splitter's children.

Setting	Description

0	(Default) None. Does not allow user resizing of splitter.]

1	Splitter Active (only valid when ChildAutoSize = 2 or ChildAutoSize = 4).

Syntax

ctlname.SplitterStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChildAutoSize


MhSplitter: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhSplitter: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	(Default) Center

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhSplitter: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


MhSplitter: Resize

Description

The Resize event occurs when the control is resized.

Syntax

Sub ctlname_Resize()


MhSplitter: Overview

The MhSplitter control is a container control that, when used in conjunction with other controls of the same type, allows splitting the main container so that each part can be sized individually. The following table provides an overview of the MhSplitter control.

MhSplitter Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhSplt16.OCX MhSplt32.OCX MHSPLIT.VBX	MhSplitter	See the MHSPLT sample directory.		MhOddPic
Development Notes

The Bevelxxx properties can be used to create 3-D effects. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

You have control over the 3-D appearance of both the control (Bevelxxx properties) and the child MhSplitter controls within the MhSplitter control (ChildBevelxxx properties).

To create a typical MhSplitter control, follow these steps:

-  Start a new project and add the appropriate MHSPLIT.xxx control to the project

-  Place an instance of the MhSplitter control on the form. We'll refer to this control as the parent.

-  Set the parent's BevelSize to zero

-  Set the parent's BorderSize to zero

-  Set the parent's FillColor to something other than gray

-  Select the parent and draw two more MhSplitter controls within the parent (the child controls)

-  Set both children's BevelSize to zero

-  Set the parent's SplitterStyle to 1

-  Set the parent's ChildAutoSize to something other than zero

-  Run the project


MhSaver: ActivateSeconds

Description

The ActivateSeconds property sets or returns the number of seconds of inactivity required to activate the control. Inactivity means no keypresses or mouse action. The default setting is 60. The range is zero to 32,767. A setting of zero places the control in an inactive state.

Syntax

ctlname.ActivateSeconds = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CountDown, Interval


MhSaver: CountDown

Description

The CountDown property sets or returns the number of seconds remaining until the screen saver blanks the screen. Setting CountDown to -1 invokes the screen blanking service immediately. The range is zero to 32,767.

Syntax

ctlname.CountDown = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

ActivateSeconds, Interval


MhSaver: EraseBackground

Description

The EraseBackground property indicates whether the MhSaver control should erase the screen before displaying its blanking images. The color used to blank the screen is the color specified as the background color of the control. The valid settings for the EraseBackground property follow:

Setting	Description

True (-1)	Erase the screen before displaying the blanking pictures.

False (0)	(Default) Display the screen blanking images without erasing the background screen image.

Syntax

ctlname.EraseBackground = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SaverhWnd, Style


MhSaver: Interval

Description

The Interval property sets or returns the interval (in milliseconds) in which to call the Timer event when the control is active. The default value is 1,000. The range is zero to 32,767.

Syntax

ctlname.Interval = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ActivateSeconds, CountDown


MhSaver: SaverhWnd

Description

The SaverhWnd property sets or returns the hWnd of a control or form that is shown when the screen saver is activated. The SaverhWnd property overrides the current Style setting and causes MhSaver to show (and set the focus to) the specified control or form when the screen saver is activated.

When the screen saver is canceled (by any keypress or mouse movement), the control or form is hidden, even if it was not originally hidden when the screen saver was activated.

Syntax

ctlname.SaverhWnd = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Style


MhSaver: Style

Description

The Style property sets or returns the type of screen that the control displays while the screen saver is active. The Style setting is ignored when the SaverhWnd property is set to a valid hWnd of a control or form. Otherwise, the Style settings are:

Setting	Description

0	(Default) Programmer-defined; requires any keypress or mouse activity (move or click) to restore the display.

1	Blank screen

2	Random colors

3	Random rectangles

4	Random lines

5	Programmer-defined; requires any keypress or a mouse click to restore the display.

If the Style property is set to 1 or 2, the EraseBackground property must also be set to True since both properties require full screen operation.

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SaverhWnd


MhSaver: QueryCancel

Description

The QueryCancel event occurs when the user attempts to cancel the active saver via a keypress or mouse movement. Cancel determines if the cancel request is accepted or ignored. If you set Cancel to a non-zero value, the saver is canceled. If Cancel is zero, the saver is not canceled.

This event can be used to display a password screen requiring authorization before restoring the display. The following code provides an example of how this can be implemented.

Sub MhSaver1_QueryCancel(Cancel as Integer)

  PasswordForm.Show MODAL

  x = DoEvents()   'Must be here

  If GlobalPasswordOk = True Then

    Cancel = True 'Cancel saver

    Exit Sub

  End If

  Cancel = False  'Password invalid.  Don't cancel!

End Sub

Important:   If you display a modal form (such as a password entry screen or message box) you must place a DoEvents() statement after the Form.Show 1 or the MsgBox statement. If you don't, the form or message box will be displayed continuously. For example:

Syntax

Sub ctlname_QueryCancel(Cancel As Integer)


MhSaver: SaverCancelled

Description

The SaverCancelled event occurs each time the control restores the screen.

Syntax

Sub ctlname_SaverCancelled()


MhSaver: Timer

Description

The Timer event occurs each Interval milliseconds while the control has the screen blanked. You can perform background processing in the Timer event, including displaying programmer-defined images.

Syntax

Sub ctlname_Timer()


MhSaver: Overview

The MhSaver control lets you add screen blanking to your applications. You can choose between the four screen-saving features supplied or write your own graphics routines. The following table provides an overview of the MhSaver control.

Note:  This control cannot be used with Microsoft Visual C++.

MhSaver Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHSV200.VBX	MhSaver	See the MHSAVER sample directory.		MhInvisible MhTimer
Development Notes

The MhSaver control gives your application a professional feel by letting the user clear the screen after a specified period of inactivity to avoid burning in an image on the monitor or to prevent someone from looking at confidential information. Any mouse or keyboard activity restores the screen image. If you're using your own effects, you can specify that the user must click the mouse (as opposed to just moving it) in order to restore the display.

To add a screen saver to your application, follow these steps:

-  Place an MhSaver control on your form.

-  Set the Style property to the type of screen saver display you want.

-  Set the ActivateSeconds property to the number of seconds of inactivity that must pass before the control is activated.

-  You can optionally specify a value for the Interval property that determines how fast MhSaver updates the screen.

Now all you have to do is wait! Once MhSaver determines that the inactivity time limit has been reached, it begins displaying the screen saver images. When you press a key or move or click the mouse, the MhSaver control automatically restores the contents of the display.

If the Style property is set to 1 or 2, the EraseBackground property must also be set to True since both properties require full screen operation.

To write a custom screen saver display, set the Style property to zero or five. If you choose style zero, any mouse or keyboard activity redisplays the screen. If you choose style five, only a mouse click and keypresses will redisplay the screen. Style five lets you avoid redisplaying the screen if you accidentally bump the mouse. Finally, place code in the MhSaver's Timer event procedure to update the screen with your screen saver images while the screen is blanked.

The CountDown property returns the seconds remaining until the control blanks the screen. Set CountDown to -1 to instantly blank the screen.

Note that when the screen saver display is canceled via the mouse or keyboard, the QueryCancel event occurs before the saver is actually canceled. This offers an opportunity to override the request by setting the Cancel parameter to zero and provides the mechanism to implement a password protection system.


MhClock: AlarmHour

Description

The AlarmHour property sets or returns the alarm hour setting. The default value is -1. The range is -1 to 24. Please note that the alarm hour setting should be made using a 24 hour base, even if the clock is a 12 hour clock.

Syntax

ctlname.AlarmHour = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AlarmMinute, AlarmSecond


MhClock: AlarmMinute

Description

The AlarmMinute property sets or returns the alarm minute setting. The default value is -1. The range is -1 to 59.

Syntax

ctlname.AlarmMinute = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AlarmHour, AlarmSecond


MhClock: AlarmSecond

Description

The AlarmSecond property sets or returns the alarm second setting. The default value is -1. The range is -1 to 59.

Syntax

ctlname.AlarmSecond = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AlarmHour, AlarmMinute


MhClock: BestFit

Description

The BestFit property indicates whether the control automatically sizes the hour, minute and second areas of the clock when the Style property or size of the control is changed. The valid settings for the BestFit property follow:

Setting	Description

True (-1)	(Default) The control automatically sizes itself upon change in Style or size.

False (0)	The control does not automatically size itself.

Syntax

ctlname.BestFit = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhClock: BorderColor

Description

The BorderColor property sets or returns the border color for the control.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


MhClock: FillColor

Description

The FillColor property sets or returns the control's background color. If an image is being used for the PictureAClock or PictureDClock property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhClock: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text, needle, and markings that are printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhClock: Hour

Description

The Hour property sets or returns the hour setting of the clock. The default value is -1. The range is -1 to 24, excluding zero. Use 24 hour format, regardless of the clock's Style.

Syntax

ctlname.Hour = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Minute, Second


MhClock: HourBottom

Description

The HourBottom property sets or returns the bottom position of the hour display (in the control's ScaleMode) relative to the bottom border of the control. This property is valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.HourBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteBottom, SecondBottom


MhClock: HourHandLen

Description

The HourHandLen property sets or returns the length of the hour hand for an analog clock. The default value is 50. The range is zero to 100. Note that this property is expressed as a percentage of the total area available to the hour hand (defined by HourWidth and HourHeight).

Syntax

ctlname.HourHandLen = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourWidth, HourHeight


MhClock: HourHandWidth

Description

The HourHandWidth property sets or returns the width (in the control's ScaleMode) of the hour hand. The default value is four. The range is zero to 32,767.

Syntax

ctlname.HourHandWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteHandWidth, SecondHandWidth


MhClock: HourHeight

Description

The HourHeight property sets or returns the height (in the control's ScaleMode) available to the hour display. This property is valid for both digital and analog clocks. The default value is the control's default height. The range is zero to 32,767.

Syntax

ctlname.HourHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteHeight, SecondHeight


MhClock: HourLeft

Description

The HourLeft property sets or return the left position of the hour display (in the control's ScaleMode) relative to the left border of the control. This property is valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.HourLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteLeft, SecondLeft


MhClock: HourRight

Description

The HourRight property sets or return the right position of the hour display (in the control's ScaleMode) relative to the right border of the control. This property is valid for both digital and analog clocks. The default value is 2/3 of the default width of the control. The range is zero to 32,767.

Syntax

ctlname.HourRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteRight, SecondRight


MhClock: HourTop

Description

The HourTop property sets or returns the top position of the hour display (in the control's ScaleMode) relative to the top border of the control. These properties are valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.HourTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteTop, SecondTop


MhClock: HourWidth

Description

The HourWidth property sets or returns the width (in the control's ScaleMode) available to the hour display. This property is valid for both digital and analog clocks. The default value is 1/3 the default width of the control. The range is zero to 32,767.

Syntax

ctlname.HourWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteWidth, SecondWidth


MhClock: Interval

Description

The Interval property sets or returns the interval (in milliseconds) at which the clock is updated. The default value is 1,000. The range is zero to 2,147,483,647.

Syntax

ctlname.Interval = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhClock: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhClock: Minute

Description

The Minute property sets or returns the minute setting of the clock. The default value is -1. The range is -1 to 59.

Syntax

ctlname.Minute = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Hour, Second


MhClock: MinuteBottom

Description

The MinuteBottom property sets or returns the bottom position of the minute display (in the control's ScaleMode) relative to the bottom border of the control. This property is valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.MinuteBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourBottom, SecondBottom


MhClock: MinuteHandLen

Description

The MinuteHandLen property sets or returns the length of the minute hand for an analog clock. The default value is 90. The range is zero to 100. Note that this property is expressed as a percentage of the total area available to the minute hand (defined by MinuteWidth and MinuteHeight).

Syntax

ctlname.MinuteHandLen = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinuteHeight, MinuteWidth


MhClock: MinuteHandWidth

Description

The MinuteHandWidth property sets or returns the width (in the control's ScaleMode) of the minute hand. The default value is 30. The range is zero to 32,767.

Syntax

ctlname.MinuteHandWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourHandWidth, SecondHandWidth


MhClock: MinuteHeight

Description

The MinuteHeight property sets or returns the height (in the control's ScaleMode) available to the minute display. This property is valid for both digital and analog clocks. The default value is the control's default height. The range is zero to 32,767.

Syntax

ctlname.MinuteHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourHeight, SecondHeight


MhClock: MinuteLeft

Description

The MinuteLeft property sets or return the left position of the minute display (in the control's ScaleMode) relative to the left border of the control. This property is valid for both digital and analog clocks. The default value is 1/3 of the default width of the control. The range is zero to 32,767.

Syntax

ctlname.MinuteLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourLeft, SecondLeft


MhClock: MinuteRight

Description

The MinuteRight property sets or return the right position of the minute display (in the control's ScaleMode) relative to the right border of the control. This property is valid for both digital and analog clocks. The default value is 1/3 of the default width of the control. The range is zero to 32,767.

Syntax

ctlname.MinuteRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourRight, SecondRight


MhClock: MinuteTop

Description

The MinuteTop property sets or returns the top position of the minute display (in the control's ScaleMode) relative to the top border of the control. These properties are valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.MinuteTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourTop, SecondTop


MhClock: MinuteWidth

Description

The MinuteWidth property sets or returns the width (in the control's ScaleMode) available to the minute display. This property is valid for both digital and analog clocks. The default value is 1/3 the default width of the control. The range is zero to 32,767.

Syntax

ctlname.MinuteWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourWidth, SecondWidth


MhClock: PictureAClock

Description

The PictureAClock property sets or returns the image (bitmap or icon) displayed within the control when the style of the clock is set to one of the analog types.

Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the PictureAClock property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

Note that when no picture is loaded, the control displays a set of tick marks for the analog clock.

Syntax

ctlname.PictureAClock = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDClock


MhClock: PictureDClock

Description

The PictureDClock sets or returns the image (bitmap or icon) displayed within the control when the style of the clock is set to one of the digital types.

Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the PictureDClock property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

Note that when no picture is loaded, the control displays a border around the digital clock.

Syntax

ctlname.PictureDClock = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureAClock


MhClock: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhClock: Second

Description

The Second property sets or returns the second setting of the clock. The default value is -1. The range is -1 to 59.

Syntax

ctlname.Second = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Hour, Minute


MhClock: SecondBottom

Description

The SecondBottom property sets or returns the bottom position of the second display (in the control's ScaleMode) relative to the bottom border of the control. This property is valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.SecondBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourBottom, MinuteBottom


MhClock: SecondHandLen

Description

The SecondHandLen property sets or returns the length of the second hand for an analog clock. The default value is 90. The range is zero to 100. Note that this property is expressed as a percentage of the total area available to the second hand (defined by SecondWidth and SecondHeight).

Syntax

ctlname.SecondHandLen = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SecondHeight, SecondWidth


MhClock: SecondHandWidth

Description

The SecondHandWidth property sets or returns the width (in the control's ScaleMode) of the second hand. The default value is 30. The range is zero to 32,767.

Syntax

ctlname.SecondHandWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourHandWidth, MinuteHandWidth


MhClock: SecondHeight

Description

The SecondHeight property sets or returns the height (in the control's ScaleMode) available to the second display. This property is valid for both digital and analog clocks. The default value is the control's default height. The range is zero to 32,767.

Syntax

ctlname.SecondHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourHeight, MinuteHeight


MhClock: SecondLeft

Description

The SecondLeft property sets or return the left position of the second display (in the control's ScaleMode) relative to the left border of the control. This property is valid for both digital and analog clocks. The default value is 2/3 of the default width of the control. The range is zero to 32,767.

Syntax

ctlname.SecondLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourLeft, MinuteLeft


MhClock: SecondRight

Description

The SecondRight property sets or return the right position of the second display (in the control's ScaleMode) relative to the right border of the control. This property is valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.SecondRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourRight, MinuteRight


MhClock: SecondTop

Description

The SecondTop property sets or returns the top position of the second display (in the control's ScaleMode) relative to the top border of the control. These properties are valid for both digital and analog clocks. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.SecondTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourTop, MinuteTop


MhClock: SecondWidth

Description

The SecondWidth property sets or returns the width (in the control's ScaleMode) available to the second display. This property is valid for both digital and analog clocks. The default value is 1/3 the default width of the control. The range is zero to 32,767.

Syntax

ctlname.SecondWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HourWidth, MinuteWidth


MhClock: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhClock: ShowMinimized

Description

The ShowMinimized property sets or returns the action taken by the control when its form is minimized. The valid settings for the ShowMinimized property follow:

Setting	Description

True (-1)	Clock is displayed in the icon area of the form while the form is minimized. You must size the clock so that it appears properly in the icon area.

False (0)	(Default) The form's icon appears while the form is minimized.

Syntax

ctlname.ShowMinimized = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhClock: Style

Description

The Style property sets or returns the clock style. The valid settings for the Style property follow:

Setting	Description

0	(Default) Digital 12 hour.

1	Digital 12 hour with seconds.

2	Digital 24 hour.

3	Digital 24 hour with seconds.

4	Analog 12 hour.

5	Analog 12 hour with seconds.

6	Analog 24 hour.

7	Analog 24 hour with seconds.

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShowMinimized


MhClock: TextColor

Description

The TextColor property sets or returns the colors used to draw the text, needles and markings displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhClock: Alarm

Description

The Alarm event occurs when the alarm time is reached. You should code any action for the alarm in this procedure.

Syntax

Sub ctlname_Alarm()


MhClock: ChangeHour

Description

The ChangeHour event occurs when the Hour property changes. You can put code for special effects (such as ringing chimes) in this procedure to ring at the change of the hour.

Syntax

Sub ctlname_ChangeHour()


MhClock: ChangeMinute

Description

The ChangeMinute event occurs when the Minute property changes. You can place code in this procedure for any action you want to occur once per minute.

Syntax

Sub ctlname_ChangeMinute()


MhClock: ChangeSecond

Description

The ChangeSecond property occurs when the Second property changes. If you want a clock that ticks, you can put code here to invoke the sound effect.

Syntax

Sub ctlname_ChangeSecond()


MhClock: Overview

The MhClock control lets you display clocks in digital and analog form. In addition to an alarm feature, MhClock provides default clock images and 3-D effects. You may also specify your own bitmaps to display. The following figure shows an example MhClock control. The following table provides an overview of the MhClock control.

MhClock Control Example.

MhClock Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhClck16.OCX MhClck32.OCX MHCL200.VBX	MhClock	See the MHCLCK sample directory.		MhAlarm MhTimer
Development Notes

Using VB code, you can easily display the time using only numbers. The MhClock control enhances your project by displaying the image of a clock when you want to display the time.

Creating a custom bitmap for the MhClock control is a two-step process. First you must design the bitmap. Second, you must set the appropriate property values so the control knows where to display the individual time elements (Hour, Minute and Second) and their size. Before you start designing your bitmap, it's a good idea to know which values you must specify. There are two sets of properties that the MhClock control uses to figure out how to display the time:

-  The xxxLen and xxxWidth properties

-  The xxxHeight, xxxLeft, xxxTop, and xxxWidth properties

You must specify the xxxLen and xxxWidth properties for each of the hands of an analog clock. (You can ignore these properties when you create digital clocks.) For this set of properties, xxx stands for HourHand, MinuteHand and SecondHand. These values are expressed in pixels. As an example, you use the HourHandLen property to set the length of the hour hand on an analog clock to a specific number of pixels.

The xxxHeight, xxxLeft, xxxTop and xxxWidth properties specify an inner area on the custom bitmap where each time element is displayed. You must set these properties for both analog and digital clock bitmaps. In this set of properties, xxx stands for Hour, Minute and Second.

While you can calculate the inner area values, the MhClock control has mouse-sizing capabilities for each of these properties. Consequently, you can create a custom bitmap, then use the mouse to size each inner area to the proper size and drag the inner area to its desired location on your bitmap.

Use the PictureAClock property to specify the image for an analog clock, or the PictureDClock property to specify the image of a digital clock. Note that you must also set the Style property so the MhClock control knows whether to display the value of the Seconds property on your custom clock, as well as the time format (12- or 24-hour).

The functionality of the Hour, Minute and Second properties are slightly different in run mode than in design mode. At design time, they return the actual setting (zero or an offset). You set the property value to -1 to indicate the property should be set to the current time when the control is loaded. At run time, they return the current time, offset by the clock's setting, but setting all three properties to -1 causes them to return the current time. If one or more of these properties are set to a given time (or offset), the clock starts counting at that time and increments the properties accordingly. For example, to make the clock run 30 minutes fast, use the following code:

MhClock1.Hour = -1

MhClock1.Minute = -1

MhClock1.Second = -1

Temp% = MhClock1.Minute + 30

If Temp% > 59 Then

  MhClock1.Hour = MhClock1.Hour + 1

  MhClock1.Minute = MhClock1.Minute - 30

Else

  MhClock1.Minute = MhClock1.Minute + 30

End If

If all the alarm elements are set to -1, the alarm is off. Setting the alarm hour to zero effectively turns it off as well, because hour zero is never reached. If any Alarm property is set to a value other than -1, the alarm is activated.

The Alarm event procedure executes when:

(MhClock1.AlarmHour = MhClock1.Hour Or MhClock1.AlarmHour = -1) And

 (MhClock1.AlarmMinute = MhClock1.Minute Or MhClock1.AlarmMinute = -1) And

 (MhClock1.AlarmSecond = MhClock1.Second Or MhClock1.AlarmSecond = -1)

To ignore a particular element of the time for alarm purposes, leave that element set to -1. For example, to ring the alarm any time within the minute of 10:22 am, execute the following code:

MhClock1.AlarmHour = 10

MhClock1.AlarmMinute = 22

MhClock1.AlarmSecond = -1

In the above scenario, the Alarm event procedure will execute at 10:22. You should code any action for the alarm in the Alarm event procedure.

The MhClock control recognizes three additional custom events: ChangeHour, ChangeMinute and ChangeSecond. As each of these names imply, the control generates these events when the Hour, Minute and Second property values change. You can place code in these events to execute on a regular cycle, such as sounding a bell on the hour.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.


MhCommand: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhCommand Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhCommand: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the PictureUp bitmap. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the PictureUp bitmap.

False (0)	Stretch or shrink the bitmap to the size of the picture area.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUp


MhCommand: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhCommand: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhCommand: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhCommand: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhCommand: FillColor

Description

The FillColor property sets or returns the background color for the control. If an image is being used for the PictureUp or PictureDown property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PictureUp


MhCommand: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhCommand: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhCommand: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhCommand: PictureDown

Description

The PictureDown property sets or returns the image to display within the control when the button is down or when the StateButton and Value properties are True.

The PictureDown property is used in the same way as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run time, this property returns the picture's handle.

The image is displayed only when the button is a state button and it does not have the focus.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUp


MhCommand: PictureUp

Description

The PictureUp property sets or returns the image to display within the control when the left mouse button is not pressed or when the StateButton and Value properties are False.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run time, this property returns the picture's handle.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown


MhCommand: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhCommand: StateButton

Description

The StateButton property indicates whether the control acts like a normal VB command button or as a state (or toggle) button.  State buttons toggle between raised and depressed states. The valid settings for the StateButton property follow:

Setting	Description

True (-1)	Pressing the button causes the bitmaps to toggle. The PictureUp bitmap is displayed first (unless you change Value at design time). When you click the button, the PictureDown bitmap is displayed until you click the button again, when the PictureUp bitmap is redisplayed.

False (0)	(Default) The button bitmaps are displayed just like a VB command button. In other words, when the button is pressed, the PictureDown bitmap is displayed and when the button is not pressed, the PictureUp bitmap is displayed.

Syntax

ctlname.StateButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PictureUp


MhCommand: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhCommand: Value

Description

The Value property sets or returns the current state of the button (raised or depressed). The valid settings for the Value property follow:

Setting	Description

True (-1)	The button is depressed

False (0)	(Default) The button is raised

Syntax

ctlname.Value = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


MhCommand: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the images in the PictureUp and PictureDown properties if the AutoSize property is False. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PictureUp


MhCommand: Overview

The MhCommand control enhances the standard Visual Basic command button by providing multiline captions, alignment of the caption, and replacement of the standard button image with programmer-defined bitmaps. The following figure shows several examples of MhCommand controls. The following table provides an overview of the MhCommand control.

MhCommand Control Examples.

MhCommand Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhComd16.OCX MhComd32.OCX MHCM200.VBX	MhCommand	See the MHCOMD sample directory.		Mh3dButn MhTool
Development Notes

You'll find the MhCommand control useful when you need to display more than a single line of information on a button or when you want to replace the caption with a bitmap, which can make your programs more intuitive.

When you use bitmaps or icons in the MhCommand control, and you specify those bitmaps in the PictureDown and PictureUp properties at design time, the bitmaps become a part of your program. This means you do not have to distribute the bitmaps/icons separately with your programs. On the other hand, if you use the LoadPicture function to add bitmaps/icons at run time, then the files must be present at run time.

If you set the StateButton property to True at design-time, you can set the Value property to specify the startup state (up or down) of the control. If you specify bitmaps, using the PictureUp and PictureDown properties, the Value property determines which bitmap MhCommand displays when your program loads.

The directory containing the MHCOMMAN project has some bitmaps you may find useful when creating custom buttons.

The Bevelxxx properties can be used to create 3-D effects. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

Note:  Visual Basic does not support Default and Cancel properties for custom controls. In order to trap the Enter key or the Esc key, place code in the CtlName_KeyPress Sub to watch for KeyAscii = 13 and KeyAscii = 27, respectively. As with all other controls, if you detect KeyAscii = 13, you should immediately set it to zero to avoid unwanted beeps.

Caution:  If you set either the PictureDown or PictureUp properties, you must set both of them.


MhDateInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhDateInput Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhDateInput: AllowBlank

Description

The AllowBlank property indicates whether the control can be blank or whether it is automatically filled with the system date. The valid settings for the AllowBlank property follow:

Setting	Description

True	The control can be left blank.

False	The control is automatically filled with the system date and cannot be left blank.

Syntax

ctlname.AllowBlank = boolean%

Data Type

Boolean

Availability

Design-Time 	Run-Time Read     Run-Time Write

See Also

VAlignment


MhDateInput: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	(Default) The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhDateInput: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhDateInput: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhDateInput: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhDateInput: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhDateInput: CaretColor

Description

The CaretColor property sets or returns the color of the caret.

Syntax

ctlname.CaretColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhDateInput: CaretHeight

Description

The CaretHeight property sets or returns the height of the caret. The default setting is zero, in which case the caret is sized according to the current font.

Syntax

ctlname.CaretHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretWidth


MhDateInput: CaretInterval

Description

The CaretInterval property sets or returns the timer interval (in milliseconds) for the flashing caret. The default setting is zero, in which case the caret uses the system's default blink time.

Syntax

ctlname.CaretInterval = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhDateInput: CaretStyle

Description

The CaretStyle property sets or returns the shape of the caret. The valid settings for the CaretStyle property follow:

Setting	Description

0	(Default) Block.

1	Up arrow.

2	Down arrow.

Syntax

ctlname.CaretStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretColor, CaretInterval


MhDateInput: CaretVAlign

Description

The CaretVAlign property specifies where the caret is displayed within the control. The valid settings for the CaretVAlign property follow:

Setting	Description

0	(Default) The caret is positioned over the text.

1	The caret is positioned below the text.

2	The caret is positioned above the text.

Syntax

ctlname.CaretVAlign = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVisible


MhDateInput: CaretVisible

Description

The CaretVisible property indicates whether the caret is visible. The valid settings for the CaretVisible property follow:

Setting	Description

True (-1)	(Default) The caret is visible within the control.

False (0)	The caret is not visible within the control.

Syntax

ctlname.CaretVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVAlign


MhDateInput: CaretWidth

Description

The CaretWidth property sets or returns the width of the caret. The default setting is zero, in which case the caret is sized according to the system's border width.

Syntax

ctlname.CaretWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretHeight


MhDateInput: DateFormat

Description

The DateFormat property sets or returns the format of the date displayed in the control. The valid settings for the DateFormat property follow:

Setting	Description

0	(Default) Normal (12/31/95)

1	Julian (2450083)

2	Verbose (December 31, 1995)

3	Verbose with weekday (Sunday, December 31, 1995)

4	General (Microsoft Access format)

5	Long (determined by your WIN.INI setting)

6	Medium (31-DEC-95)

7	Short (determined by your WIN.INI setting)

Syntax

ctlname.DateFormat = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhDateInput: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhDateInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Setting	Description

True (-1)	All text in the control is automatically selected when the control receives the focus.

False (0)	The text in the control is not automatically selected.

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhDateInput: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhDateInput: Indent

Description

The Indent property sets or returns the amount of space (in pixels) between characters in the control and the control's border. The default is zero. The range is zero-32767. This property is useful when you specify a thin border and the control is in insert mode.

Syntax

ctlname.Indent = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhDateInput: Language

Description

The Language property sets or returns the language used to display the date in the control. The LanguageNumber property has the same functionality as Language, but uses an integer instead of a 3-character string. The valid settings for the Language property follow:

Setting	Description

WWW	(Default) Use the language currently specified in WIN.INI

DAN	Danish

DEU	German

ENG	UK Eng

ENU	US Eng

ESN	New Spanish

ESP	Old Spanish

FIN	Finnish

FRA	French

FRC	French Canadian

ISL	Icelandic (US right now)

ITA	Italian

NLD	Dutch

NOR	Norwegian

PTG	Portuguese

SVE	Swedish

EPT	Esperanto

SER	Serbo-Croatian

Syntax

ctlname.Language = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LanguageNumber


MhDateInput: LanguageNumber

Description

The LanguageNumber property sets or returns the language used to display the date in the control. The Language property has the same functionality as LanguageNumber, but uses 3-character string instead of an integer.

Setting	Description

0	(Default) Use the language currently specified in WIN.INI

1	Danish

2	German

3	UK Eng

4	US Eng

5	New Spanish

6	Old Spanish

7	Finnish

8	French

9	French Canadian

10	Icelandic (US right now)

11	Italian

12	Dutch

13	Norwegian

14	Portuguese

15	Swedish

16	Esperanto

17	Serbo-Croatian

Syntax

ctlname.LanguageNumber = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Language


MhDateInput: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhDateInput: MaxDay

Description

The MaxDay property sets or returns the maximum date that may be entered in the control. If a day greater than MaxDay is entered into the control, it is adjusted to MaxDay. The default value is 31. The range is 1 to 31.

Syntax

ctlname.MaxDay = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinDay


MhDateInput: MaxMonth

Description

The MaxMonth property sets or returns the maximum month that may be entered in the control. If a month greater than MaxMonth is entered into the control, it is adjusted to MaxMonth. The default value is 12. The range is 1 to 12.

Syntax

ctlname.MaxMonth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinMonth


MhDateInput: MaxYear

Description

The MaxYear property sets or returns the maximum year that may be entered in the control. If a year greater than MaxYear is entered into the control, it is adjusted to MaxYear. The default value is 9999. The range is 0 to 9999.

Syntax

ctlname.MaxYear = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinYear


MhDateInput: MinDay

Description

The MinDay property sets or returns the minimum day that may be entered in the control. If a day less than MinDay is entered into the control, it is adjusted to MinDay. The default value is 31. The range is 1 to 31.

Syntax

ctlname.MinDay = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxDay


MhDateInput: MinMonth

Description

The MinMonth property sets or returns the minimum month that may be entered in the control. If a month less than MinMonth is entered into the control, it is adjusted to MinMonth. The default value is 12. The range is 1 to 12.

Syntax

ctlname.MinMonth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxMonth


MhDateInput: MinYear

Description

The MinYear property sets or returns the minimum year that may be entered in the control. If a year less than MinYear is entered into the control, it is adjusted to MinYear. The default value is 0. The range is 0 to 9999.

Syntax

ctlname.MinYear = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxYear


MhDateInput: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	The control does not allow its contents to be edited.

False (0)	(Default) The control allows its contents to be edited.

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time 	Run-Time Read     Run-Time Write


MhDateInput: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows.Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhDateInput: Spin

Description

The Spin property defines where the spin buttons (if any) are positioned within the control. The valid settings for the Spin property follow:

Setting	Description

0	(Default) The control does not display spin buttons.

1	The spin buttons are aligned to the left.

2	The spin buttons are aligned to the right.

Syntax

ctlname.Spin = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SpinChange, SpinDelay, SpinSpeed


MhDateInput: SpinChange

Description

The SpinChange property specifies the amount to increment/decrement the value of the control when the spin buttons are used. The default value is one.

Syntax

ctlname.SpinChange = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin


MhDateInput: SpinDelay

Description

The SpinDelay property sets or returns the amount of time (in milliseconds) that occurs before the first repeat when using the spin buttons. The default value is 500 milliseconds. The delay that occurs between successive repeats is determined by the SpinSpeed property.

Syntax

ctlname.SpinDelay = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin


MhDateInput: SpinSpeed

Description

The SpinSpeed property sets or returns the amount of time (in milliseconds) that occurs between each repeat when using the spin buttons. The default value is 100 milliseconds. The initial delay before the first repeat is determined by the SpinDelay property.

Syntax

ctlname.SpinSpeed = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin


MhDateInput: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhDateInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = setting%

Data Type

Integer

Availability

Run-Time Write


MhDateInput: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhDateInput: AutoTerminate

Description

The AutoTerminate event occurs when a valid key is pressed while the caret is on the last character of the control. The AutoTerminate event lets you automatically SetFocus to another control when the user has filled the control with the desired number of characters.

Syntax

CtlName_AutoTerminate(KeyAscii As Integer)


MhDateInput: InvalidEntry

Description

The InvalidEntry event occurs when the date within the control is outside the Maxxxx or Minxxx properties and the control loses the focus.

Syntax

Sub ctlname_InvalidEntry()


MhDateInput: InvalidSetText

Description

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The Cancel parameter determines whether the invalid text is accepted by the control. If you set Cancel to True, the invalid text is not accepted. If Cancel is False, and you do not change the InvalidText string yourself, the text is accepted regardless of any invalid characters.

The InvalidText parameter contains the invalid text string that is being set into the control. You can clean up or override the invalid text simply by setting the InvalidText string to the desired string. If you do not set Cancel to True, the control will receive the modified InvalidText string.

Syntax

Sub ctlname_InvalidSetText(Cancel As Integer, InvalidText As String)


MhDateInput: Overview

The MhDateInput control is an enhanced version of the VB text box control and is designed specifically for entering dates. MhDateInput is ideal for data entry applications and other situations where you want to restrict user input to a certain range of dates. MhDateInput features the following:

-  Eight different date formats, including the ability to use the Long and Short date formats defined in the Control Panel.

-  Seventeen language options, plus the ability to use the current Language setting in the Control Panel.

-  Optional built-in spin buttons, with complete control over the position, decrement/decrement values and repeat rate.

-  Optional horizontal scrolling when the text length exceeds the physical width of the control.

-  Horizontal and vertical alignment of the text.

-  Optional 3-D effects.

-  Complete control over the size, appearance and behavior of the caret.

-  The ability to define minimum and maximum dates allowed by the control.

-  Custom events that occur when an invalid entry is made, or when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The following figure shows several examples of MhDateInput controls. The following table provides an overview of the MhDateInput control.

MhDateInput Control Examples.

MhDateInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhDInp16.OCX MhDInp32.OCX MHINDAT.VBX	MhDateInput	See the MHDATE sample directory.		Mh3dCalendar MhInput MhIntInput MhMaskInput MhRealInput
Development Notes

The Minxxx and Maxxxx properties define the range of dates that may be entered in the control. These dates must be in the range 0 to 9999.

Because of the increased range of years with this control, we must make some adjustments if you use 2 digit years. Two digit years can cover only a 100 year range. When you first change to a two digit year, the MinYear will be set to the current year - 65 and MaxYear will be set to the current Year + 34. You may change this range, but it must cover only 100 years when using 2 digit years.

This could cause a problem if you switch between four and two digit years. When switching back to four digit years, the MinYear and MaxYear are not adjusted and will continue to have this 100 year range unless you change it.

The DateFormat property determines how the date is formatted by the control. The following date formats are supported:

0 - Normal ("12/31/95") - mm/dd/yy

1 - Julian ("2450083")

2 - Verbose ("December 31, 1995") - mmmm d, yyyy

3 - Verbose with weekday ("Sunday, December 31, 1995") - dddd, mmmm d, yyyy

4 - General (Microsoft Access format)

5 - Long (determined by your WIN.INI setting)

6 - Medium ("31-DEC-95") - dd-mmm-yy

7 - Short (determined by your WIN.INI setting)

Control Panel settings are honored only if the DateFormat property is set to either 4 or 7.

The Language and LanguageNumber properties provide two ways of specifying the language used to display the date. MhDateInput currently supports seventeen languages, plus the ability to use the current Language setting in the Control Panel.

The AutoHScroll property determines whether the text is scrolled horizontally when its length exceeds the physical width of the control. When AutoHScroll is False, the number of characters that can be entered in the text box is limited by the physical width of the control.

The Alignment and VAlignment properties allow you to align the text horizontally and vertically within the control.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles. The Caretxxx properties give you complete control over the size, appearance and behavior of the caret.

The Spin property determines where the spin buttons (if any) are positioned within the control, and the remaining Spinxxx properties allow you to set the increment/decrement value, and repeat rate.

The InvalidEntry event occurs when the date value within the control is outside the date range defined by the Maxxxx or Minxxx properties, and the control loses the focus. The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.


MhDial: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area when a bitmap is assigned to the Picture property. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	Size the control to the size of the bitmap.

False (0)	(Default) Do not resize to the size of the bitmap.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhDial: BorderColor

Description

The BorderColor property sets or returns the color of the outer border of the control.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhDial: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhDial: DialBorderColor

Description

The DialBorderColor property sets or returns the color of the dial's border.

Syntax

ctlname.DialBorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialBorderStyle


MhDial: DialBorderStyle

Description

The DialBorderStyle property sets or returns the style of the circular border around the dial. The valid settings for the DialBorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.DialBorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialBorderColor


MhDial: DialColor

Description

The DialColor property sets or returns the color used for the dial.

Syntax

ctlname.DialColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialBorderColor


MhDial: DialRadius

Description

The DialRadius property sets or returns the percentage (0-100) of the dial based on the smaller of Width or Height. The default value is 90.

Syntax

ctlname.DialRadius = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialVisible


MhDial: DialVisible

Description

The DialVisible property indicates whether the dial and its border are visible. When using a bit-mapped dial, the dial normally looks best if you set this property to False. The valid settings for the DialVisible property follow:

Setting	Description

True (-1)	(Default) Dial is visible.

False (0)	Dial is not visible.

Syntax

ctlname.DialVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialRadius


MhDial: Direction

Description

The Direction property sets or returns the direction that Value increases. The valid settings for the Direction property follow:

Setting	Description

0	(Default) Counter Clockwise.

1	Clockwise.

Syntax

ctlname.Direction = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Value


MhDial: IndicatorColor

Description

The IndicatorColor property sets or returns the color used for the indicator.

Syntax

ctlname.IndicatorColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IndicatorStyle


MhDial: IndicatorInner

Description

The IndicatorInner property sets or returns the percentage (0 - 100) of the inner edge of the indicator based on the smaller of Height or Width. The default IndicatorInner setting is 65.

Syntax

ctlname.IndicatorInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IndicatorOuter


MhDial: IndicatorOuter

Description

The IndicatorOuter property sets or returns the percentage (0 - 100) of the outer edge of the indicator based on the smaller of Height or Width. The default IndicatorInner setting is 80.

Syntax

ctlname.IndicatorOuter = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IndicatorInner


MhDial: IndicatorStyle

Description

The IndicatorStyle property sets or returns the style of the indicator. The valid settings for the IndicatorStyle property follow:

Setting	Description

0	Line

1	(Default) Circle

2	Triangle

Syntax

ctlname.IndicatorStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IndicatorColor


MhDial: MaxDegrees

Description

The MaxDegrees property sets or returns the ending point (in degrees) of the indicator. The default MaxDegrees setting is 585. The range is 0 to 2,147,483,647. MaxDegrees must be greater than both zero and MinDegrees.

Syntax

ctlname.MaxDegrees = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinDegrees


MhDial: MaxValue

Description

The MaxValue property sets or returns the maximum allowable value. The default MaxValue setting is 100. The range is -2,147,483,647 to 2,147,483,648.  MaxValue must be greater than or equal to MinValue.

Syntax

ctlname.MaxValue = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinValue


MhDial: MinDegrees

Description

The MinDegrees property sets or returns the starting point (in degrees) of the indicator. The default MinDegrees setting is 315. The range is 0 to 2,147,483,647. MinDegrees must be greater than zero and less than MaxDegrees.

Syntax

ctlname.MinDegrees = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxDegrees


MhDial: MinValue

Description

The MinValue property sets or returns the minimum allowable value. The default MaxValue setting is 0. The range is -2,147,483,647 to 2,147,483,648. MinValue must be less than or equal to MaxValue.

Syntax

ctlname.MinValue = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxValue


MhDial: NeedleWidth

Description

The NeedleWidth property sets or returns the line width (in pixels) of the indicator needle. The default value is one pixel. This property is only valid when the IndicatorStyle property is set to zero (line).

Syntax

ctlname.NeedleWidth = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IndicatorStyle


MhDial: Picture

Description

The Picture property specifies the graphics image to be displayed in the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the Picture property equal to the picture property of another control. Unless indicated otherwise below, you may select .BMP or .ICO files for this property. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WallPaper


MhDial: Steps

Description

The Steps property sets or returns the number of steps from MinValue to MaxValue. The default is 101. The minimum value setting is one. There is no required correlation between Steps and Ticks; however, we recommend that you set this up so the each step falls on a ticks. In other words, if MaxDegrees - MinDegrees  is less than 360, you have only a partial dial. If MaxValue is 100 and MinValue is zero, both Steps and Ticks could be set to 11 so the indicator would always step to a tick at 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.

Note:  Ticks is the number of ticks that are drawn around the dial. If the dial is multi-turn (MaxDegrees - MinDegrees >= 360) then the tick marks subdivide 360 degrees.

Syntax

ctlname.Steps = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Ticks


MhDial: TextColor

Description

The TextColor property sets or returns the foreground color of the caption.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TickMarkColor


MhDial: TickMarkColor

Description

The TickMarkColor property sets or returns the color used for the tick marks on a dial.

Syntax

ctlname.TickMarkColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TickMarkWidth


MhDial: TickMarkInner

Description

The TickMarkInner property sets or returns the percentage (0 - 100) of the inner radius of the tick marks, based on the smaller of Height or Width. The default value is 90.

Syntax

ctlname.TickMarkInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TickMarkOuter


MhDial: TickMarkOuter

Description

The TickMarkOuter property sets or returns the percentage (0 - 100) of the outer radius of the tick marks, based on the smaller of Height or Width.

Syntax

ctlname.TickMarkOuter = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TickMarkInner


MhDial: TickMarkWidth

Description

The TickMarkWidth property sets or returns the width (in pixels) of the tick mark lines. The default value is one.

Syntax

ctlname.TickMarkWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TickMarkColor


MhDial: Ticks

Description

The Ticks property sets or returns the number of tick marks to draw around the dial. The default value is 11. There is no required correlation between Steps and Ticks; however, we recommend that you set this up so the each step falls on a ticks. In other words, if MaxDegrees - MinDegrees is less than 360, you have only a partial dial. If MaxValue is 100 and MinValue is zero, both Steps and Ticks could be set to 11 so the indicator would always step to a tick at 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.

Note:  Ticks is the number of ticks that are drawn around the dial. If the dial is multi-turn (MaxDegrees - MinDegrees >= 360) then the tick marks subdivide 360 degrees.

Syntax

ctlname.Ticks = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Steps


MhDial: Value

Description

The Value property sets or returns the value of the control. Setting the value moves the indicator to the corresponding position. The default value is zero. The range is MinValue to MaxValue.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxValue, MinValue


MhDial: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt.  The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhDial: WrapAround

Description

The WrapAround property indicates whether the indicator will continue or halt once the MinValue or MaxValue has been reached.

Setting	Description

True (-1)	Once the MinValue or MaxValue has been reached, the indicator will wrap around. This is much like the operation of a clock. In other words, once 12 has been reached, the indicators continue on to 1.

False (0)	(Default) The indicator will halt once the MinValue or MaxValue has been reached until receiving further user input. This is much like the operation of a speedometer. In other words, once the maximum value has been attained, it will not continue to increase.

Syntax

ctlname.WrapAround = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxValue, MinValue


MhDial: ChangeValue

Description

The ChangeValue event occurs every time Value changes.

Syntax

Sub ctlname_ChangeValue(NewValue As Long)


MhDial: ClickIn

Description

The ClickIn event occurs when the mouse is clicked inside the dial.

Syntax

Sub ctlname_ClickIn(X As Single, Y As Single)


MhDial: ClickOut

Description

The ClickOut event occurs when the mouse is clicked outside the dial.

Syntax

Sub ctlname_ClickOut()


MhDial: MaxLimit

Description

The MaxLimit event occurs when MaxValue is reached.

Syntax

Sub ctlname_MaxLimit()


MhDial: MinLimit

Description

The MinLimit event occurs when MinValue is reached.

Syntax

Sub ctlname_MinLimit()


MhDial: Overview

The MhDial control is a potentiometer control similar to the volume control on most radios. The following figure shows a example MhDial control. The following table provides an overview of the MhDial control.

MhDial Control Example.

MhDial Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhDial16.OCX MhDial32.OCX MHDIAL.VBX	MhDial	See the MHDIAL sample directory.		MhSlide
Development Notes

The following figure shows the locations of the DialRadius, IndicatorInner, IndicatorOuter, TickMarkInner and TickMarkOuter properties in relation to the dial. All five properties are set as a percentage of the radius of the circle. The radius is the smaller of the Height and Width of the control. Note that the sizes of the indicator and the tick marks remain constant although rotated around the center of the circle. Also note that the center of the circle is always the center of the control.

MhDial Property Locations.

Percentages are used for all radii to allow the control to automatically maintain proper proportions when resized.

MhDial may be set up to go around as much or as little of a circle as you like. In fact, it can be made to go around the circle multiple times for more precision.

Degrees in MhDial are used as in trigonometry: zero degrees is to the right and degrees increase counter-clockwise. Of course, 360 degrees is one full circle. However, MhDial is not limited to 360 degrees.

MhDial has a simple dial bitmap, supplied in four different sizes, that you can use or you may create your own bitmap. To use your own square bitmaps first create a new MhDial, set AutoSize to True, set DialVisible to False, ensure WallPaper = StretchBlt, then load the bitmap into the Picture property. The control will resize to the size of the bitmap. Next set IndicatorInner, IndicatorOuter, TickMarkInner, and TickMarkOuter to match your bitmap. If you load the bitmap into the Picture property at design-time, you don't have to distribute the bitmap with your product.

Operation of the control by the end user is accomplished as follows:

Mouse:  Click inside the dial and drag the mouse around to the desired value.

Keyboard:  As follows:

Key	Action

Up arrow	Increases Value by 1

Down arrow	Decreases Value by 1

Left arrow	Goes to next step up

Right arrow	Goes to next step down

Page Up	Goes up by one turn

Page Down	Goes down by one turn

Home	Goes to MinValue

End	Goes to MaxValue


MhRealInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhRealInput Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhRealInput: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	(Default) The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhRealInput: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhRealInput: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhRealInput: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhRealInput: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhRealInput: CaretColor

Description

The CaretColor property sets or returns the color of the caret.

Syntax

ctlname.CaretColor = integer%

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhRealInput: CaretHeight

Description

The CaretHeight property sets or returns the height of the caret. The default setting is zero, in which case the caret is sized according to the current font.

Syntax

ctlname.CaretHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretWidth


MhRealInput: CaretInterval

Description

The CaretInterval property sets or returns the timer interval (in milliseconds) for the flashing caret. The default setting is zero, in which case the caret uses the system's default blink time.

Syntax

ctlname.CaretInterval = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhRealInput: CaretStyle

Description

The CaretStyle property sets or returns the shape of the caret. The valid settings for the CaretStyle property follow:

Setting	Description

0	(Default) Block.

1	Up arrow.

2	Down arrow.

Syntax

ctlname.CaretStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretColor, CaretInterval


MhRealInput: CaretVAlign

Description

The CaretVAlign property specifies where the caret is displayed within the control. The valid settings for the CaretVAlign property follow:

Setting	Description

0	(Default) The caret is positioned over the text.

1	The caret is positioned below the text.

2	The caret is positioned above the text.

Syntax

ctlname.CaretVAlign = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVisible


MhRealInput: CaretVisible

Description

The CaretVisible property indicates whether the caret is visible. The valid settings for the CaretVisible property follow:

Setting	Description

True (-1)	(Default) The caret is visible within the control.

False (0)	The caret is not visible within the control.

Syntax

ctlname.CaretVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVAlign


MhRealInput: CaretWidth

Description

The CaretWidth property sets or returns the width of the caret. The default setting is zero, in which case the caret is sized according to the system's border width.

Syntax

ctlname.CaretWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretHeight


MhRealInput: DecimalPlaces

Description

The DecimalPlaces property sets or returns the number of decimal places that are displayed in the control. The default value is -1, in which case the control uses the Currency or Number Format (depending on the MoneyFormat value) defined in the Windows Control Panel. The range is -1 to 6. When DecimalPlaces is non-zero, the cursor is initially located in the whole digits area. Once data entry begins and the decimal point is reached, the cursor automatically moves to the fractional part of the field.

Syntax

ctlname.DecimalPlaces = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MoneyFormat


MhRealInput: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = setting%

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhRealInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Setting	Description

True (-1)	All text in the control is automatically selected when the control receives the focus.

False (0)	The text in the control is not automatically selected.

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhRealInput: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhRealInput: Indent

Description

The Indent property sets or returns the amount of space (in pixels) between characters in the control and the control's border. The default is zero. The range is zero to 32767. You can also use the VAlignment property to specify the vertical alignment (top, bottom or center) of the text within the control.

Syntax

ctlname.Indent = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhRealInput: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = setting%

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhRealInput: MaxReal

Description

The MaxReal property sets or returns the maximum value that may be entered in the control. The default value is 3.3E38. The range is the range of single precision numbers.

Syntax

ctlname.MaxReal = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinReal


MhRealInput: MinReal

Description

The MinReal property sets or returns the minimum value that may be entered in the control. The default value is -1.1E38. The range is the range of single precision numbers.

Syntax

ctlname.MinReal = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxReal


MhRealInput: MoneyFormat

Description

The MoneyFormat property indicates whether the value is formatted according to the Currency format or Number format specified in the Control Panel. The valid settings for the MoneyFormat property follow:

Setting	Description

True (-1)	The value if formatted according to the Control Panel Currency settings (currency symbol, number of decimal places, etc.).

False (0)	(Default) The value if formatted according to the Control Panel Number settings.

Syntax

ctlname.MoneyFormat = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DecimalPlaces


MhRealInput: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	The control does not allow its contents to be edited.

False (0)	(Default) The control allows its contents to be edited.

Syntax

ctlname.ReadOnly = setting%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhRealInput: Separator

Description

The Separator property indicates whether the value is displayed using the thousands separator defined in the Control Panel. The valid settings for the Separator property follow:

Setting	Description

True (-1)	Value is displayed using thousands separator defined in the Control Panel.

False (0)	(Default) Thousands separator defined in the Control Panel is not used.

Syntax

ctlname.Separator = setting%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MoneyFormat


MhRealInput: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhRealInput: Spin

Description

The Spin property defines where the spin buttons (if any) are positioned within the control. The valid settings for the Spin property follow:

Setting	Description

0	(Default) The control does not display spin buttons.

1	The spin buttons are aligned to the left.

2	The spin buttons are aligned to the right.

Syntax

ctlname.Spin = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SpinChangeReal, SpinDelay, SpinSpeed


MhRealInput: SpinChangeReal

Description

The SpinChangeReal property specifies the amount to increment/decrement the value of the control when the spin buttons are used. The default value is zero. The range is in the range of single precision numbers.

Syntax

ctlname.SpinChangeReal = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinDelay, SpinSpeed


MhRealInput: SpinDelay

Description

The SpinDelay property sets or returns the amount of time (in milliseconds) that occurs before the first repeat when using the spin buttons. The default value is 500 milliseconds. The delay that occurs between successive repeats is determined by the SpinSpeed property.

Syntax

ctlname.SpinDelay = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChangeReal, SpinSpeed


MhRealInput: SpinSpeed

Description

The SpinSpeed property sets or returns the amount of time (in milliseconds) that occurs between each repeat when using the spin buttons. The default value is 100 milliseconds. The initial delay before the first repeat is determined by the SpinDelay property.

Syntax

ctlname.SpinSpeed = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChangeReal, SpinDelay


MhRealInput: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhRealInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = setting%

Data Type

Integer

Availability

Run-Time Write


MhRealInput: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhRealInput: ValueReal

Description

The ValueReal property sets or returns the current contents of the control. The range is the range defined by the MaxReal and MinReal properties.

Syntax

ctlname.ValueReal = setting!

Data Type

Single Precision

Availability

Run-Time Read

Run-Time Write

See Also

MaxReal, MinReal


MhRealInput: AutoTerminate

Description

The AutoTerminate property occurs when a valid key is pressed while the caret is on the last character of the control. The AutoTerminate event lets you automatically SetFocus to another control when the user has filled the control with the desired number of characters

Syntax

CtlName_AutoTerminate()


MhRealInput: InvalidEntry

Description

The InvalidEntry event occurs when the value within the control is outside the MaxReal or MinReal properties and the control loses the focus.

Syntax

Sub ctlname_InvalidEntry()


MhRealInput: InvalidSetText

Description

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The Cancel parameter determines whether the invalid text is accepted by the control. If you set Cancel to True, the invalid text is not accepted. If Cancel is False, and you do not change the InvalidText string yourself, the text is accepted regardless of any invalid characters.

The InvalidText parameter contains the invalid text string that is being set into the control. You can clean up or override the invalid text simply by setting the InvalidText string to the desired string. If you do not set Cancel to True, the control will receive the modified InvalidText string.

Syntax

Sub ctlname_InvalidSetText(Cancel As Integer, InvalidText As String)


MhRealInput: Overview

The MhRealInput control is an enhanced version of the VB text box control that was designed specifically for entering real numbers and currency values. The value is displayed according to the Number or Currency settings defined in the Windows Control Panel. The MhRealInput control is ideal for data entry applications and other situations where you want to restrict user input to a certain range of real numbers or currency values. The MhRealInput control offers the following features:

-  Optional built-in spin buttons, with complete control over the position, decrement/decrement values and repeat rate.

-  Optional horizontal scrolling when the text length exceeds the physical width of the control.

-  Horizontal and vertical alignment of the text.

-  Optional 3-D effects.

-  Complete control over the size, appearance and behavior of the caret.

-  The ability to define minimum and maximum values allowed by the control.

-  Custom events that occur when an invalid entry is made, or when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The following figure shows several examples of MhRealInput controls. The following table provides an overview of the MhRealInput control.

MhRealInput Control Examples.

MhRealInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhRInp16.OCX MhRInp32.OCX MHINREL.VBX	MhRealInput	See the MHRINP sample directory.		MhDateInput MhInput MhIntInput MhMaskInput
Development Notes

When the MoneyFormat property is True, the value is formatted according to the Currency settings in the Control Panel. Otherwise, the Number settings are used to format the value.

The DecimalPlaces property determines the number of decimal places that are displayed in the control.  When DecimalPlaces is set to -1, the control uses the current Control Panel setting for decimal places.

The Separator property determines if the value is displayed using the thousands separator defined in the Control Panel.

The AutoHScroll property determines whether the text is scrolled horizontally when its length exceeds the physical width of the control. When AutoHScroll is False, the number of characters that can be entered in the text box is limited by the physical width of the control.

The MinReal and MaxReal properties define the range of real numbers that may be entered in the control. Note that when AutoHScroll is False (no horizontal scrolling), and the control is not wide enough to display the MaxReal value, the actual range is limited by the number of characters that will fit in the physical width of the control.

The Alignment and VAlignment properties allow you to align the text horizontally and vertically within the control.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

The Caretxxx properties give you complete control over the size, appearance and behavior of the caret.

The Spin property determines where the spin buttons (if any) are positioned within the control. The remaining Spinxxx properties allow you to set the increment/decrement value and repeat rate.

The InvalidEntry event occurs when the value within the control is outside the MaxReal or MinReal properties and the control loses the focus. The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.


Mh3dFrame: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dFrame Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	(Default) Align to left

1	Align to right

2	Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFrame: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dFrame: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dFrame: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dFrame: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dFrame: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dFrame: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFrame: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFrame: FormatString

Description

The FormatString property sets or returns the template used to format the caption within the control. This property is similar to the Visual Basic Format function. Usage is the same as the VB Format function. For example, if the Caption property is "100.1" and the FormatString is "$###,###.00", the caption is formatted and displayed as "$100.10".  By default, this property is null, indicating no formatting is performed. For more information about formatting, please refer to your Visual Basic documentation.

Syntax

ctlname.FormatString = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFrame: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dFrame: NoPrefix

Description

The NoPrefix property specifies whether ampersand characters (&) are displayed in the caption without requiring the use of double ampersands (&&). Note that the character immediately following the ampersand character is used as the access key for the control, regardless of the NoPrefix setting. The valid settings for the NoPrefix property follow:

Setting	Description

True (-1)	Ampersand characters are displayed and do not cause the next character to be underlined.

False (0)	(Default) Ampersand characters are not displayed unless you embed a double ampersand in the string. The next character after the ampersand is underlined.

Syntax

ctlname.NoPrefix = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFrame: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size. If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded. For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WallPaper


Mh3dFrame: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dFrame: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFrame: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images specified in the control's Picture properties. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as 	many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dFrame: Overview

The Mh3dFrame control is an enhanced version of the standard Visual Basic frame control. In addition to supporting all of the properties and features of the standard control, Mh3dFrame offers the following unique features:

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  The ability to align the caption and create a frame without a border

-  Display a picture on the background of the control

The following figure shows an example Mh3dFrame control. The following table provides an overview of the Mh3dFrame control.

Mh3dFrame Control Example.

Mh3dFrame Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhFram16.OCX MhFram32.OCX MHGFRM.VBX	Mh3dFrame	See the MHFRAM sample directory.		Mh3d
Development Notes

Since the MicroHelp list and combo box controls do not have the ability to create a 3-D border around their outer edge, you can place these controls within Mh3dFrame to provide a 3-D effect.

The standard VB frame control must always have a black border drawn around the inside perimeter of the control. The Mh3dFrame control can have a standard border, a border with rounded corners or even no border at all.  You can set the border color at both design and run time to draw attention to the frame or to indicate that the control has the focus.

Unlike the standard VB control, you can align the caption to the left, center, or right edge.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent.  While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

If an image is loaded into the Picture property, it is displayed inside any defined beveled area. The method used to paint the picture is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control.

The NoPrefix property allows you to modify the way VB handles the ampersand (&) character. When NoPrefix is FALSE, an ampersand causes the next character to appear underlined. If this property is TRUE, the ampersand will be treated as a valid character.

If the FontTransparent property is set to FALSE, the beveled area above the caption will not be visible. You must set this property to TRUE to have a beveled edge displayed on the top edge of the control above the caption.

If  this control is bound to a data control, the selected DataField will appear as the caption. The custom property FormatString will allow you to use the same formatting properties as VB Format$. The formatting changes only affect the appearance of the caption, not the actual data placed in the DataField.

Like the standard VB control, Mh3dFrame can be used as a container or parent for check and option controls.  It can also be used to give an exterior 3-D border appearance to those controls that only have BevelSizeInner properties (Mh3dCombo, Mh3dDir, Mh3dDrive, Mh3dFile and Mh3dList) as shown in the following example:


MhDice: FillColor

Description

The FillColor property sets or returns the color displayed in the body of the MhDice control. The body is the portion of the bitmap that doesn't contain the image of the die.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LeftSideColor, RightSideColor, TopSideColor


MhDice: LeftSideColor

Description

The LeftSideColor property sets or returns the color displayed on the left side of the die.

Syntax

ctlname.LeftSideColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

RightSideColor, TopSideColor


MhDice: Picture1

Description

The Picture1 property sets or returns the programmer-supplied picture used to display the number 1 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture1 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture2, Picture3, Picture4, Picture5, Picture6


MhDice: Picture2

Description

The Picture2 property sets or returns the programmer-supplied picture used to display the number 2 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture2 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture3, Picture4, Picture5, Picture6


MhDice: Picture3

Description

The Picture3 property sets or returns the programmer-supplied picture used to display the number 3 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture3 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture4, Picture5, Picture6


MhDice: Picture4

Description

The Picture4 property sets or returns the programmer-supplied picture used to display the number 4 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture4 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3, Picture5, Picture6


MhDice: Picture5

Description

The Picture5 property sets or returns the programmer-supplied picture used to display the number 5 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture5 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3, Picture4, Picture6


MhDice: Picture6

Description

The Picture6 property sets or returns the programmer-supplied picture used to display the number 6 for the die. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set this property equal to the picture property of another control. By default, there are no pictures loaded. At run time, this property returns the picture's handle. When no pictures are loaded, the control uses the default images.

Syntax

ctlname.Picture6 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3, Picture4, Picture5


MhDice: RightSideColor

Description

The RightSideColor property sets or returns the color displayed on the right side of the die.

Syntax

ctlname.RightSideColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LeftSideColor, TopSideColor


MhDice: TopSideColor

Description

The TopSideColor property sets or returns the color displayed on the top of the die.

Syntax

ctlname.TopSideColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LeftSideColor, RightSideColor


MhDice: Value

Description

The Value property indicates which image to display. By default, Value corresponds to the number on the top of the die. However, if an image has been assigned to the Picturex property corresponding to Value, that image would be displayed.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3, Picture4, Picture5, Picture6


MhDice: Overview

The MhDice control is a specialized picture box control that displays dice. The following figure shows the default MhDice bitmaps. The following table provides an overview of the MhDice control.

Default MhDice Bitmaps.

MhDice Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhDice16.OCX MhDice32.OCX MHDC200.VBX	MhDice	See the MHDICE sample directory.		MhCard
Development Notes

The bitmaps are designed to appear as if you're looking down at a die and you see three of its faces - left, right, and top - simultaneously.  To display a particular die using the default bitmaps, just set the Value property to the value you want to see on the top of the die.

You can use custom bitmap files in the place of the bitmaps shown above. After you've created six bitmap files, add one MhDice control to your application and set the Picturex properties to your custom bitmap files. Note that the MHDICE project contains dice drawn in red and black.

When you use bitmaps in the MhDice control and you specify those bitmaps in the Picturex properties at design time, the bitmaps become part of your program. This means you don't have to distribute the bitmaps with your programs. On the other hand, if you use the LoadPicture function to load pictures at run time, then the bitmap files must be present at run time.

You can specify the background color (the area that fills from the die edges to the border of the control) using the FillColor property, or you can set colors for each part of the dice bitmaps using the LeftSideColor, RightSideColor, and TopSideColor custom color properties. When you modify the colors at design time, you can use the VB color palette.


Mh3dButn: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dButn Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionRight, CaptionTop


Mh3dButn: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the PictureUp bitmap. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the PictureUp bitmap.

False (0)	Stretch or shrink the bitmap to the size of the picture area.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dButn: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dButn: CaptionBottom

Description

The CaptionBottom property sets or returns the bottom display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionBottom property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionBottom = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionLeft, CaptionRight, CaptionTop


Mh3dButn: CaptionLeft

Description

The CaptionLeft property sets or returns the left display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionLeft property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionLeft = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionRight, CaptionTop


Mh3dButn: CaptionRight

Description

The CaptionRight property sets or returns the right display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionRight property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionRight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionTop


Mh3dButn: CaptionTop

Description

The CaptionTop property sets or returns the top display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionTop property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionRight


Mh3dButn: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dButn: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dButn: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dButn: OuterFillColor

Description

The OuterFillColor property sets or returns the color that is displayed between the caption area and the outer border.

Syntax

ctlname.OuterFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextFillColor


Mh3dButn: PictureAutoSize

Description

The PictureAutoSize property specifies whether the control should automatically size the picture areas (as opposed to the entire control) according to the size of the Picturexxx bitmaps. The PictureAutoSize property differs from the AutoSize property in that it only affects the size of the picture area, not the entire control.

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the Picturexxx bitmaps.

False (0)	Stretch or shrink the bitmaps to the size of the picture area.

Syntax

ctlname.PictureAutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


Mh3dButn: PictureBottom

Description

The PictureBottom property sets or returns the bottom position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureBottom property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureBottom = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureLeft, PictureRight, PictureTop


Mh3dButn: PictureDisabled

Description

The PictureDisabled property sets or returns the image to display within the control when the Enabled property is False. The PictureDisabled property is used in the same way as the standard VB Picture property. You can use the LoadPicture function or set the PictureDisabled property equal to the picture property of another control. By default, there is no picture loaded. At run time, this property returns the picture's handle.

This picture is designed to be used in conjunction with PictureUp, PictureDown, and PicturePressed. It is displayed when the control is disabled regardless of the current value of the control. PictureDisabled is not used if Picture is used. In other words, Picture overrides PictureDisabled, PictureUp, PictureDown and PicturePressed. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture-related properties.

Syntax

ctlname.PictureDisabled = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PicturePressed, PictureUp


Mh3dButn: PictureDown

Description

The PictureDown property sets or returns the image to display within the control when the button is down and the StateButton property is True.

The PictureDown property is used in the same way as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded. At run time, this property returns the picture's handle.

The image is displayed only when the button is a state button and it does not have the focus.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dButn: PictureDownFocus

Description

The PictureDownFocus property sets or returns the image to display within the control when the button is down and the StateButton property is True.

The Mh3dButn control displays this bitmap only when the button is a state button and it has the focus. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDownFocus property equal to the picture property of another control. By default, there is no picture loaded. At run time, this property returns the picture's handle.

Syntax

ctlname.PictureDownFocus = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dButn: PictureLeft

Description

The PictureLeft property sets or returns the left position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureBottom property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureLeft = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureRight, PictureTop


Mh3dButn: PicturePressed

Description

The PicturePressed property sets or returns the image to display within the control when the button is pressed. The Mh3dButn control displays this bitmap when the mouse cursor is moved to the control and the left mouse button is held down. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PicturePressed property equal to the picture property of another control. By default, there is no picture loaded. At run time, this property returns the picture's handle.

Syntax

ctlname.PicturePressed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDisabled, PictureDown, PictureUp


Mh3dButn: PictureRight

Description

The PictureRight property sets or returns the right position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureRight property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureRight = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureLeft, PictureTop


Mh3dButn: PictureTop

Description

The PictureTop property sets or returns the top position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureTop property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureTop = picture

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureLeft, PictureRight


Mh3dButn: PictureUp

Description

The PictureUp property sets or returns the image to display within the control when the left mouse button is not pressed, the button does not have the focus, and the StateButton property is False.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. At run time, this property returns the picture's handle.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDisabled, PictureDown, PicturePressed


Mh3dButn: PictureUpFocus

Description

The PictureUpFocus property sets or returns the image to display within the control when the button is not down or pressed, the button has the focus, and the StateButton property is True.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUpFocus property equal to the picture property of another control. By default, there is no picture loaded. At run time, this property returns the picture's handle.

Syntax

ctlname.PictureUpFocus = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDownFocus, PictureUp


Mh3dButn: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dButn: StateButton

Description

The StateButton property indicates whether the control acts like a normal VB command button or as a state (or toggle) button. State buttons toggle between raised and depressed states. The valid settings for the StateButton property follow:

Setting	Description

True (-1)	Pressing the button causes the bitmaps to toggle. The PictureUp (or PictureUpFocus) bitmap is displayed first (unless you change Value at design time). When you click the button, the PictureDown (or PictureDownFocus) bitmap is displayed until you click the button again, when the PictureUp bitmap is redisplayed.

False (0)	(Default) The button bitmaps are displayed just like a VB command button. In other words, when the button is pressed, the PicturePressed bitmap is displayed and when the button is not pressed, the PictureUp bitmap is displayed.

Syntax

ctlname.StateButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PicturePressed, PictureUp


Mh3dButn: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dButn: TextFillColor

Description

The TextFillColor property sets or returns the background color of the caption.

Syntax

ctlname.TextFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dButn: Value

Description

The Value property sets or returns the current state of the button (raised or depressed). The valid settings for the Value property follow:

Setting	Description

True (-1)	The button is depressed

False (0)	(Default) The button is raised

Syntax

ctlname.Value = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dButn: Overview

The Mh3dButn control is an enhanced version of the standard Visual Basic command button. You can use it to create custom buttons that have 3-D effects, multiline captions and multiple bitmaps to represent different conditions. The following figure shows several Mh3dButn control examples. The following table provides an overview of the Mh3dButn control.

Mh3dButn Control Examples.

Mh3dButn Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhButn16.OCX MhButn32.OCX MH3B200.VBX	Mh3dButn	See the MHBUTN sample directory.		MhCommand, MhTool
Development Notes

The Mh3dButn custom control is similar in use to the standard Visual Basic command button control and the MhCommand custom control. Mh3dButn controls have several useful features as follows:

-  A 3-D appearance.

-  Multiline captions with programmer-specified alignments.

-  Control of all the colors used in the button.

-  Separate pictures for the up and down button states.

-  Ability to use the button as a state (or toggle) button with unique pictures for the up and down states. You can specify separate pictures when the control has the focus.

-  Caption and picture sizing using the Captionxxx and Picturexxx properties. Mouse sizing is available for these properties.

The Mh3dButn control gives you more control over the presentation of information in its caption space than a standard Visual Basic command button. You'll find the Mh3dButn control useful when you need to display more than one line of information (caption) on a button.

You have the option of adding a bitmap to the caption or replacing the caption with a bitmap image to make your programs more intuitive. The PictureUpxxx and PictureDownxxx properties let you specify unique bitmaps if your Mh3dButn control is a state button. If you don't specify any pictures, the control acts like a standard Visual Basic command button.

When you use bitmaps (or icons) in the Mh3dButn controls, and you specify those bitmaps in the Picturexxx properties at design time, the bitmaps become a part of your program. This means you don't have to distribute the bitmaps/icons with your programs. However, if you use LoadPicture to load pictures at run time, then the bitmap files must be present at run time.

If you set the StateButton property to True at design time, you can set the Value property to specify the startup state (up or down) of the control. If you specify bitmaps using the PictureDown, PictureDownFocus, PictureUp, and PictureUpFocus properties, the Value property determines which bitmap Mh3dButn displays when your program loads.

The samples\vb\bitmaps directory contains some bitmaps you may find useful when creating custom buttons. The bitmaps and their respective filenames (all having the extension .BMP) are shown below:

CANCELDN	CANCELUP

CNTRDN	CNTRUP

DIVDN	DIVUP

EQUALDN	EQUALUP

HELPDN	HELPUP

LEFTDN	LEFTUP

LJDN	LJUP

MINUSDN	MINUSUP

OKDN	OKUP

PLUSDN	PLUSUP

RIGHTDN	RIGHTUP

RJDN	RJUP

SQSMDN	SQSMUP

STARDN	STARUP

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

Note:  VB doesn't support Default and Cancel properties for custom controls. In order to trap <Enter> or <Esc>, place code in the KeyPress Sub to watch for KeyAscii = 13 and KeyAscii = 27. If you detect KeyAscii = 13, you should immediately set it to zero to avoid unwanted beeps.

Note:  If you set either the PictureDown or PictureUp property, you must set both of them.


Mh3dCommand: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dCommand Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


Mh3dCommand: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dCommand: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dCommand: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dCommand: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dCommand: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dCommand: DataMethod

Description

The DataMethod property sets or returns the action taken when the button is pressed and released. A Mh3dCommand button is not bound in the traditional sense. When the control is linked to a Data Control through the DataSource property, the DataMethod property specifies the action a button click will cause. This allows you to use Mh3dCommand buttons to replace the functionality of the buttons on the Data Control. If the StateButton property is set to True, the DataMethod property is ignored.

The valid settings for the DataMethod property follow:

Setting	Description

0	(Default) None

1	Move First

2	Move Last

3	Move Previous

4	Move Next

Syntax

ctlname.DataMethod = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dCommand: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCommand: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCommand: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dCommand: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dCommand: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded. For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PicturePressed, PictureUp


Mh3dCommand: PictureDown

Description

The PictureDown property specifies the graphics image to be displayed when the key is down. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run time, this property returns the picture's handle.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties.

The valid settings for the PictureDown property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PicturePressed, PictureUp


Mh3dCommand: PicturePressed

Description

The PicturePressed property specifies the graphics image to be displayed while the control is pressed.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PicturePressed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PicturePressed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureDown, PictureUp


Mh3dCommand: PictureUp

Description

The PictureUp property specifies the graphics image to be displayed when the control is in an up state. This property is normally write-only. If you read the PictureUp property at run time, an integer value is returned. If an image is loaded in this property, the return value is non-zero; otherwise, an empty or unused PictureUp property is returned as zero.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run time, this property returns the picture's handle.

Please refer to Description in the Picture property for more information on the loading and saving of images in the picture related properties.

The valid settings for the PictureUp property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureDown, PicturePressed


Mh3dCommand: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dCommand: StateButton

Description

The StateButton property indicates whether the control acts like a normal VB command button or as a state (or toggle) button. State buttons toggle between raised and depressed states. The valid settings for the StateButton property follow:

Setting	Description

True (-1)	Pressing the button causes the control to change between the raised and depressed states, toggling the Value property between zero (raised) and -1 (depressed). The PictureUp image is displayed when the Value property is zero, the PicturePressed image is displayed while the button is being depressed and the PictureDown image while the Value property equals -1.

False (0)	(Default) The control acts like a normal VB command button. The PictureUp property is displayed except when the button is being depressed. While pressed, the control shows the image placed in the PictureDown property.

Syntax

ctlname.StateButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PicturePressed, PictureUp, Value


Mh3dCommand: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dCommand: Value

Description

The Value property sets or returns the current state of the button (raised or depressed). The valid settings for the Value property follow:

Setting	Description

True (-1)	The button is depressed

False (0)	(Default) The button is raised

Syntax

ctlname.Value = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dCommand: WallPaper

Description

The WallPaper property sets or returns the method used to display the image in the Picture property if the AutoSize property is False.

The selected method is used to display all images loaded into the control's Picture properties. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dCommand: Overview

The Mh3dCommand control is an enhanced version of the standard Visual Basic command button control. In addition to supporting most of the properties and features of the standard control, Mh3dCommand has several unique features.

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  A multi or single line caption that can be aligned

-  The ability to display pictures for the three different states: Down, Pressed and Up

-  Create a state button -- one that can be toggled between the up and down positions

The following table provides an overview of the Mh3dCommand control.

Mh3dCommand Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhCmd16.OCX MhCmd32.OCX MHGCMD.VBX	Mh3dCommand	See the  MHCMD sample directory.		Mh3dButn
Development Notes

When the control is depressed, both the button and its shadow shift down and to the right.

The BevelSize and BevelStyle properties control the width and type of the 3-D effect for the control respectively. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings.  The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

Setting the MultiLine property to TRUE causes the caption to be word-wrapped like the standard Visual Basic text control.

The Alignment property controls the horizontal alignment of the caption within the control in the same manner as a standard Visual Basic label.

While the Mh3dCommand control can be bound to a Visual Basic Data Control, it does not have a DataField property so it cannot be used to update any field within the linked source. Its purpose is to act as a replacement for the VB Data Control. The action taken by a button press is determined by the DataMethod property. If the StateButton property is set to True, the DataMethod property is ignored.

Using the PictureDown, PictureUp and PicturePressed properties, you can display a different image for the background of this control to graphically represent the different states. The method used to paint these pictures is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. If you are using dark images in any of these properties, you may want to set the TextColor property to a lighter color so the caption will remain legible. When setting an image into one of the Picturexxx properties, you may want to first set the AutoSize property to FALSE to prevent the control from being resized to the dimensions of the picture.

A standard VB command button always returns to an up position when the mouse pointer is moved from the control or the left button is released. By setting the State property to TRUE, you can make an Mh3dCommand button remain in the down or depressed state when it is clicked. A subsequent click returns the control to the up position. The current state of the control can be set/returned with the Value property. A value of zero indicates the control is in the up position, while a value of -1 is returned when the button is depressed. Setting the Value property at run time causes the control's Click event to be fired. If you place code in the Click event that can cause the same event to be fired, you will probably have a problem with recursion that results in an Out of Stack Space error. To prevent this error, add a static variable to the procedure that is set to TRUE when code is executed that fires the event.  For example:

Sub Mh3dCommand1_Click ()

Static Active%

If Active% Then  	'Our code caused event

Active% = FALSE	'Clear flag and get out

Exit Sub

Else

Active% = TRUE	'Next line causes event

Mh3dCommand1.Value = FALSE

End If

End Sub


MhMulti: AutoSize

Description

The AutoSize property sets or returns whether the control should automatically size itself according to the size of the built-in bitmaps. The valid settings for the AutoSize properties follow:

Setting	Description

True (-1)	(Default) Size the control to the size of the selected built-in bitmap.

False (0)	Stretch or shrink the selected built-in bitmap to the size of the control.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMulti: AutoSwitch

Description

The AutoSwitch property indicates whether the control automatically changes the Value property (i.e., changes the color) when the control is clicked. The valid settings for the AutoSwitch property follow:

Setting	Description

0	(Default) Do not automatically cycle.

1	Cycle between red and green.

2	Cycle between red, yellow and green.

3	Cycle between red, yellow, green and gray.

Syntax

ctlname.AutoSwitch = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Value


MhMulti: Style

Description

The Style property indicates which bitmaps are used when the control is painted. The valid settings for the Style property follow:

Setting	Description

0	(Default) Stop Light

1	Large colored buttons

2	Small colored buttons

3	Electric Switch

4	Faces

Syntax

ctlname.Style = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Value


MhMulti: Value

Description

The Value property sets or returns the state (color) of the control. The valid settings for the Value property follow:

Setting	Description

0	Red (Stop)

1	Yellow (Warning)

2	Green (Go)

3	Grayed

Syntax

ctlname.Value = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhMulti : Overview

The MhMulti control is similar to the standard Visual Basic command button control but has the ability to display five different images. You can display each version of the control in four different states, indicated by a change in color of part or all of the control. You decide if the user can change the state of the control by clicking it or if the state of the control changes only from code. The following table provides an overview of the MhMulti control.

MhMulti Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhMult16.OCX MhMult32.OCX MHML200.VBX	MhMultiple	See the MHMULT sample directory.	N/A	MhAlarm,  Mh3dButn
Development Notes

MhMulti controls are useful when you want a single button control to represent several values. If you wanted to accomplish a similar function using standard VB controls, you would create a control array of Command or Option Buttons within a frame. Because you can use a single MhMulti control to replace a control array, you can reduce the amount of space on your form devoted to representing sets of values.

To better understand this concept, consider the standard command button control. When the user clicks on the button, the control appears to be pushed down. When the user releases the mouse, the button appears to come up. Using the MhMulti custom control, this behavior is emulated by setting the AutoSwitch property to one (2-way auto-switching).

Think of a standard button. Now suppose you don't want the button to change its appearance when the user clicks on it. In this case, you would set the AutoSwitch property to zero. This allows you to control which bitmap appears in the control at any given time.

The AutoSwitch property allows you to select 3-way and 4-way switching. When the user clicks on the control automatically cycles the Value property through the range you select in the AutoSwitch property:

AutoSwitch	Reaction to Click

0	No automatic switching.

1	Alternates between red and green.

2	Cycles between red, yellow and green.

3	Cycles between red, yellow, green and gray.

Some additional points to consider are:

-  You can use the Value property when you want to handle the switching process yourself.  Note that Value can be set at design time and is read/write at run time.

-  MhMulti has an AutoSize property because some bitmaps are not as suitable for stretching and compressing as others. Therefore, if you wish to change the size of these controls you should attempt to preserve the ratio of width to height.

-  Setting the Enabled property to False has the same effect as choosing a Value of three (gray).

The Style property determines which of the bitmaps MhMulti displays. Each Style has four bitmaps. The Value property determines which color to display (red, yellow, green or gray). You can set the Style property at design time or run time. When Enabled is False, MhMulti sets Value to three (gray). Whenever you change the Value property from code, MhMulti generates a Change event.

If AutoSwitch is False, the Value property can be changed only from code. If the AutoSwitch property is set to a number in the range 1-3, the result of the click is different - the Value property cycles to the next value (based on the type of cycling you specify with the AutoSwitch property) and a Change event is generated.


Mh3dLabel: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dLabel Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	(Default) Align to left

1	Align to right

2	Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


Mh3dLabel: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dLabel: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner, BevelStyle


Mh3dLabel: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inner edge of the control. The default value for the BevelSizeInner property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range for the BevelSizeInner property is zero to 32,767.

You can modify the 3-D appearance of the control by setting BevelSizeInner to a value greater than zero. Try different BevelStyleInnner settings to find the effect you want. The BevelSizeInner and BevelSize properties are use to manipulate the inner and outer borders of the control respectively. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize, BevelStyleInner


Mh3dLabel: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dLabel: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. When the BevelSizeInner property is 0, the BevelStyleInner property is ignored and no bevel is drawn. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dLabel: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dLabel: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dLabel: FillColor

Description

The FillColor property sets or returns the color used to fill the control. If an image is being used for the Picture property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = integer%

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dLabel: FontEscapement

Description

The FontEscapement property sets or returns the direction in which text is drawn, relative to the first character.  The values are expressed in tenths of a degree. The default value is zero (draw text from left to right on a horizontal line). The valid range is 0 to 3600. Values greater than 3600 or less than zero are evaluated MOD 3600. Think of escapement as the direction text is drawn relative to the first character, along a line drawn (FontEscapement/10) degrees counter-clockwise. If FontEscapement is 900, characters are drawn 90 degrees perpendicular to the starting character (straight up), 1800 causes text to be drawn 180 degrees to the left (backwards) and 2700 draws text straight down. FontEscapement doesn't affect how individual characters appear, only the direction in which they are drawn.

Syntax

ctlname.FontEscapement = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontOrientation


Mh3dLabel: FontOrientation

Description

The FontOrientation property specifies the number of degrees the characters should be rotated, relative to the baseline specified in FontEscapement. The values are expressed in tenths of a degree. The default value is zero (draw the text perpendicular to baseline). Any values greater than 3600 or less than zero are evaluated MOD 3600.  While the FontEscapement property rotates the baseline, or direction the line of text is drawn in relation to the starting point, the FontOrientation rotates the individual characters in the text. Setting this property to 900 causes the characters to be drawn on their backs, while 1800 appears upside down.

Syntax

ctlname.FontOrientation = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontEscapement


Mh3dLabel: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontEscapement, FontOrientation


Mh3dLabel: FormatString

Description

The FormatString property sets or returns the template used to format the caption within the control. This property is similar to the Visual Basic Format function. Usage is the same as the VB Format function. For example, if the Caption property is "100.1" and the FormatString is "$###,###.00", the caption is formatted and displayed as "$100.10". By default, this property is null, indicating no formatting is performed. For more information about formatting, please refer to your Visual Basic documentation.

Syntax

ctlname.FormatString = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dLabel: GlobalMem

Description

The GlobalMem property indicates whether or not the text in the Caption property will be stored in global memory or the form's local memory. Since Caption can contain up to 64K of text and is, by default, stored in the local memory of the parent form, there is a limit to the amount of text that can be placed in all of the controls on any one form. This property allows you to move the text in the Caption to global memory, where the only limitation is the total amount of available Windows memory. The valid settings for GlobalMem follow:

Setting	Description

True (-1)	The text in the Caption property will be stored in global memory.

False (0)	(Default) The text in the Caption property will be stored in the form's local memory.

Syntax

ctlname.GlobalMem = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dLabel: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dLabel: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dLabel: NoPrefix

Description

The NoPrefix property specifies whether ampersand characters (&) are displayed in the caption without requiring the use of double ampersands (&&). Note that the character immediately following the ampersand character is used as the access key for the control, regardless of the NoPrefix setting. The valid settings for the NoPrefix property follow:

Setting	Description

True (-1)	Ampersand characters are displayed and do not cause the next character to be underlined.

False (0)	(Default) Ampersand characters are not displayed unless you embed a double ampersand in the string. The next character after the ampersand is underlined.

Syntax

ctlname.NoPrefix = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dLabel: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size. If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded. For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WallPaper


Mh3dLabel: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dLabel: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dLabel: VAlignment

Description

The VAlignment property determines how the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	(Default) Center

The VAlignment property is used primarily in conjunction with the FontEscapement and FontOrientation properties. Without the ability to vertically align the caption, the FontEscapement property would be of little value.

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment, FontEscapement, FontOrientation


Mh3dLabel: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as 	many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dLabel: Overview

The Mh3dLabel control is an enhanced label control. In addition to supporting all of the properties and features of the standard label control, Mh3dLabel offers several unique features:

-  An optional 3-D appearance including an inner and outer bevel and font.

-  Control of all the colors used in the control.

-  Display a picture on the background of the control.

-  Align the caption both vertically and horizontally.

The following figure shows examples of Mh3dLabel controls. The following table provides an overview of the Mh3dLabel control.

Mh3dLabel Control Examples.

Mh3dLabel Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhLabl16.OCX MhLabl32.OCX MHGLBL.VBX	Mh3dLabel	See the MHLABL sample directory.		Mh3d
Development Notes

Mh3dLabel has two properties that make it truly unique when you're using vector fonts: FontEscapement and FontOrientation. These properties allow you to create labels that display the caption vertically as well as horizontally. You can orient the text from right to left (backwards) or at any angle.

You can also rotate the angle of the line on which the caption is drawn as well as the orientation of individual characters. The following examples demonstrate effects that can be achieved.

The first example rotates the FontEscapement 90 degrees so the caption prints in a vertical line. The second shows what happens when you set the FontOrientation to rotate the individual characters in the caption 90 degrees. Since these two properties work only with vector fonts, the best advice is to simply experiment with the different fonts to obtain the desired effect.

Using the FontEscapement and FontOrientation properties is much easier than describing them. The easiest way to think of escapement is the direction the text will be drawn relative to the first character, while the orientation is the position of the individual characters in the caption. Both properties are measured in tenths of a degree, with zero being the default. The default values result in normal text, meaning the text is displayed along a horizontal baseline, with each character drawn perpendicular to the line.

To help visualize these properties, think of the caption being drawn on top of a straight line that is horizontal to the bottom of the page (or monitor).  For every 10 points the FontEscapement property increases, this baseline swings in an arc one degree counter-clockwise. Since the pivotal point is the first character, you may need to adjust the alignment of the caption using the Alignment and VAlignment properties so the caption does not disappear when the FontEscapement is changed. When FontEscapement is 900, the base line is 90 degrees from level (a vertical line).

Like FontEscapement, FontOrientation works in a counter-clockwise direction, but modifies the individual characters instead of the line on which they are drawn. The second example illustrates a caption using a FontEscapement of zero and a FontOrientation of 900.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent.  While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The BevelSizeInner and BevelStyleInner properties are used to display a 3-D border around the inside area of the control. If the BevelStyle and BevelStyleInner properties are the same, the bevel will simply appear to be the total width of BevelSize and BevelSizeInner. However, by setting BevelStyle and BevelStyleInner to different settings, you can achieve some interesting effects (see below).

Any image loaded into the Picture property is displayed in the inner area of the label (the portion inside the two bevels) and is the same area affected by the FillColor property. The method used to paint the picture is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. Any text set in the Caption property is displayed on top of this image according to the value of FontTransparent.

The NoPrefix property allows you to modify the way VB handles the ampersand (&) character. When NoPrefix is FALSE, an ampersand causes the next character to appear underlined. If this property is TRUE, the ampersand will be treated as a valid character.

Setting the MultiLine property to TRUE causes the caption to be word-wrapped like the standard VB text control.

If  this control is bound to a data control, the selected DataField will appear as the caption. FormatString will allow you to use the same formatting properties as VB Format$. The formatting changes only effect how the caption is displayed, not the actual data placed in the DataField.

Note:  Since the text in the Caption property is stored in the local memory of the parent form, a form with a large number of controls or a large amount of text assigned to string properties of controls on the form can cause an Out of Memory error. To help resolve this problem, Mh3dLabel has a GlobalMem property, that when set to True, causes the text in the Caption property to be stored in Windows global memory.


MhMarque: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picturexxx bitmaps. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	(Default) Size the picture areas to the size of the Picturexxx bitmaps.

False (0)	Stretch or shrink the bitmap to the size of the picture area.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3


MhMarque: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMarque: CaptionBottom

Description

The CaptionBottom property sets or returns the bottom display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionBottom property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionBottom = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionLeft, CaptionRight, CaptionTop


MhMarque: CaptionLeft

Description

The CaptionLeft property sets or returns the left display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionLeft property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionLeft = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionRight, CaptionTop


MhMarque: CaptionRight

Description

The CaptionRight property sets or returns the right display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionRight property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionRight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionTop


MhMarque: CaptionTop

Description

The CaptionTop property sets or returns the top display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionTop property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionRight


MhMarque: Direction

Description

The Direction property sets or returns the direction of the text movement in the control. The valid settings for the Direction property follow:

Setting	Description

0	(Default) Forward

1	Backward

Syntax

ctlname.Direction = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMarque: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMarque: Interval

Description

The Interval property sets or returns the inteval (in milliseconds) between the display of the pictures and/or the moving text. The default value is 1,000. The range is zero to 2,147,483,647.

Syntax

ctlname.Interval = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhMarque: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhMarque: OuterFillColor

Description

The OuterFillColor property sets or returns the color that is displayed between the caption area and the outer border.

Syntax

ctlname.OuterFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextFillColor


MhMarque: Picture1

Description

The Picture1 property sets or returns the first of three pictures that can be loaded and used to create an animated control. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the Picturexxx property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

Syntax

ctlname.Picture1 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture2, Picture3


MhMarque: Picture2

Description

The Picture2 property sets or returns the second of three pictures that can be loaded and used to create an animated control. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the Picturexxx property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

Syntax

ctlname.Picture2 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture3


MhMarque: Picture3

Description

The Picture3 property sets or returns the third of three pictures that can be loaded and used to create an animated control. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the Picturexxx property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle.

Syntax

ctlname.Picture3 = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2


MhMarque: PictureBottom

Description

The PictureBottom property sets or returns the bottom position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureBottom property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureLeft, PictureRight, PictureTop


MhMarque: PictureLeft

Description

The PictureLeft property sets or returns the left position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureLeft property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureRight, PictureTop


MhMarque: PictureRight

Description

The PictureRight property sets or returns the right position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureRight property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureLeft, PictureTop


MhMarque: PictureTop

Description

The PictureTop property sets or returns the top position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureTop property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom, PictureLeft, PictureRight


MhMarque: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhMarque: Style

Description

The Style property sets or returns the way the caption and pictures are displayed in the control. The valid settings for the Style property follow:

Setting	Description

0	(Default) Moving Caption - cycle through Picture1, Picture2 and Picture3.

1	Moving Caption - static Picture1 or 3-D effect if there is no picture in Picture1.

2	Static Caption - cycle through Picture1, Picture2 and Picture3.

3	Static Caption - static Picture1 or 3-D effect if there is no picture in Picture1.

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture1, Picture2, Picture3


MhMarque: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhMarque: TextFillColor

Description

The TextFillColor property sets or returns the background color of the caption.

Syntax

ctlname.TextFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


MhMarque: Overview

The MhMarque control is an enhanced label control that can show a moving banner of text, with or without a set of moving bitmaps. The MhMarque control is useful when you want a control that attracts attention. In many respects, the MhMarque control combines the features of the MhAnimate and the Mh3d controls into a single control. The major difference between the MhMarque and MhAnimate controls, however, is that you can specify up to three unique bitmaps for the MhMarque while the MhAnimate control can display up to 32,767 bitmaps. The following table provides an overview of the MhMarque control.

MhMarque Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhMarq16.OCX MhMarq32.OCX MHMQ200.VBX	MhMarque	See the MHMARQ sample directory.		Mh3d MhAnimate
Development Notes

While the concept of a moving banner is easy to visualize, you might want to take a look at the MHMARQUE sample project to give you an idea of what you can do with the bitmap aspect of the control. This project creates an MhMarque control with an outer perimeter of lights that chase each other around the boundary of the MhMarque control much like a theater marquee.

MhMarque contains two sets of  custom properties: Captionxxx and Picturexxx. These properties define where the caption and/or the picture is displayed within the control. Both sets of properties are expressed in twips and are relative to the borders of the control. That is, setting xxxLeft = 5 sets that left border 5 twips inside the control's left border. Setting xxxBottom = 5 sets that bottom border 5 twips inside the control's bottom border.

When you use bitmaps (or icons) in MhMarque controls (specified in Picture1, Picture2 and Picture3 during design time), the bitmaps become a part of your program. This means you do not have to distribute the bitmaps/icons separately with your programs. On the other hand, if you use the LoadPicture function to add bitmaps/icons at run time, then the files must be present at run time.

The FontStyle property determines the 3-D effect of the text displayed in the control and includes a variety of lowered and raised styles.


MhCallBack: hWndSubclass

Description

The hWndSubclass property sets the hWnd of the control you want to subclass (i.e. intercept messages). Set this property to the hWnd of the control that you want to subclass.

Syntax

ctlname.hWndSubclass = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhCallBack: MsgList

Description

The MsgList property sets the message numbers that fire the SubclassMsg event. The following example, catches the WM_PAINT and WM_SIZE messages:

MhCallb1.MsgList(0) = WM_PAINT

MhCallb1.MsgList(1) = WM_SIZE

Syntax

ctlname.MsgList(element) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MsgPassage


MhCallBack: MsgPassage

Description

The MsgPassage property indicates how messages are handled. You can have MhCallBack pre-process the message, post-process the message or kill the message. The valid settings for the MsgPassage property follow:

Setting	Description

-1	Preprocess the message (sends it to VBDefControlProc first)

0	Kill the message - never pass it on.

1	(Default) Pass the message on after firing the SubclassMsg event.

This example shows how you can use MsgPassage:

MhCallB1.MsgList(0) = WM_PAINT: MhCallB1.MsgPassage(0)=-1

Syntax

ctlname.MsgPassage(element) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MsgList


MhCallBack: Style

Description

The Style property indicates whether the control is used to retrieve an enumerated list or to access the Windows message stream. To retrieve an enumerated list you must set Style to zero and call the MhEnumFonts, MhEnumClipboardFormats or MhEnumChildWindows function. To access Windows messages, set the Style value in the range one to five and place your code into the event procedure listed below. The default value is zero.

Setting	Associated Event	Messages Returned

0	(Default) MhEnum... procedures	Not used for messages

1	KeyboardHook	Returns key and mouse presses

2	GetMessageHook	Returns all Windows messages

3	MsgFilterHook	Returns menu and dialog box messages for your program

4	SysMsgFilterHook	Returns menu and dialog box messages for all programs

5	ClipboardFormatChanged	Returns clipboard change messages for all programs

Note:  The MsgFilterHook and the SysMsgFilterHook hooks both return menu and dialog box messages. We included them both because the SysMsgFilterHook will return all messages from all programs and MsgFilterHook returns messages from the program that set the hook.

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

See the MhCallBack functions.


MhCallBack: ClipboardFormatChanged

Description

The ClipboardFormatChanged event occurs when any application changes the contents of the clipboard.

Syntax

Sub ctlname_ClipboardFormatChanged()


MhCallBack: GetMessageHook

Description

The GetMessageHook event occurs when the control receives any Windows message. This event has the following parameters:

HookhWnd contains the window handle of the widow for which the message is destined.

HookMsg contains the Windows' message number.

HookWp contains the wp parameter for this message.

HookLp contains the lp parameter for this message.

Syntax

Sub ctlname_GetMessageHook(HookhWnd As Integer, HookMsg As Integer, HookWp As Integer, HookLp As Long)


MhCallBack: KeyboardHook

Description

The KeyboardHook event occurs when the control receives a key or mouse press message. This event has the following parameters:

wParam contains the virtual key code of the key pressed.

lParam contains other information about the key press (see the Windows API for details).

Syntax

Sub ctlname_KeyboardHook(wParam As Integer, lParam As Long)


MhCallBack: MsgFilterHook

Description

The MsgFilterHook event occurs when the control receives a menu or dialog box message for your program. This event has the following parameters:

HookhWnd contains the window handle of the widow for which the message is destined.

HookMsg contains the Windows message number.

HookWp contains the wp parameter for this message.

HookLp contains the lp parameter for this message.

Syntax

Sub ctlname_MsgFilterHook (HookhWnd As Integer, HookMsg As Integer, HookWp As Integer, HookLp As Long)


MhCallBack: SubclassMsg

Description

The SubClassMsg event occurs when using the subclass properties of MhCallBack. Use this event if you installed a subclass. Do your processing in this event. Note that the parameters used in this event are those returned by Windows itself. Please refer to the Windows API for further details.

Syntax

Sub ctlname_SubclassMsg (Msg As Integer, wParam As Integer, 1Param As Integer, ReturnVal As Long)


MhCallBack: SysMsgFilterHook

Description

The SysMsgFilterHook event occurs when the control receives a menu or dialog box message for  any program. This event contains the following parameters.

HookhWnd contains the window handle of the widow for which the message is destined.

HookMsg contains the Windows' message number.

HookWp contains the wp parameter for this message.

HookLp contains the lp parameter for this message.

Syntax

Sub ctlname_SysMsgFilterHook(HookhWnd As Integer, HookMsg As Integer, HookWp As Integer, HookLp As Long)


MhCallBack: MhEnumChildWindows

Description

The MhEnumChildWindows function enumerates the child windows of a parent window.

Syntax

Result% = MhEnumChildWindows(hWnd%, Elements%, hWndArray%(0))

Parameters Passed To Routine

hWnd% 	The hWnd of the parent window for which you want to find the child windows.

Elements% 	The maximum number of elements to place into the hWndArray%(). If you pass this parameter as zero, the routine simply returns the number of child windows.

hWndArray%(0) 	The first element of the array in which the hWnd values are returned.

Parameters Returned From Routine

hWndArray%()	The child window handles. (The maximum number of handles is Elements%).

Result% 	The total number of child windows.

Example

'Retrieves the hWnds of child windows.

'Create a dynamic array:

ReDim hWndArr%(0)

'Get number of windows:

NumOfWindows% = MhEnumChildWindows(Form1.hWnd, 0, hWndArr%(0))

'Resize hWndArr%() to hold all the information:

ReDim hWndArr%(NumOfWindows%)

'Retrieve the hWnd's of the child windows:

A% = MhEnumChildWindows(Form1.hWnd, NumOfWindows%, hWndArr%(0))


MhCallBack: MhEnumClipboardFormats

Description

The MhEnumClipboardFormats function enumerates the list of available clipboard formats. A clipboard format is a type of information that an application can store on the clipboard. Please see the Windows SDK for more information on clipboard formats.

Syntax

Result% = MhEnumClipboardFormats(hWnd%, Elements%, FormatArray%(0))

Parameters Passed To Routine

hWnd% 	The hWnd of the parent form.

Elements% 	The maximum number of clipboard format numbers to place into the FormatArray%(). If you pass this parameter as zero, the routine simply returns the number of different formats used on the clipboard.

FormatArray%(0) 	The first element of the array in which the list of clipboard formats are returned.

Parameters Returned From Routine

FormatArray%() 	The list of the formats of clipboard items for this application. (The maximum number of formats is Elements%). The possible clipboard formats are:

Format	Description

1	CF_TEXT

2	CF_BITMAP

3	CF_METAFILEPICT

4	SYLK

5	DIF

6	TIFF

7	CF_OEMTEXT

8	CF_DIB

9	PALETTE

10	PENDATA

11	RIFF

12	WAVE

Result%	The total number of formats.

Example

'Retrieve the formats of the information that

'may be stored on the clipboard.

'Create a dynamic array:

ReDim FormatArr%(0)

'Get the number of formats:

NumFmts% = MhEnumClipboardFormats(Form1.hWnd, 0, FormatArr%(0))

'Resize FormatArr%() to hold complete list of formats:

ReDim FormatArr%(NumFmts%)

'Retrieve the list of clipboard formats:

A% = MhEnumClipboardFormats(Form1.hWnd, NumFmts%, FormatArr%(0))


MhCallBack: MhEnumFonts

Description

The MhEnumFonts function enumerates the available fonts.

Syntax

Result% = MhEnumFonts(hDC%, Elements%, FontArray(0))

Parameters Passed To Routine

hDC% 	The hDC to enumerate fonts (usually the device context for the form or a printer.

Elements% 	The maximum number of font records that MhEnumFonts can place into the FontArray. If you pass this parameter as zero, MhEnumFonts returns the number of fonts for the device.

FontArray%(0) 	The first element of the array in which you want MhEnumFonts to return font information.

Parameters Returned From Routine

FormatArray()	The list of fonts and their characteristics. The maximum number of fonts allowed is Elements%.

Result% 	The total number of fonts for this device.

Example

'Retrieves information on fonts available for a device.

'Create a dynamic array:

ReDim LogFont(0) as MhLogFont

'Get the number of fonts available:

NumFonts% = MhEnumFonts(Form1.hDC, 0, LogFont(0))

'Resize LogFont() to hold all the font information:

ReDim LogFont(NumFonts%) As MhLogLogFont

'Retrieve the font information:

A% = MhEnumFonts(Form1.hDC, NumFonts%, LogFont(0))


MhCallBack: Overview

The MhCallBack control provides access to three types of Windows services: enumerated list, message hook services, and subclassing. Windows refers to the first two services as callback services. The following table provides an overview of the MhCallBack control.

MhCallBack Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHCB200.VBX	MhCallBack	See the MHCALLB sample directory.		MhDragDrop MhInvisible
Enumerated List Services

An enumerated list is simply an exhaustive list of all the elements of a certain type. You can use the MhCallBack control to get four different types of enumerated lists.

-  A list of all the fonts available for your forms.

-  A list of all the fonts available on your printer.

-  The complete list of a parent's child window handles.

-  A list of the formats of data stored on the Windows clipboard.

The process of retrieving each list is similar. To tell an MhCallBack control which enumerated list you want, set the Style property to zero and call the MhEnumFonts, MhEnumClipboardFormats or MhEnumChildWindows function to get the appropriate list.

As an example, let's examine the instructions that retrieve the list of the fonts available for a form:

MhCallBack1.Style = 0

ReDim LogFont(0) as MhLogFontType

NumFonts% = MhEnumFonts(Form1.hDC, 0, LogFont(0))

ReDim LogFont(NumFonts%) As MhLogFontType

A% = MhEnumFonts(Form1.hDc, NumFonts%, LogFont(0))

The first instruction sets the Style parameter of the MhCallBack1 control to zero, which tells the control that we want to call one of the enumerated list functions.

The second instruction dimensions an array named LogFont (short for logical attributes of a font) of type MhLogFontType with one element. The MhLogFontType record type contains fields that Windows uses to describe the characteristics of a font. We create the LogFont array at this point because we need to pass it in the call to the MhEnumFonts function in the next line. Notice that we used the ReDim instruction when we created LogFont so we can later change the number of elements it contains.

In the third instruction, we call the MhEnumFonts function, passing it three parameters: The hDC of our form, a zero which tells the MhEnumFonts function to return the actual number of fonts available, and the address of the LogFont array. When the MhEnumFonts function returns, it places the actual number of fonts available for use with the NumFonts% variable.

In the fourth instruction, we dimension the LogFont array so that it's large enough to store data for all the form's fonts.

The last instruction calls the MhEnumFonts function again. This time, in the second parameter position, we pass it the number of font records to return. MhEnumFonts stores the font information into the LogFont array and again returns the total number of fonts for Form1, which we store in A%.

If you want to add the names (stored in the FaceName field of the MhLogFontType record) of all the fonts available in Form1 to a list box control, you can execute the following code:

For I% = 1 to NumFonts%

  List1.AddItem LogFont(I% - 1).FaceName

Next

A detailed list of the parameters for each enumerated list function is located after the MhCallBack property, event and method lists. Please refer to the MHCALLB example project for Type definitions and Declare statements required by the MhEnumChildWindows, MhEnumClipboardFormats and MhEnumFonts routines.

Message Hook Services

A message hook service lets you examine Windows messages. You can use the MhCallBack control to gain access to five different types of messages:

-  Key and mouse presses.

-  All Windows messages.

-  Menu and dialog box messages for your program only.

-  Menu and dialog box messages for all programs.

-  Clipboard change messages.

The MhCallBack control fires a custom event procedure when it receives a message of the type you specify. To access Windows messages, first set Style to the value that matches the message type in which you're interested. Next, place your message processing code into the event procedure for the message type. The following table lists the values of Style that correspond to each custom MhCallBack event procedure, and the messages event procedure receives:

Setting	Associated Event	Messages Returned

0	MhEnum... procedures	Not used for messages

1	KeyboardHook	Returns key and mouse presses

2	GetMessageHook	Returns all Windows messages

3	MsgFilterHook	Returns menu and dialog messages for your program

4	SysMsgFilterHook	Returns menu and dialog box messages for all programs

5	ClipboardFormatChanged	Returns clipboard change messages for all programs

For example, to see what keyboard and mouse press messages Windows generates, set Style to 1 and place an instruction similar to the following

'Display keyboard hook wParam (ASCII code)

Debug.Print Str$(wParam)

into the KeyboardHook event procedure.

For more information on enumerated list and message hook functions, please consult the Windows SDK documentation.

Subclassing

MhCallback has been enhanced so that general purpose Window subclassing is now built into the control. To use, set the hWndSubclass to the hWnd you wish to subclass and set the MsgList() property to the message number (see windows.h)  that you want to intercept.


MhRollUp: Active

Description

The Active property returns whether the control, or one of the child controls within the control, has the focus. The valid settings for the Active property follow:

Setting	Description

True (-1)	The control (or a child control) has focus.

False (0)	The control does not have focus.

Syntax

ctlname.Active = boolean%

Data Type

Boolean

Availability

Run-Time Read


MhRollUp: BorderStyle
Mh3d: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Thin

2	Sizeable

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also


MhRollUp: ControlBox

Description

The ControlBox property indicates whether a control box is available on the control. The valid settings for the ControlBox property follow:

Setting	Description

True (-1)	The control box is displayed.

False (0)	The control box is not displayed.

Syntax

ctlname.ControlBox = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WindowState


MhRollUp: OriginalHeight

Description

The OriginalHeight property returns the height of the control in its rolled down state, even if WindowState is currently one (rolled up). Use the ScaleHeight and ScaleWidth properties to determine the current dimensions of the client area.

Syntax

ctlname.OriginalHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

OriginalWidth, ScaleHeight, ScaleWidth


MhRollUp: OriginalWidth

Description

The OriginalWidth property returns the width of the control in its rolled down state, even if WindowState is currently one (rolled up). Use the ScaleHeight and ScaleWidth properties to determine the current dimensions of the client area.

Syntax

ctlname.OriginalWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

OriginalHeight, ScaleHeight, ScaleWidth


MhRollUp: Picture

Description

The Picture sets or returns the image to display in the control's background. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the Picture property equal to the picture property of another control. Unless indicated otherwise, you may select .BMP or .ICO files for this property. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

UseBitBlt


MhRollUp: RedrawMode

Description

The RedrawMode property indicates whether the control is repainted when the control is activated (receives the focus), moved, or resized. The control normally redraws its contents only when the contents change. The valid settings for the RedrawMode property follow:

Setting	Description

0	(Default) Normal redraw (when contents change)

1	Redraw on Move/Size/Activate

Syntax

ctlname.RedrawMode = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

UseBitBlt, WindowState


MhRollUp: ScaleHeight

Description

The ScaleHeight property sets or returns the height (in twips) of the control's client area. If you wish to determine the dimensions of the control in its rolled down state, even if it is currently rolled up, use the OriginalHeight and OriginalWidth properties.

Note that when the control is rolled up (the WindowState property is 1), ScaleHeight is returned as zero. If you set ScaleHeight to a non-zero value, the control will change to its rolled down state (WindowState is zero).

Syntax

ctlname.ScaleHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

OriginalHeight, OriginalWidth, ScaleWidth


MhRollUp: ScaleWidth

Description

The ScaleWidth property sets or returns the width (in twips) of the control's client area. If you wish to determine the dimensions of the control in its rolled down state, even if it is currently rolled up, use the OriginalHeight and OriginalWidth properties.

Note that when the control is rolled up (the WindowState property is 1), ScaleHeight is returned as zero. If you set ScaleHeight to a non-zero value, the control will change to its rolled down state (WindowState is zero).

Syntax

ctlname.ScaleWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

OriginalHeight, OriginalWidth, ScaleHeight


MhRollUp: UseBitBlt

Description

The UseBitBlt property indicates whether the BitBlt or StretchBlt function is used to display bitmaps. The BitBlt function copies a portion of the source bitmap into the control, but doesn't manipulate the bitmap in any way. StretchBlt shrinks or expands the source bitmap so that it fills the control. Consequently, the BitBlt function is the faster of the two. The valid settings for the UseBitBlt property follow:

Setting	Description

True (-1)	Use BitBlt to display the image(s).

False (0)	(Default) Use StretchBlt to display the image(s).

By default, the image loaded in the Picture property is stretched to fit the dimensions of the control and changes whenever the control is resized. Setting this property to True causes the image to be displayed at its original dimensions.

Syntax

ctlname.UseBitBlt = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhRollUp: WindowState

Description

The WindowState property indicates whether the control is rolled up or down. The valid settings for the WindowState property follow:

Setting	Description

0	(Default) Rolled down (normal).

1	Rolled up.

Note that when WindowState is one (rolled up), the ScaleHeight property is returned as zero. If you set ScaleHeight to a non-zero value, the control will change the WindowState property to zero (rolled down).

Syntax

ctlname.WindowState = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScaleHeight, ScaleWidth


MhRollUp: Activate

Description

The Activate event occurs when the control, or one of the child controls within the control, receives the focus.

Syntax

Sub ctlname_Activate()


MhRollUp: Close

Description

The Close event occurs when the Close option is selected from the control box menu.

Syntax

Sub ctlname_Close()


MhRollUp: DeActivate

Description

The DeActivate event occurs when the control, or one of the child controls within the control, loses the focus.

Syntax

Sub ctlname_Deactivate()


MhRollUp: Resize

Description

The Resize event occurs when the control is resized (with the mouse or via the control box menu).

Syntax

Sub ctlname_Resize()


MhRollUp: Overview

The MhRollUp control is a container control that operates like a drop-down combo box. By placing the appropriate controls inside the MhRollUp control, you can easily create a floating palette, toolbox, or dialog box. The following figure shows an example MhRollUp control in its rolled down and rolled up states. The following table provides an overview of the MhRollUp control.

MhRollUp Control Example.

MhRollUp Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhRoll16.OCX MhRoll32.OCX MHROLL.VBX	MhRollUp	See the MHROLL sample directory.		Mh3dList
Development Notes

You can optionally specify a background image in the Picture property. By default, the image is stretched to fit the dimensions of the control and changes whenever the control is resized. Set the UseBitBlt property to True if you want the image to be displayed at its original dimensions.

The ScaleHeight and ScaleWidth properties set or return the current dimensions of the client area. If you wish to determine the dimensions of the control in its rolled down state, even if it is currently rolled up, use the OriginalHeight and OriginalWidth properties.

Note that when the control is rolled up (the WindowState property is 1), ScaleHeight is returned as zero. If you set ScaleHeight to a non-zero value, the control will change to its rolled down state (WindowState is zero).


MhCommonDialog: Action

Description

The Action property sets or returns the action performed by the control. The valid settings for the Action property follow:

Setting	Description

0	No action.

1	Display the File Open dialog box.

2	Display the File Save dialog box.

3	Display the Color dialog box.

4	Display the Choose Font dialog box.

5	Display the Printer dialog box.

6	Invoke WINHELP.EXE

Use the Flags property to specify various options that are available when invoking the dialog boxes. When Action is 6 (Invoke WINHELP), use the Helpxxx properties.

Syntax

ctlname.Action = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Flags


MhCommonDialog: AddControl

Description

The AddControl property adds a VB control to a common dialog box. To add a VB control to a common dialog box, simply set the AddControl property to the hWnd of the desired control. This should be done in the CommonDialogOpened event, as follows:

' Move the Picture1 control from the current  form to the common dialog box

MhCommonDialog1.AddControl = Picture1.hWnd

' Position the Picture1 control as needed

Picture1.Top = 0   ' move to top/left in dialog

Picture1.Left = 0

' Use the control as usual...

Picture1.Picture = LoadPicture("mylogo.bmp")

Once the control has been added to the dialog box, you can use any of the control's properties to manipulate its size, position, etc. The standard VB events will continue to occur while the control is contained within the dialog box. When using the File Open and File Save dialog boxes, the FileNameChange event occurs as the user selects different files in the file list. You can place code in that event to respond to each change, such as displaying the highlighted file in an MhFileDisplay control that resides in the dialog box (You must add the MhFileDisplay control to the dialog since it is not a part of MhCommonDialog).

Review the Development Notes section for this control at the beginning of this chapter for important Notes and Cautions.

Syntax

ctlname.AddControl = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

RemoveControl


MhCommonDialog: CancelError

Description

The CancelError property indicates whether the control generates an error when the user selects the Cancel button. The valid settings for the CancelError property follow:

Setting	Description

True (-1)	The CDERR_CANCEL error is generated when the Cancel button is selected.

False (0)	(Default) No error is generated when the Cancel button is selected.

Syntax

ctlname.CancelError = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Flags


MhCommonDialog: Color

Description

The Color property sets or returns the RGB value of the color selected in the Color and Choose Font dialog boxes.

Syntax

ctlname.Color = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: Copies

Description

The Copies property sets or returns the number of copies specified in the Copies text box of the Printer dialog box.

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: DefaultExt

Description

The DefaultExt property sets or returns the default file extension used in the File Open and File Save dialog boxes. The DefaultExt property may be used to specify a default file extension such as TXT or DOC. When a file is saved and no extension is given, the extension specified by this property is automatically appended to the saved file's name.

Syntax

ctlname.DefaultExt = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: DialogDefaultHeight

Description

The DialogDefaultHeight property returns the default height (in twips) of the common dialog box as determined by Windows.

The DialogDefaultxxx properties differ from the Dialogxxx properties in that they return the original size and position of the common dialog boxes, as determined by Windows. By contrast, the Dialogxxx properties allow you to set and return the current size and position of the dialog boxes.

The DialogDefaultxxxx properties may be read in the CommonDialogOpened event. If you desire to change the size or position of the dialog box (especially if you wish to add controls to a common dialog with the AddControl property), use the Dialogxxxx properties.

Syntax

ctlname.DialogDefaultHeight = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

DialogDefaultWidth


MhCommonDialog: DialogDefaultLeft

Description

The DialogDefaultLeft property returns the default left position (in twips) of the common dialog box as determined by Windows.

The DialogDefaultxxx properties differ from the Dialogxxx properties in that they return the original size and position of the common dialog boxes, as determined by Windows. By contrast, the Dialogxxx properties allow you to set and return the current size and position of the dialog boxes.

The DialogDefaultxxxx properties may be read in the CommonDialogOpened event. If you desire to change the size or position of the dialog box (especially if you wish to add controls to a common dialog with the AddControl property), use the Dialogxxxx properties.

Syntax

ctlname.DialogDefaultLeft = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

DialogDefaultTop


MhCommonDialog: DialogDefaultTop

Description

The DialogDefaultTop property returns the default top position (in twips) of the common dialog box as determined by Windows.

The DialogDefaultxxx properties differ from the Dialogxxx properties in that they return the original size and position of the common dialog boxes, as determined by Windows. By contrast, the Dialogxxx properties allow you to set and return the current size and position of the dialog boxes.

The DialogDefaultxxxx properties may be read in the CommonDialogOpened event. If you desire to change the size or position of the dialog box (especially if you wish to add controls to a common dialog with the AddControl property), use the Dialogxxxx properties.

Syntax

ctlname.DialogDefaultTop = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

DialogDefaultLeft


MhCommonDialog: DialogDefaultWidth

Description

The DialogDefaultHeight property returns the default width (in twips) of the common dialog box as determined by Windows.

The DialogDefaultxxx properties differ from the Dialogxxx properties in that they return the original size and position of the common dialog boxes, as determined by Windows. By contrast, the Dialogxxx properties allow you to set and return the current size and position of the dialog boxes.

The DialogDefaultxxxx properties may be read in the CommonDialogOpened event. If you desire to change the size or position of the dialog box (especially if you wish to add controls to a common dialog with the AddControl property), use the Dialogxxxx properties.

Syntax

ctlname.DialogDefaultHeight = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

DialogDefaultHeight


MhCommonDialog: DialogHeight

Description

The DialogHeight property sets or returns the current height (in twips) of the common dialog box.

The Dialogxxx properties differ from the DialogDefaultxxxx properties in that they set or return the current size and position of the common dialog boxes. By contrast, the DialogDefaultxxx properties are read-only and return the original size and position of the dialog boxes as determined by Windows.

The Dialogxxx properties are useful when you wish to add your own controls to a common dialog box. If your application requires more than one version of the same common dialog box (i.e. two different File Open dialog boxes, with each having a different VB control), you can use the Dialogxxx properties to resize the dialog box according to the needs of a particular control.

Note that when you set the DialogTop and DialogLeft properties, you must specify a value greater than zero for at least one of the properties; otherwise, the dialog box is displayed at its default location.

Syntax

ctlname.DialogHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialogWidth


MhCommonDialog: DialoghWnd

Description

The DialoghWnd property returns the hWnd of the common dialog box that is currently open.

Syntax

ctlname.DialoghWnd = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

Action


MhCommonDialog: DialogLeft

Description

The DialogLeft property sets or returns the current left position (in twips) of the common dialog box.

The Dialogxxx properties differ from the DialogDefaultxxxx properties in that they set or return the current size and position of the common dialog boxes. By contrast, the DialogDefaultxxx properties are read-only and return the original size and position of the dialog boxes as determined by Windows.

The Dialogxxx properties are useful when you wish to add your own controls to a common dialog box. If your application requires more than one version of the same common dialog box (i.e. two different File Open dialog boxes, with each having a different VB control), you can use the Dialogxxx properties to resize the dialog box according to the needs of a particular control.

Note that when you set the DialogTop and DialogLeft properties, you must specify a value greater than zero for at least one of the properties; otherwise, the dialog box is displayed at its default location.

Syntax

ctlname.DialogLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialogTop


MhCommonDialog: DialogTitle

Description

The DialogTitle property sets or returns the title displayed in the title bar of the File Open and File Save dialog boxes. The default title for a File Open dialog box is Open. The default title for a File Save dialog box is Save As.

Syntax

ctlname.DialogTitle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: DialogTop

Description

The DialogTop property sets or returns the current top position (in twips) of the common dialog box.

The Dialogxxx properties differ from the DialogDefaultxxxx properties in that they set or return the current size and position of the common dialog boxes. By contrast, the DialogDefaultxxx properties are read-only and return the original size and position of the dialog boxes as determined by Windows.

The Dialogxxx properties are useful when you wish to add your own controls to a common dialog box. If your application requires more than one version of the same common dialog box (i.e. two different File Open dialog boxes, with each having a different VB control), you can use the Dialogxxx properties to resize the dialog box according to the needs of a particular control.

Note that when you set the DialogTop and DialogLeft properties, you must specify a value greater than zero for at least one of the properties; otherwise, the dialog box is displayed at its default location.

Syntax

ctlname.DialogTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialogLeft


MhCommonDialog: DialogWidth

Description

The DialogWidth property sets or returns the current width (in twips) of the common dialog box.

The Dialogxxx properties differ from the DialogDefaultxxxx properties in that they set or return the current size and position of the common dialog boxes. By contrast, the DialogDefaultxxx properties are read-only and return the original size and position of the dialog boxes as determined by Windows.

The Dialogxxx properties are useful when you wish to add your own controls to a common dialog box. If your application requires more than one version of the same common dialog box (i.e. two different File Open dialog boxes, with each having a different VB control), you can use the Dialogxxx properties to resize the dialog box according to the needs of a particular control.

Note that when you set the DialogTop and DialogLeft properties, you must specify a value greater than zero for at least one of the properties; otherwise, the dialog box is displayed at its default location.

Syntax

ctlname.DialogWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DialogHeight


MhCommonDialog: FileName

Description

The FileName property sets or returns the name and path of the file to open or save. When the user selects a file and clicks the OK button on the dialog box, the FileName property takes on a value which can then be used to open or save the selected file. You can set the FileName property to specify the initial name in the File Name text box.

Syntax

ctlname.FileName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: FileTitle

Description

The FileTitle property returns the name of the file (with the path) that was specified in the File Open or File Save dialog box. When the user selects a file and clicks the OK button, the FileTitle property takes on a value which can then be used to open or save the selected file.

Syntax

ctlname.FileTitle = string$

Data Type

String

Availability

Run-Time Read

See Also

Action


MhCommonDialog: Filter

Description

The Filter property sets or returns the filters that are displayed in the Type list box of the File Open or File Save dialog boxes. A filter specifies the type of files displayed in the dialog box's file list box. The Filter property should be set with one or more descriptions and filter definitions, as follows:

CtlName.Filter = "desc1|filter1|desc2|filter2"

For example, to define filters for text files (*.TXT) and all files (*.*), use:

CtlName.Filter = "Text Files|*.TXT|All Files|*.*"

Use the pipe symbol (ASCII 124) to separate the description and filter arguments. Don't add spaces before or after the pipe symbol or else the spaces will appear with the description and filter values. When you specify more than one filter for a dialog box, use the FilterIndex property to determine which filter is displayed as the default.

Syntax

ctlname.Filter = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FilterIndex


MhCommonDialog: FilterIndex

Description

The FilterIndex property sets or returns the default filter used in the File Open and File Save dialog boxes. The Filter property is used to define filters for the File Open or File Save dialog boxes. When you specify more than one filter, use the FilterIndex property to determine the default filter. The index for the first defined filter is 1.

Syntax

ctlname.FilterIndex = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Filter


MhCommonDialog: Flags

Description

The Flags property sets the options to use in the common dialog box. These flags are defined in the file CONSTANT.TXT included with Visual Basic. To specify more than one flag for a dialog box, use the or operator, as shown below:

CMDialog1.Flags = CF_EFFECTS Or CF_TTONLY

The following flags are available for the Choose Font dialog box:

Flag	Description

CF_APPLY	Specifies that the dialog box should enable the Apply button.

CF_ANSIONLY	Specifies that the dialog box should allow only selection of the fonts that use the Windows character set. If this flag is set, the user will not be able to select a font that contains only symbols.

CF_BOTH	Causes the dialog box to list the available printer and screen fonts. The hDC property identifies the device context associated with the printer.

CF_EFFECTS	Specifies that the dialog box should enable strikeout, underline, and color effects.

CF_FIXEDPITCHONLY	Specifies that the dialog box should select only fixed-pitch fonts.

CF_FORCEFONTEXIST	Specifies that an error message box is displayed if the user attempts to select a font or style that does not exist.

CF_LIMITSIZE	Specifies that the dialog box should select only font sizes within the range specified by the Min and Max properties.

CF_NOSIMULATIONS	Specifies that the dialog box should not allow GDI font simulations.

CF_NOVECTORFONTS	Specifies that the dialog box should not allow vector-font selections.

CF_PRINTERFONTS	Causes the dialog box to list only the fonts supported by the printer, specified by the hDC property.

CF_SCALABLEONLY	Specifies that the dialog box should allow only the selection of fonts that can be scaled.

CF_SCREENFONTS	Causes the dialog box to list only the screen fonts supported by the system.

CF_SHOWHELP	Causes the dialog box to display a Help button.

CF_TTONLY	Specifies that the dialog box should allow only the selection of TrueType fonts.

CF_WYSIWYG	Specifies that the dialog box should allow only the selection of fonts that are available on both the printer and the display. If this flag is set, the CF_BOTH and CF_SCALABLEONLY flags should also be set.

The following flags are available for the File Open and File Save dialog boxes:

Flag	Description

OFN_ALLOWMULTISELECT	Specifies that the File Name list box allows multiple selections. The user can select more than one file at run time by pressing the shift key and using the up and down arrow keys to select the desired files. When this is done, the FileName property returns a string containing the names of all the selected files. The names in the string are delimited by spaces.

OFN_CREATEPROMPT	Specifies that the dialog box should ask if the user wants to create a file that does not currently exist. This flag automatically sets the OFN_PATHMUSTEXIST and OFN_FILEMUSTEXIST flags.

OFN_EXTENSIONDIFFERENT	Indicates that the extension of the returned filename is different from the extension specified by the DefaultExt property. This flag is not set if the DefaultExt property is null, if the extensions match, or if the file has no extension. This flag value can be checked upon returning from the dialog.

OFN_FILEMUSTEXIST	Specifies that the user can only enter names of existing files in the File Name entry field. If this flag is set and the user enters an invalid file name, a warning is displayed. This flag automatically sets the OFN_PATHMUSTEXIST flag.

OFN_HIDEREADONLY	Hides the read-only check box.

OFN_NOCHANGEDIR	Forces the dialog box to set the current directory to what it was when the dialog box was invoked.

OFN_NOREADONLYRETURN	Specifies that the file returned will not have the Read Only attribute set and will not be in a write-protected directory.

OFN_NOVALIDATE	Specifies that the common dialog box allows invalid characters in the returned filename.

OFN_OVERWRITEPROMPT	Causes the Save As dialog box to generate a message box if the selected file already exists.  The user must confirm whether to overwrite the file.

OFN_PATHMUSTEXIST	Specifies that the user can only enter valid path names. If this flag is set and the user enters an invalid path name, a warning message is displayed.

OFN_READONLY	Causes the Read Only check box to be initially checked when the dialog box is created. This flag also indicates the state of the Read Only check box when the dialog box is closed.

OFN_SHAREAWARE	Specifies that the OF_SHARINGVIOLATION error should be ignored.

OFN_SHOWHELP	Causes the dialog box to display the Help button.

The following flags are available for the Printer dialog box:

Flag	Description

PD_ALLPAGES	Sets or returns the state of the All Pages option button.

PD_COLLATE	Sets or returns the state of the Collate check box.

PD_DISABLEPRINTTOFILE	Disables the Print to File check box.

PD_HIDEPRINTTOFILE	The Print to File check box is not displayed.

PD_NOPAGENUMS	Disables the Pages option button and the associated edit control.

PD_NOWARNING	Prevents a warning message from being displayed when there is no default printer.

PD_NOSELECTION	Disables the Selection option button.

PD_PAGENUMS	Sets or returns the state of the Pages option button.

PD_PRINTSETUP	Causes the system to display the Print Setup dialog box rather than the Print dialog box.

PD_PRINTTOFILE	Sets or returns the state of the Print to File check box.

PD_RETURNDC	Returns a device context for the printer selection made in the dialog box. The device context is returned in the dialog box's hDC property.

PD_RETURNIC	Returns an information context for the printer selection made in the dialog box. An information context provides a fast way to get information about the device without creating a device context. The information context is returned in the dialog box's hDC property.

PD_SELECTION	Sets or returns the state of the Selection option button. If neither PD_PAGENUMS nor PD_SELECTION are specified, the All option button is in the selected state.

PD_SHOWHELP	Causes the dialog box to display the Help button.

PD_USEDEVMODECOPIES	If a printer driver does not support multiple copies, setting this flag disables the copies edit control. If a driver does support multiple copies, setting this flag indicates that the dialog box should store the requested number of copies in the Copies property.

The following flags are available for the Color dialog box:

Flag	Description

CC_FULLOPEN	Causes the entire dialog box, including the portion that allows the user to create custom colors, to appear when the dialog box is created. Without this flag, the user must select the Define Custom Color command button to display this portion of the dialog box.

CC_PREVENTFULLOPEN	Disables the Define Custom Colors command button and prevents the user from defining custom colors.

CC_RGBINIT	Sets the initial color value for the dialog box.

CC_SHOWHELP	Causes the dialog box to display a Help button.

Syntax

ctlname.Flags = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: FromPage

Description

The FromPage property sets or returns the value for the From text box in the Printer dialog box. Use this property to determine the beginning page to be printed.

Syntax

ctlname.FromPage = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ToPage


MhCommonDialog: hDC

Description

The hDC property returns a device context or an information context for the selected printer after using the Printer dialog box. This property returns a device context when the PD_RETURNDC flag is set or an information context when the PD_RETURNIC flag is set. If the default printer is selected, you can print directly to the Visual Basic Printer object. Otherwise, you must use Windows GDI calls and print to the device context specified by this property.

Syntax

ctlname.hDC = setting%

Data Type

Integer

Availability

Run-Time Read


MhCommonDialog: HelpCommand

Description

The HelpCommand property sets or returns the type of help requested when invoking WinHelp. The values for the HelpCommand constants are defined in the file CONSTANT.TXT included with Visual Basic. The HelpCommand settings follow:

Constant	Description

HELP_CONTEXT	Displays help for a particular context. When using this setting, you must also specify a context using the HelpContext property.

HELP_HELPONHELP	Displays help for using the Help application itself.

HELP_INDEX	Displays the index of the specified help file. An application should use this value only for a help file with a single index.

HELP_KEY	Displays help for a particular keyword. When using this setting, you must also specify a keyword using the HelpKey property.

HELP_QUIT	Notifies the Help application that the specified help file is no longer in use.

HELP_SETINDEX	Sets the context specified by the HelpContext property as the current index for the help file specified by the HelpFile property. This index remains current until the user accesses a different help file. Use this value only for help files with more than one index.

Syntax

ctlname.HelpCommand = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HelpContext, HelpFile


MhCommonDialog: HelpContext

Description

The HelpContext property sets or returns the context ID that identifies the requested help topic when invoking WinHelp. To display the help topic for a desired keyword, you must also set the HelpCommand property to the HELP_CONTEXT value.

Syntax

ctlname.HelpContext = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HelpCommand, HelpFile


MhCommonDialog: HelpFile

Description

The HelpFile property sets or returns the name of the help file used to invoke WinHelp. If the specified help file is not in the current directory, you must include the complete directory path in the HelpFile string.

Syntax

ctlname.HelpFile = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HelpCommand, HelpContext, HelpKey


MhCommonDialog: HelpKey

Description

The HelpKey property sets or returns the keyword that identifies the requested help topic when invoking WinHelp. To display the help topic for a desired keyword, you must also set the HelpCommand property to the HELP_KEY value.

Syntax

ctlname.HelpKey = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HelpCommand, HelpContext, HelpFile


MhCommonDialog: InitDir

Description

The InitDir property sets or returns the initial directory that is displayed when using the File Open and File Save dialog boxes. If you do not specify a directory with the InitDir property, the common dialog box will use the current directory.

Syntax

ctlname.InitDir = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: Max

Description

The Max property sets or returns the largest font size to be displayed in the Size list box of the Choose Font dialog box. This property also sets or returns the maximum value allowed  for the print range in the Printer dialog box.

When using the Choose Font dialog box, the Flag property must contain the CF_LIMITSIZE value. When using the Printer dialog box, Max determines the largest number that the user can specify in the To text box.

Syntax

ctlname.Max = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min


MhCommonDialog: MaxFileSize

Description

The MaxFileSize property sets or returns the maximum length of the file name specified by the FileName property. The default value is 256. The range is 1 to 32,767.

Syntax

ctlname.MaxFileSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileName


MhCommonDialog: Min

Description

The Min property sets or returns the smallest font size to be displayed in the Size list box of the Choose Font dialog box. This property also sets or returns the minimum value allowed for the print range in the Printer dialog box.

When using the Choose Font dialog box, the Flag property must contain the CF_LIMITSIZE value. When using the Printer dialog box, Max determines the smallest number that the user can specify in the To text box.

Syntax

ctlname.Min = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max


MhCommonDialog: PrinterDefault

Description

The PrinterDefault property indicates whether the user's selections in the Print dialog box are used to change the system's default printer settings. The valid settings for the PrinterDefault property follow:

Setting	Description

True (-1)	(Default) The user's selections in the Print dialog box are used to change the system's default printer settings.

False (0)	The user's selections in the Print dialog box are not used to change the system's default printer settings.

Syntax

ctlname.PrinterDefault = Boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhCommonDialog: RemoveControl

Description

The RemoveControl property removes a VB control that has been added to a common dialog box with the AddControl property. To remove a VB control from a common dialog box, set the RemoveControl property to the hWnd of the desired control. This should be done in the CommonDialogClosed event, as follows:

' Move the Picture1 control from the common

' dialog box back to the parent form

MhCommonDialog1.RemoveControl = Picture1.hWnd

' Picture1 is now on the parent form

Picture1.Visible = False

Caution:  Once you add a control to a common dialog box, you must remove the control in the CommonDialogClosed event via the RemoveControl property. If you don't remove the control, any controls that have been added to the dialog will be destroyed when the dialog is closed. In addition, a UAE/GPF will most likely occur.

Syntax

ctlname.RemoveControl = setting%

Data Type

Integer

Availability

Run-Time Write

See Also

AddControl


MhCommonDialog: ToPage

Description

The ToPage property sets or returns the value for the To text box in the Printer dialog box. Use this property to determine the beginning page to be printed.

Syntax

ctlname.ToPage = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FromPage


MhCommonDialog: UserColors

Description

The UserColors property sets or returns the default “custom color palette” in the Choose Color dialog. These are the colors that appear below the predefined colors in that dialog box.

Syntax

ctlname.UserColors(element%) = colorvalue&

Data Type

Long Integer Array

Availability

Run-Time Read

Run-Time Write


MhCommonDialog: CommonDialogClosed

Description

The CommonDialogClosed event occurs when a common dialog box is being closed. The CommonDialogClosed event occurs when the WM_DESTROY message is received by the common dialog control. This event is necessary for removing any controls you may have added to a common dialog box via the AddControl property. Use the RemoveControl property to remove controls from a common dialog box. This event has the following parameters:

hWnd specifies the window handle of the common dialog box that is being closed.

WhichDialog specifies the type of dialog box that is being closed (using the same values as the Action property).

Syntax

Sub ctlname_CommonDialogClosed(hWnd As Integer, WhichDialog As Integer)


MhCommonDialog: CommonDialogOpened

Description

The CommonDialogOpened event occurs when a common dialog box is being opened. The CommonDialogOpened event occurs when the WM_INITDIALOG message is received by the common dialog control. This event is especially useful for adding your own controls to a common dialog box via the AddControl property. See the AddControl property for an example. This event has the following parameters:

hWnd specifies the hWnd of the common dialog box that is being opened.

WhichDialog specifies the type of dialog box that is being opened (using the same values as the Action property).

Syntax

Sub ctlname_CommonDialogOpened(hWnd As Integer, WhichDialog As Integer)


MhCommonDialog: FileNameChange

Description

The FileNameChange event occurs as the user changes files in the File Open and File Save dialog boxes. When using the File Open and File Save dialog boxes, the FileNameChange event occurs as the user selects different files in the file list. You can use this event to respond to each change the user makes, such as displaying the highlighted file in an MhFileDisplay control (which can be placed directly in the dialog box via the AddControl property). For example:

Sub MhCMDialog1_FilenameChange ()

  ' MhFileDisplay1 has been previously added to

  ' the dialog box in the CommonDialogOpened event.

  ' The contents of MhFileDisplay1 are now

  ' updated with each change in the File Open

  ' or File Save dialog box!

  MhFileDIsplay1.Filename = MhCmDialog1.Filename

End Sub

Other uses include setting a picture control to display images as each file is highlighted, displaying file statistics (size, date, time), etc.

Syntax

Sub ctlname_FileNameChange()


MhCommonDialog: Error Messages

The following list contains the trappable errors for the MhCommonDialog control. These constants are defined in the file CONSTANT.TXT included with Visual Basic:

Error	Constant / Description

32765	CDERR_INITIALIZATION	Common dialog function failed during initialization. Often occurs when sufficient memory is not available.

32761	CDERR_FINDRESFAILURE	The common dialog function failed to load a specified string.

32760	CDERR_LOADRESFAILURE	The common dialog function failed to load a specified resource.

32759	CDERR_LOCKRESFAILURE	The common dialog function failed to lock a specified resource.

32758	CDERR_MEMALLOCFAILURE	The common dialog function was unable to allocate memory for internal data structures.

32757	CDERR_MEMLOCKFAILURE	The common dialog function was unable to lock the memory associated with a handle.

32755	CDERR_CANCEL.	Cancel was selected.

32752	CDERR_ALLOC	Couldn't allocate memory for FileName or Filter.

32751	CDERR_HELP	Call to WinHelp failed. Check Helpxxx property values.

28671	PDERR_PRINTERCODES	The PD_RETURNDEFAULT flag was set in the Flags member of the PRINTDLG data structure, but either the hDevMode or hDevNames field was nonzero.

28670	PDERR_SETUPFAILURE	Load of the required resources failed.

28669	PDERR_PARSEFAILURE	The common dialog function failed to parse the strings in the [devices] section of the file WIN.INI.

28668	PDERR_RETDEFFAILURE	The PD_RETURNDEFAULT flag was set in the Flags member of the PRINTDLG data structure, but either the hDevMode or hDevNames field was nonzero.

28667	PDERR_LOADDRVFAILURE	The PRINTDLG function failed to load the specified printer's device driver.

28666	PDERR_GETDEVMODEFAIL	The printer device-driver failed to initialize a DEVMODE data structure. (This error constant only applies to printer drivers written for Windows version 3.0 or later).

28665	PDERR_INITFAILURE	The PRINTDLG function failed during initialization.

28664	PDERR_NODEVICES	No printer device-drivers were found.

28663	PDERR_NODEFAULTPRN	A default printer does not exist.

28662	PDERR_DNDMMISMATCH	The data in the DEVMODE and DEVNAMES data structures describes two different printers.

28661	PDERR_CREATEICFAILURE	The PRINTDLG function failed when it attempted to create an information context.

28660	PDERR_PRINTERNOTFOUND	The [devices] section of the file WIN.INI did not contain an entry for the requested printer.

24574	CFERR_NOFONTS	No fonts exist. Before displaying the Choose Font dialog box, you must set one of these flags: CF_BOTH, CF_PRINTERFONTS or CF_SCREENFONTS.

20478	FNERR_SUBCLASSFAILURE	An attempt to subclass a list box failed due to insufficient memory.

20477	FNERR_INVALIDFILENAME	File name is invalid.

20476	FNERR_BUFFERTOOSMALL	The buffer at which the member lpstrFile points is too small. When this error occurs, the minimum required string length is displayed in the first few characters of the FileName property.


MhCommonDialog: Overview

The MhCommonDialog control is an enhanced version of the Visual Basic common dialog control. MhCommonDialog is 100% compatible with the standard VB common dialog control and includes the following additional features:

-  You can add your own controls to a common dialog box. When controls are placed on a common dialog box, they will behave exactly like they do on a VB form. The standard VB events will continue to occur for each control.

-  When using the File Open and File Save dialog boxes, the FileNameChange event occurs as the user selects different files in the file list. You can place code in that event to respond to each change, such as displaying the highlighted file in an MhFileDisplay control.

-  You can resize or move a common dialog box to make room for your own controls.

The following table provides an overview of the MhCommonDialog control.

MhCommonDialog Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhCDia16.OCX MhCDia32.OCX MHCOMD.VBX	MhCommonDialog	See the MHCDIA sample directory.		MhFileDisplay MhFileList
Development Notes

Use the Action property at run time to display the desired common dialog box, or to launch the WinHelp program. Use the Flags property to specify various options that are available when invoking the dialog boxes.  When Action is 6 (Invoke WINHELP), use the Helpxxx properties to specify the help file, help context or keyword, and help command.

Adding a VB control to a common dialog box is simply a matter of setting the AddControl property to the hWnd of the desired control. This should be done in the CommonDialogOpened event as follows:

' Move Picture1 control from current form to the common dialog box

MhCommonDialog1.AddControl = Picture1.hWnd

' Position the Picture1 control as needed

Picture1.Top = 0   ' move to top/left in dialog

Picture1.Left = 0

' Use the control as usual...

Picture1.Picture = LoadPicture("mylogo.bmp")

Once the control has been added to the dialog, you can set the control's properties to manipulate its size, position, etc. The standard VB events will continue to occur while the control is contained within the dialog box. When using the File Open and File Save dialog boxes, the FileNameChange event occurs as the user selects different files in the file list.

Once you add a control to a common dialog box, you must remove the control in the CommonDialogClosed event via the RemoveControl property. If you don't remove the control, any controls that have been added to the dialog will be destroyed when the dialog is closed. In addition, a UAE/GPF will most likely occur.

If you need to resize or move a common dialog box to make room for your own controls, use the DialogTop, DialogLeft, DialogWidth and DialogHeight properties.

Note: The following paragraphs are for use of  MhCommonDialog under Windows 3.1.

During testing we found that it was much better for the VB programmer to provide 3-D effects for all dialogs on a per/program basis, rather than trying to do it for each dialog. With that in mind, the following information is provided so that you might give your dialogs (including common dialogs) a 3-D look.

'CTL3D.DLL routines:

Declare Function Ctl3dAutoSubclass Lib "ctl3d.dll" (ByVal HANDLE%) As Integer

Declare Function Ctl3dRegister Lib "ctl3d.dll" (ByVal HANDLE%) As Integer

Declare Function Ctl3dUnRegister Lib "ctl3d.dll" (ByVal HANDLE%) As Integer

Declare Function MhGetHInstance Lib "mhrun400.dll" () As Integer

Dim gHANDLE%

To convert the common dialog sample to 3-D effects add the above declarations to the form's general declarations section and the following code segments to the program:

Sub Form_Load ()

 gHANDLE% = MhGetHInstance()

 result% = Ctl3dRegister(gHANDLE%)

 result% = Ctl3dAutoSubclass(gHANDLE%)

End Sub

Sub Form_Unload (Cancel As Integer)

 result% = Ctl3dUnRegister(gHANDLE%)

End Sub

If you put a MHCOMD.VBX control on a MDI child form, the CommonDialogOpened custom event for this control will not be fired. A work-around is to put the control on a non-MDI child form that is never shown (Visible property set to False). However, there are two problems associated with this work-around:

1)  The common dialogs will no longer be modal. For modality, you must disable your MDI form before setting the Action property, and enable it immediately thereafter. You should also set the focus back to the MDI parent as you will probably experience a focus shift when disabling the form.

2)  You will have to unload the non-MDI child form containing the MHCOMD.VBX manually by using  FormName.Unload. Non-MDI child forms are not automatically unloaded when you unload the MDI parent. Failure to unload this form will cause your program not to terminate and may crash Windows.

If you are not using the custom events, then this problem will not affect you. Simply place the MhCommonDialog control on a MDI Child form, and use it as documented. We have reported the problem of the VB events not being fired to Microsoft, but have yet to receive any information on how to resolve this conflict.

Caution:  Owner Draw buttons do not draw correctly when added to a common dialog box and should not be used with the AddControl property.

Caution:  Command Buttons will only fire the Click event when they are added to a common dialog box. No other events are fired for the Command Button control (or any kind of control that is a sub-class of a command button).

Note:  When you add a control to a common dialog box, the added control must have a higher child ID value than the default controls in the common dialog box. Otherwise, the added control will behave like the common dialog's control of the same ID. The child ID is assigned by VB and is unavailable to us. If you find that your control is responding as if it were one of the common dialog's controls, you should do the following:

1.  Create a new control while the old control is intact.

2.  Delete the old control.

3.  Rename the new control to the old control name.

Note:  Since the MhCommonDialog control was designed to be 100% compatible with VB's common dialog control, the HelpContextID property is not supported.


MhDragDrop: AutoFiles

Description

The AutoFiles property indicates whether the ListCount, List, and Path (if available) properties are automatically retrieved from the server control when dragging to a client control. The Style property must be set to one (Server), and AutoLinkhWnd must point to a standard list box control (i.e. VB list box, file list, directory list, etc.). The valid settings for the AutoFiles property follow:

Setting	Description

True (-1)	(Default) The client control's ListCount, List, and Path (if available) properties are automatically updated as items are dragged from the server control.

False (0)	The ListCount, List, and Path properties must be set manually. This can be done in the SetFileNames and SetPath events which occur when dragging begins.

Syntax

ctlname.AutoFiles = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List, ListCount, Path


MhDragDrop: AutoLinkhWnd

Description

The AutoLinkhWnd property sets or returns the hWnd of a control that is used as a drag-drop server or client. Use the Style property to specify if the control is a server or client control. For example:

' Use a VB file list control as a server

MhDragDrop1.Style = 1  ' Server

MhDragDrop1.AutoLinkhWnd = File1.hWnd

' Use a VB list box control as a client

MhDragDrop2.Style = 0  ' Client

MhDragDrop2.AutoLinkhWnd = List1.hWnd

Syntax

ctlname.AutoLinkhWnd = objecthwnd%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Style


MhDragDrop: DragCursor

Description

The DragCursor property sets or returns the type of cursor that is displayed during dragging. The DragCursor setting may be set in the SetDragCursor event, which occurs when an item is initially dragged from the server control. When AutoFiles is True, the DragCursor setting is ignored and the SetDragCursor event does not occur. The valid settings for the DragCursor property follow:

Setting	Description

0	(Default) Single File (with +).

1	Multiple File (with +).

2	Single File (without +).

3	Multiple File (without +).

Syntax

ctlname.DragCursor = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoFiles, SetDragCursor event


MhDragDrop: DragToVBControlsOnly

Description

The DragToVBControlsOnly property indicates whether a server control can drag to non-VB applications such as the Windows File Manager. The valid settings for the DragToVBControlsOnly property follow:

Setting	Description

True (-1)	The server control will drag only to other VB controls.

False (0)	(Default) The server control will drag to VB controls as well as non-VB apps.

Syntax

ctlname.DragToVBControlsOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Supported


MhDragDrop: DropTypeID

Description

The DropTypeID property sets or returns a long integer value that is passed from the server to the client control whenever files are dropped on that control. When items are dropped on an MhDragDrop client, its DropTypeID property is automatically set to the DropTypeID property of the server control. For example:

MhDragDrop1.DropTypeID = 123

MhDragDrop1.Style = 1  ' The server control

MhDragDrop2.Style = 0  ' The client control

When items are dropped on MhDragDrop2 (the client control), its DropTypeID property will be set to 123, as specified with MhDragDrop1 (the server control).

This property allows you to drag items other than filenames between your own controls in your application.  Note that when items are dropped from a non-VB application (such as the Windows File Manager), DropTypeID is zero.

Syntax

ctlname.DropTypeID = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhDragDrop: List

Description

The List property sets or returns the items that are dragged and dropped between server and client controls. For client controls, the List array contains the filenames that were dropped. For server controls, if AutoFiles is True and AutoLinkhWnd points to a standard list box control (i.e. list box, file list, directory list, etc.), the List array is automatically set by the server control. If AutoFiles is False, you must set each List element (and the ListCount property) in the SetFileNames event.

Syntax

ctlname.List(element) = string$

Data Type

String Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoFiles, AutoLinkhWnd, ListCount


MhDragDrop: ListCount

Description

The ListCount property sets or returns the number of items in the list that are dragged and dropped between server and client controls. For client controls, the ListCount property can be read in the FilesDropped event to determine the number of items that have been dropped on the control. For server controls, this property can be set in the SetFilenames event to specify the number of files that will be dragged to the client control.

Syntax

ctlname.ListCount = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List, FilesDropped event, SetFilenames event


MhDragDrop: Path

Description

The Path property sets or returns the path name that is added to each filename when reporting (as a server) to the client. For server controls, if AutoFiles is True and AutoLinkhWnd points to a standard list box control (i.e. list box, file list, directory list, etc.), the Path property is automatically updated from the linked control's Path, if available. If AutoFiles is False, you can set the Path (as well as the List array and ListCount property) in the SetFileNames event. For example:

MhDragDrop1.Style = 1 ' Server control

MhDragDrop1.ListCount = 1

MhDragDrop1.List(0) = "myfile"

MhDragDrop1.Path = "c:\mypath"

When a client control receives items dragged from MhDragDrop1, its List array will contain one item: "c:\mypath\myfile".

Syntax

ctlname.Path = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoFiles, AutoLinkhWnd, List


MhDragDrop: Style

Description

The Style property indicates whether the control is a server or client. The valid settings for the Style property follow:

Setting	Description

0	(Default) Client control (receives dropped items)

1	Server control (sends dragged items)

Syntax

ctlname.Style = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DropTypeID, Supported


MhDragDrop: Supported

Description

The Supported property indicates whether drag and drop capabilities are supported in the current Windows session. The valid settings for the Supported property follow:

Setting	Description

True (-1)	Drag and drop is supported in this session.

False (0)	Drag and drop is not available in this session.

Syntax

ctlname.Supported = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DropTypeID, Style


MhDragDrop: FilesDropped

Description

The FilesDropped event occurs when items are dropped on a client control. This event occurs only when Style is zero (Client). The X and Y parameters indicate the mouse position where the drop occurred. Use the ListCount, List, and DropTypeID properties to determine the items that were dropped on the client control.

Syntax

Sub ctlname_FilesDropped(X As Integer, Y As Integer)


MhDragDrop: SetDragCursor

Description

The SetDragCursor event occurs when dragging is initiated from a server control, allowing you to set the DragCursor property before dragging begins. The SetDragCursor event occurs only when Style is one (Server) and AutoFiles is False; otherwise, the control automatically sets the drag cursor type.

Syntax

Sub ctlname_SetDragCursor()


MhDragDrop: SetFilenames

Description

The SetFilenames event occurs when dragging is initiated from a server control, allowing you to set the List and ListCount properties before dragging begins. The SetFileNames event occurs only when Style is one (Server) and AutoFiles is False. If AutoFiles is True and AutoLinkhWnd points to a standard list box control (i.e. list box, file list, directory list, etc.), the List and ListCount properties are automatically set by the server control.

Syntax

Sub ctlname_SetFileNames()


MhDragDrop: SetPath

Description

The SetPath event occurs when dragging is initiated from a server control, allowing you to set the Path property before dragging begins. The SetPath event occurs only when Style is one (Server) and AutoFiles is False. If AutoFiles is True and AutoLinkhWnd points to a standard list box control (i.e. list box, file list, directory list, etc.), the Path property is automatically set from the linked control's Path property (if available).

Syntax

Sub ctlname_SetPath()


MhDragDrop: Overview

The MhDragDrop control provides automated drag-drop capabilities in VB applications. You can drag and drop items within the same application, as well as with other non-VB applications. The following table provides an overview of the MhDragDrop control.

MhDragDrop Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHDRAG.VBX	MhDragDrop	See the MHDRAG sample directory.		MhInvisible MhStretch
Development Notes

Since MhDragDrop will also work under Windows 3.0 (which did not include drag-drop support), your applications can utilize drag-drop features in that environment as well. One exception is the Windows 3.0 File Manager, which does not support drag and drop operations.

The MhDragDrop control operates in two modes as determined by the Style property: Client (accepts dropped items) and Server (supplies dragged items). In both cases, you set the AutoLinkhWnd property to the hWnd of the VB control to use as the client or server.

To make a VB file list box act as a drag-drop server, and a list box act as a client, do the following:

-  Add an MhDragDrop control to the form and set its Style property to 1 (Server).

-  Add a second MhDragDrop control to the form and set its Style property to 0 (Client).

-  In the Form_Load procedure, set the AutoLinkhWnd property of the server MhDragDrop to the hWnd of the file list box. Set the AutoLinkhWnd property of the client MhDragDrop to the hWnd of the list box.

When you run the application at this point, all of the drag-drop functionality is in place - you only need to process the items that are dropped on the client control. When items are dropped, the client MhDragDrop will fire its FilesDropped event. You can use this event to process the dropped items, which are now contained in the MhDragDrop control's List, ListCount, and Path properties. For example:

Sub MhDragDrop2_FilesDropped(X As Integer,Y As Integer)

  List1.Clear

  For L = 0 To MhDragDrop2.ListCount - 1

    List1.AddItem MhDragDrop2.List(L)

  Next

End Sub

You may have noticed that we didn't have to tell the server MhDragDrop which items to drag from the file list. This was due to the AutoFiles property (the default value is True), which indicates that the contents of the ListCount, List, and Path properties should be automatically retrieved from the server control when dragging to a client control. Note that the AutoFiles feature will work only with a standard list box control (i.e. VB list box, file list, directory list, or other control that is sub-classed from a list box).

When AutoFiles is False, the SetPath, SetFileNames and SetDragCursor events occur when the drag is initiated. You can place code in these events to manually set the List, ListCount, Path and DragCursor properties. You can also assign a value to the DropTypeID property (similar to the standard Tag property), which will be received by the client MhDragDrop control. This is useful for indicating when items other than filenames are being dragged from the server. Note that when items are dropped from a non-VB application, DropTypeID is zero.

When the DragToVBControlsOnly property is True, an MhDragDrop server will only allow dragging to other VB controls, as opposed to non-VB applications.

Note:  VB list boxes, or controls sub-classed from a list box, will support drops from an MhDragDrop server only. For example, in Windows 3.1, you can drag items to the File Manager, but not vice-versa.


MhAnimate: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the MhAnimate Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionRight, CaptionTop


MhAnimate: AutoRepeat

Description

The AutoRepeat property indicates whether the bitmap sequence will be repeated automatically. The valid settings for the AutoRepeat property follow:

Setting	Description

True (-1)	Play bitmaps continually beginning at Min in the Picture array and going to Max in the Picture array as long as Play equals one. If PlayDirection is one, the pictures are displayed from Max to Min.

False (0)	(Default) Play the sequence of bitmaps once when the Play property is set to one. The control sets the Play property to zero after completing the sequence.

Syntax

ctlname.AutoRepeat = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Min, Play, PlayDirection


MhAnimate: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhAnimate: CaptionBottom

Description

The CaptionBottom property sets or returns the bottom display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionBottom property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionBottom = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionLeft, CaptionRight, CaptionTop


MhAnimate: CaptionLeft

Description

The CaptionLeft property sets or returns the left display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionLeft property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionLeft = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionRight, CaptionTop


MhAnimate: CaptionRight

Description

The CaptionRight property sets or returns the right display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionRight property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionRight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionTop


MhAnimate: CaptionTop

Description

The CaptionTop property sets or returns the top display position (in twips) of the caption portion of the control. This position is relative to the border of the control.

The CaptionTop property value must be positive and expressed in twips. The values for the CaptionTop and CaptionLeft properties are relative to the borders of the control. In other words, the top left corner of the caption area is CaptionTop units below the top of the control and CaptionLeft units to the right of the left border. Similarly, the values for the CaptionBottom and CaptionRight properties are relative to the bottom and right borders of the control.

Syntax

ctlname.CaptionTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionBottom, CaptionLeft, CaptionRight


MhAnimate: ColorDepth

Description

The ColorDepth property sets or returns the color depth used to display images within the control. The ColorDepth property allows you to display 256 color images as monochrome or 16 color images. The valid settings for the ColorDepth property follow

Setting	Description

0	(Default) Mono or 16 Color

1	256 Color

Syntax

ctlname.ColorDepth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhAnimate: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhAnimate: Interval

Description

The Interval property sets or returns the interval (in milliseconds) between the display of the pictures. The default value is 1,000. The range is zero to 32,767.

Syntax

ctlname.Interval = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, Play


MhAnimate: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhAnimate: Max

Description

The Max property sets or returns the highest element number in the Picture array that the control displays when it plays the bitmaps. The default value is nine. The range is zero to 32,767.

Syntax

ctlname.Max = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min, Picture


MhAnimate: Min

Description

The Min property sets or returns the lowest element number in the Picture array that the control displays. The default is zero. The range is zero to 32,767.

Syntax

ctlname.Min = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Picture


MhAnimate: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhAnimate: OuterFillColor

Description

The OuterFillColor property sets or returns the color that is displayed between the caption area and the outer border.

Syntax

ctlname.OuterFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextFillColor


MhAnimate: Picture

Description

The Picture property sets an array of images displayed by the control. Pictures are loaded into the Picture array in either of two ways: the LoadPicture function or assignment of an image from another Picture control. The following code examples demonstrate these approaches:

MhAnimate1.Picture(0) = LoadPicture(“balloon.bmp”)

MhAnimate1.Picture(0) = Picture1.Picture

You may select .BMP or .ICO files for this property. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

Syntax

ctlname.Picture(element) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Pictures


MhAnimate: PictureBottom

Description

The PictureBottom property sets or returns the bottom position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureBottom property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureBottom = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureTop


MhAnimate: PictureLeft

Description

The PictureLeft property sets or returns the left position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureLeft property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureLeft = picture

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureRight


MhAnimate: PictureRight

Description

The PictureRight property sets or returns the right position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureRight property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureRight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureLeft


MhAnimate: Pictures

Description

The Pictures property sets or returns the maximum number of pictures that the control can load into the Picture array. The default value is 10. The range is zero to 32,767.

The Picture array is zero-based. Therefore, a Pictures setting of 10 allows space for 11 pictures in the Picture array.

Syntax

ctlname.Pictures = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhAnimate: PictureTop

Description

The PictureTop property sets or returns the top position (in twips) where the pictures are displayed. This value is relative to the borders of the control.

The PictureTop property value must be positive and expressed in twips. The values for the picture position are relative to the borders of the control. In other words, the top left corner of the picture area is PictureTop twips below the top of the control and PictureLeft twips to the right of the left border. Similarly, the values for the PictureBottom and PictureRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.PictureTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureBottom


MhAnimate: Play

Description

The Play property sets or returns the playback status. The valid settings for the Play property follow:

Setting	Description

0	(Default) Stop the bitmaps from playing.

1	Start the bitmaps playing.

Syntax

ctlname.Play = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PlayDirection


MhAnimate: PlayDirection

Description

The PlayDirection property sets or returns the direction the control uses when it plays the sequence of bitmaps. The valid settings for the PlayDirection property follow:

Setting	Description

0	(Default) The playback proceeds from Min to Max.

1	The playback proceeds from Max to Min.

Syntax

ctlname.PlayDirection = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Play


MhAnimate: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhAnimate: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhAnimate: TextFillColor

Description

The TextFillColor property sets or returns the background color of the caption.

Syntax

ctlname.TextFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


MhAnimate: Value

Description

The Value property sets or returns the element in the Picture array that is currently displayed. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.Value = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhAnimate: Change

Description

The Change event occurs when the Value property changes, indicating that the control has displayed the next picture in the sequence or the Value property has been set from code.

Syntax

Sub ctlname_Change()


MhAnimate: PlayEnd

Description

The PlayEnd event occurs when the Max picture (or Min picture, if PlayDirection is one) is displayed.

Syntax

Sub ctlname_PlayEnd()


MhAnimate: Overview

The MhAnimate control is an enhanced picture box control that can display a sequence of bitmaps. Once you set the MhAnimate control's properties, it runs without further attention by your program. MhAnimate has properties to control the speed, direction and content of playback. The following table provides an overview of the MhAnimate control.

MhAnimate Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhAnim16.OCX MhAnim32.OCX MHAN200.VBX	MhAnimate	See the MHANIM sample directory.		MhMarque MhOddPic
Development Notes

MhAnimate controls are useful when you want to draw the user's attention to a form or an area on a form. For example, if your program simulates a mechanical device, you may want to use the MhAnimate control to display a series of pictures that represent an out of range condition, rather than relying on a text message.

In design mode, you specify the number of pictures to be placed in the Picture array with the Pictures property. At run time, you load pictures into the array, and the control displays them according to the other properties you set. To create an MhAnimate control that displays pictures, follow these steps:

At design time:

1.  Draw an MhAnimate control on a form.

2.  Set the values of the inner properties (Captionxxx and Picturexxx).

3.  Set the Pictures property to the maximum number of pictures you want the control to display.

4.  Set any of the other animation-related properties that are appropriate. These include AutoRepeat, Max, Min, and PlayDirection.

At run time:

1.  Load pictures into the control by setting the values of the Picture array elements to the pictures you wish to display.

2.  Set the Play property to one to start playing the sequence of bitmaps.

Once you set the Play property to one, the playback will not begin if any of the conditions listed below exist:

-  The Enabled property is False.

-  The Visible property is False.

-  There are no pictures loaded.

-  Min and Max are set such that no playback is possible.

When Play is first set to one, MhAnimate sets the Value property to Min (or Max if PlayDirection is one) and displays the picture that corresponds to that element. Each Interval milliseconds thereafter, the control increments (or decrements, if PlayDirection is one) the Value property and displays Picture(element). This process continues until Value is equal to Max (or Min, if PlayDirection is one). The control repeats the sequence if AutoRepeat is True. If AutoRepeat is False, the Play property is set to zero and the Max (or Min, if PlayDirection is one ) picture is displayed.

The Min and Max properties allow you to play different sequences from within the same control. For example, you can load the first sequence from 0 to 9 in the Picture array, a second sequence from 10 to 15, and a third from 16 to 20. By changing Min and Max, you can select the sequence to display.

Note:  Since you can't set the values of the MhAnimate Picture array property at design time, consider storing the pictures you want to display in a series of Picture controls on a form. At load time, you can simply assign the Picture property of the Picture control to the appropriate MhAnimate.Picture() array element.  For example, the instruction

MhAnimat1.Picture(0) = Picture1(0).Picture

assigns the first element of a Picture control array, named Picture1, to the first element of the MhAnimat1.Picture property array.

The MhAnimate control contains two custom events. The Change event occurs after each new picture is displayed and the PlayEnd event occurs after the last picture, specified by the Max property (or Min, if PlayDirection is one), in the current sequence is displayed. These events are a perfect place to add sound effects to the animation sequence.

This control contains two sets of inner properties (defined by the Captionxxx and Picturexxx properties). These properties define where the caption and the picture are displayed within the control. Both sets of properties are expressed in twips and are relative to the border of the control. That is, setting xxxxLeft = 5 sets the left border 5 twips inside the control's left border; setting xxxxBottom = 5 sets the bottom border 5 twips inside the control's bottom border.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.


MhTip: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The valid settings for the Alignment property follow:

Setting	Description

0	(Default) Align to left

1	Align to right

2	Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhTip: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area when a bitmap is assigned to the Picture property. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	Automatically resize the picture areas based on the size of the Picture image.

 False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WallPaper


MhTip: AutoSizeToText

Description

The AutoSizeToText property indicates whether the control will automatically size itself so the Caption text fits inside the control. The valid settings for the AutoSizeToText property follow:

Setting	Description

True (-1)	(Default) Automatically size the control to the text.

False (0)	Do not resize the control to fit the text.

Syntax

ctlname.AutoSizeToText = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTip: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner, BevelStyle


MhTip: BevelSizeInner

Description

The BevelSizeInner property specifies the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle, BevelStyleInner


MhTip: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTip: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhTip: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhTip: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTip: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTip: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTip: Interval

Description

The Interval property sets or returns the interval (in milliseconds) the control will wait before firing the SetCaption event. The default value is 1,000. The range is zero to 2,147,483,647. Setting Interval to zero is the same as setting Enabled to False.

Syntax

ctlname.Interval = integer&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SetCaption event


MhTip: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhTip: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTip: NoTipCapture

Description

The NoTipCapture property determines whether the tip will disappear when the user clicks the control associated with the tip. The valid settings for the NoTipCapture property follow:

Setting	Description

True	Clicking on the control associated with the tip will not cause the tip to disappear. The tip will continue to be displayed until the mouse is moved outside of the control.

False	Clicking on the control associated with the tip will cause the tip to disappear.

Syntax

ctlname.NoTipCapture = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TipChildren


MhTip: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhTip: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTip: TipChildren

Description

The TipChildren property determines whether the tip will be displayed over controls located inside containers that are siblings of the tip. For example, suppose you had a form with a picture box and tip control. The picture box contains three buttons. Normally, the tip would be displayed over the picture box since it is a sibling control. However, the tip won’t be displayed over the buttons in the picture box since they are children of the picture box and not siblings of the tip. The TipChildren property can be used to change this tip behavior. The valid settings for the TipChildren property follow:

Setting	Description

True	Tips are displayed over the children of MhTip sibling controls.

False	Tips are not displayed over the children of MhTip sibling controls.

Syntax

ctlname.TipChildren = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

NoTipCapture


MhTip: TipOffsetLeft

Description

The TipOffsetLeft property specifies the left offset (in pixels) of the tip from the mouse hot-spot. The tip is displayed to the left of the mouse hot-spot. The default value is 10.

Syntax

ctlname.TipOffsetLeft = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TipOffsetTop


MhTip: TipOffsetTop

Description

The TipOffsetTop property specifies the top offset (in pixels) of the tip from the mouse hot-spot. The tip is displayed below the mouse hot-spot. The default value is 10.

Syntax

ctlname.TipOffsetTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TipOffsetLeft


MhTip: TipStyle

Description

The TipStyle property sets or returns the style of outline in which to display the tip. The valid settings for the TipStyle property follow:

Setting	Description

0	Square

1	Balloon

2	Windows ’95 style

Syntax

ctlname.TipStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTip: TipVisible

Description

The TipVisible property returns whether or not a tip is currently visible. The valid settings for the TipVisible property follow:

Setting	Description

True	A tip is currently displayed.

False	No tip is displayed.

Syntax

ctlname.TipVisible

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


MhTip: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhTip: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


MhTip: HideTip

Description

The HideTip event occurs when the tip disappears as the result of a mouse move or the firing of a control’s click event..

Syntax

Sub ctlname_HipTip()


MhTip: SetCaption

Description

The SetCaption event occurs when the mouse cursor moves over a sibling of the control.

ctlname contains the name of the control that the mouse is over (not provided in VB1 or C++). If ctlname refers to a control that is in a control array, the name is returned with the index in parentheses,  for example CtlName(0).

hWnd contains the window handle of the control (if it has one). Use this in VB1 and C++ to identify the control, rather than the control name.

MakeVisible determines whether the tip window will be displayed or not. The default is True. Setting this parameter to False will prevents the display of the tip window.

MouseX and MouseY contain the mouse position in screen coordinates (pixels relative to the upper left of the screen).

Syntax

Sub ctlname_SetCaption (ctlname As String, hWnd As Integer, MakeVisible As Integer, MouseX As Integer,MouseY As Integer)


MhTip: Overview

The MhTip control is used to provide pop-up captions when the mouse is moved over other designated controls. The following table provides an overview of the MhTip control.

MhTip Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhTip16.OCX MhTip32.OCX MHTIP.VBX	MhTip	See the MHTIP sample directory.		Mh3dLabel
Development Notes

The MhTip control is invisible until the mouse cursor is dragged over a sibling control (another control within the same container as the MhTip control) and allowed to remain there undisturbed for the length of time specified by Interval. When this occurs, the SetCaption event is fired and, if not interrupted by your program, a balloon tip pops up over the sibling control.

When the SetCaption event fires, you have the option of changing the caption of the MhTip and the location where the MhTip will be displayed, or not showing the MhTip at all.

By manipulating the colors of the control you can make it appear just like the ToolTip boxes in Microsoft Word for Windows 6.0 and Microsoft Excel for Windows 5.0. Since MhTip allows beveled edges and pictures, you can even make them look better than the tip boxes in those applications.


MhCard: CardBack

Description

The CardBack property sets or returns the card-back image to display when the Value property is zero. See the following table for pictures of the available card backs. The following values are valid for the CardBack property.

Setting	Description

0	(Default) Red Checks

1	Blue Checks

2	Red Hatch

3	Blue Hatch

4	Robot

5	Roses

6	Leaves #1

7	Leaves #2

8	Fish

9	Conch

10	Castle

11	Beach

12	Hand

13	Custom

Syntax

ctlname.CardBack = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Suit, Value


MhCard: CustomBack

Description

The CustomBack property sets or returns the bitmap displayed as the card back. This property is only used when CardBack is set to 13.

Syntax

ctlname.CustomBack = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CardBack


MhCard: Suit

Description

The Suit property specifies the card suit to use when the Value property is nonzero. The valid settings for the Suit property follow:

Setting	Description

0	(Default) Clubs

1	Diamonds

2	Hearts

3	Spades

Syntax

ctlname.Suit = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CardBack, Value


MhCard: Value

Description

The Value property sets or returns the card image to display. The valid settings for the Value property follow:

Setting	Description

0	(Default) Card back (not the face)

1	Ace

2-10	Deuce through ten

11	Jack

12	Queen

13	King

14	Joker

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CardBack, Suit


MhCard: Overview

The MhCard control lets you display any card from a standard 52-card deck of playing cards. This control is similar in concept to a Picture control, except that it displays a fixed set of bitmaps. The following figure shows several example MhCard controls. The following table provides an overview of the MhCard control.

MhCard Control Examples.

MhCard Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhCard16.OCX MhCard32.OCX MHCD200.VBX	MhCardDeck	See the  MHCARD sample directory.	N/A	MhDice
Development Notes

To display a card, simply set the Value property, the Suit property, the CardBack property, and MhCard does the rest! The following table lists the available card backs

MhCard Card Backs

Description	Value	Image	Description	Value	Image
Red/Blue Checks	0/1		Fish	8
Red/Blue Hatch	2/3		Conch	9
Robot	4		Castle	10
Roses	5		Beach	11
Leaves #1	6		Hand	12
Leaves #2	7


MhTab: ActiveFolder

Description

The ActiveFolder property sets or returns the folder with the focus. In design mode, the ActiveFolder and Folder properties are always the same. At run time, they can may be different. Use the Folder property to specify the which folder is affected by the Tabxxx property values. Set the ActiveFolder property to change the focus to a different tab. To set the Tabxxx or Pagexxx properties for the active folder, first set Folder = ActiveFolder.

Syntax

ctlname.ActiveFolder = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folder


MhTab: Align

Description

The Align property indicates whether the control can appear anywhere on the form or if it is forced to the top or bottom of the form and automatically sized to the form's width. The valid settings for the Align property follow:

Setting	Description

0	(Default) None. The control can be placed anywhere on the parent and resized at both design and run time.

1	Align to Top. The control is automatically moved to the top of the parent and the control's width set equal to the scale width of the parent.

2	Align to Bottom. The control is automatically moved to the bottom of the parent and the control's width set equal to the scale width of the parent.

Syntax

ctlname.Align = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhTab: Alignment

Description

The Alignment property sets or returns the alignment of the TabCaption property for all tabs that have their TabAlignment property set to 3. See the TabAlignment property to set the alignment for individual tabs. The valid settings for the Alignment property follow:

Setting	Description

0	(Default) Align to Left

1	Align to Right

2	Align to Center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabAlignment, TabCaption


MhTab: AssociateChildren

Description

The AssociateChildren property indicates whether child controls will be associated with, and appear within, a particular folder. The valid settings for the AssociateChildren property follow:

Setting	Description

True (-1)	(Default) The control will manage the child controls placed on the MhTab control so the child controls appear only within the folder that acts as their container.

False (0)	Child controls appear all of the time and are not be associated with a particular folder.

As an example, you might use the True setting for option configurations where the different folders will use different child controls to set options. You might use the False setting when the controls for all of the tabs are the same, but the information loaded into them is different, such as an address book.

Note: This property should be set prior to adding child controls within the MhTab control.

Syntax

ctlname.AssociateChildren = boolean%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTab: BorderColor

Description

The BorderColor property sets or returns the color of the outer border of the control.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle, FillColor


MhTab: BorderStyle

Description

The BorderStyle property sets or returns the control's border style used for pages. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTab: FillColor

Description

The FillColor property sets or returns the color used to fill the control. If an image is being used for the Picture property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTab: Folder

Description

The Folder property sets or returns the folder that affects the Tabxxx and Pagexxx property settings. Folders are numbered from 0 to TabsPerRow - 1 and from left to right on row zero. Row one starts with the folder numbered TabsPerRow and increases as you move to the right. Row two starts with TabsPerRow * 2 and increases left to right, and so forth.

Syntax

ctlname.Folder = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabsPerRow


MhTab: Folders

Description

The Folders property sets or returns the number of folders in the control. Changing this property has the immediate effect of changing the number of tabs that are available to be selected. The tab is the portion of the folder that is visible at all times. Decreasing this value will lose any custom property settings for folders above the new value. Increasing this value causes the new folders' properties to take on default values.

Syntax

ctlname.Folders = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folder


MhTab: FontEscapement

Description

The FontEscapement property sets or returns the direction in which text is drawn relative to the first character. The default value is zero (draw text from left to right on a horizontal line). The valid range is 0 to 3600. Values greater than 3600 or less than zero are evaluated MOD 3600. Think of escapement as the direction text is drawn relative to the first character, along a line drawn (FontEscapement/10) degrees counter-clockwise.

If FontEscapement is 900, characters are drawn 90 degrees perpendicular to the starting character (straight up), 1800 causes text to be drawn 180 degrees to the left (backwards) and 2700 draws text straight down. FontEscapement doesn't affect how individual characters appear, only the direction in which they're drawn.

Syntax

ctlname.FontEscapement = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontOrientation


MhTab: FontOrientation

Description

The FontOrientation property sets or returns the number of degrees the characters should be rotated, relative to the baseline specified in FontEscapement. The default value is zero (draw the text perpendicular to baseline). Any values greater than 3600 or less than zero are evaluated MOD 3600. While the FontEscapement property rotates the baseline, or direction the line of text is drawn in relation to the starting point, the FontOrientation rotates the individual characters in the text. Setting this property to 900 causes the characters to be drawn on their backs, while 1800 appears upside down.

Syntax

ctlname.FontOrientation = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontEscapement


MhTab: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to three or four (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTab: LightColor

Description

The LightColor property sets or returns the light color, as opposed to the shadow color, of the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhTab: NoFocusRect

Description

The NoFocusRect property sets or returns the operation of the focus rectangle. The valid settings for the NoFocusRect property follow:

Setting	Description

True (-1)	The focus rectangle is never drawn, even when the control has focus.

False (0)	(Default) The focus rectangle is drawn normally.

Syntax

ctlname.NoFocusRect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTab: NoPrefix

Description

The NoPrefix property indicates whether ampersand characters are displayed in the caption, without requiring the use of double ampersands (&&). The valid settings for the NoPrefix property follow:

Setting	Description

True (-1)	Ampersand characters are displayed and do not cause the next character to be underlined.

False (0)	(Default) Ampersand characters are not displayed unless you embed a double ampersand in the string. The next character after the ampersand is underlined.

Syntax

ctlname.NoPrefix = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabCaption


MhTab: PageBevelSize

Description

The PageBevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the page. The default value is zero, which means that no border is drawn around the edge of the page. The valid range is zero to 32,767. You can modify the 3-D appearance of the page by setting the PageBevelSize property to a value greater than zero and trying different PageBevelStyle settings.

Syntax

ctlname.PageBevelSize = integer%

Data Type

Integer

Availability

Design-Time 	Run-Time Read     Run-Time Write

See Also

PageBevelStyle


MhTab: PageBevelStyle

Description

The PageBevelStyle property sets or returns the type of bevel used for the border around the outer edge of the page. If PageBevelSize is zero, PageBevelStyle is ignored and no bevel is drawn around the page. The valid settings for the PageBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the page with the colors specified in the LightColor and ShadowColor properties. When PageBevelStyle is set to zero, one or two, the bevel is drawn around all four sides of the page. When PageBevelStyle is three or four, the bevel is drawn around only two sides, giving the page a shadowed effect.

Syntax

ctlname.PageBevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageBevelSize


MhTab: PageBorderColor

Description

The PageBorderColor property sets or returns the color of the outer border of the page.

Syntax

ctlname.PageBorderColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageBorderStyle


MhTab: PageBorderStyle

Description

The PageBorderStyle property sets or returns the border style used for the page. The valid settings for the PageBorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.PageBorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageBorderColor


MhTab: PageFillColor

Description

The PageFillColor property sets or returns the color used to fill the page.

Syntax

ctlname.PageFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageBorderColor


MhTab: PageLightColor

Description

The PageLightColor property sets or returns the light color, as opposed to the shadow color, of the page.

Syntax

ctlname.PageLightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageShadowColor


MhTab: PagePicture

Description

The PagePicture property specifies the graphics image to be loaded into the picture area of the page. The valid settings for the PagePicture property follow:

Setting	Description

(none)	(Default) No picture

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PagePicture = picture

Data Type

Picture

Availability

Run-Time Read

Run-Time Write

See Also

PageWallPaper


MhTab: PageShadowColor

Description

The PageShadowColor property sets or returns the shadow color of the page.

Syntax

ctlname.PageShadowColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PageLightColor


MhTab: PageWallPaper

Description

The PageWallPaper property sets or returns the method to use when displaying the image in the PagePicture property. The valid settings for the PageWallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as 	many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.PageWallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PagePicture


MhTab: PictureAlignment

Description

The PictureAlignment property sets or returns the alignment of tab pictures. The valid settings for the PictureAlignment property follow:

Setting	Description

0	(Default) Align to Left

1	Align to Right

2	Center

Syntax

ctlname.PictureAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureVAlignment


MhTab: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the tabs. The default value is zero. The valid range is 0 to 32,767. If  PictureHeight and PictureWidth are zero, no picture is displayed.

Syntax

ctlname.PictureHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


MhTab: PictureVAlignment

Description

The PictureVAlignment property sets or returns the vertical alignment of the pictures in the tabs. The valid settings for the PictureVAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	(Default) Center

Syntax

ctlname.PictureVAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureAlignment


MhTab: PictureWidth

Description

The PictureWidth property sets or returns the width (in pixels) of all pictures displayed in the tabs. The default value is zero. The valid range is 0 to 32,767. If  PictureHeight and PictureWidth are zero, no picture is displayed.

Syntax

ctlname.PictureWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


MhTab: ScaleHeight

Description

The ScaleHeight property returns the height (in twips) of the control's client area. You can use these properties to size a child control to the same size as a page. If you want a child control to completely fill the page for a particular folder, the best way to accomplish this is to do the following:

1.  In design mode position the control such that the top and left coordinates are correct, i.e. the control is in the upper left corner of the page.

2.  Then  in run mode execute the following code (this assumes the control is on folder 0):

mhtab1.Folder = 0

control.Width = mhtab1.ScaleWidth

control.Height = mhtab1.ScaleHeight

Note that setting the Folder property is important only if the PageBorderStyle or PageBevelSize settings vary from folder to folder.

If you must set the Top and Left properties at run time, Top can be set without regard to the active folder, but the Left property cannot. The MhTab control controls the visibility of the child controls by moving them to the left 75,000 twips. If you set the Left property of a control that is on an inactive folder, you must take this into consideration. Also, both the Top and Left properties must adjust for any PageBorderStyle and PageBevelSize.

The following code will adjust a child control to fill page zero:

mhtab1.Folder = 0

If mhtab1.ActiveFolder = 0 Then

    control.Left = screen.TwipsPerPixelX * (mhtab1.PageBorderStyle + mhtab1.PageBevelSize)

Else

    control.Left = screen.TwipsPerPixelX * (mhtab1.PageBorderStyle +  mhtab1.PageBevelSize) - 75000

End If

control.Top = (screen.TwipsPerPixelY * mhtab1.PageBevelSize)

control.Width = mhtab1.ScaleWidth

control.Height = mhtab1.ScaleHeight

Syntax

ctlname.ScaleHeight = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

ScaleWidth


MhTab: ScaleWidth

Description

The ScaleWidth property returns the width (in twips) of the control's client area. See ScaleHeight for more information.

Syntax

ctlname.ScaleWidth = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

ScaleHeight


MhTab: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhTab: TabAlignment

Description

The TabAlignment property sets or returns the alignment of the TabCaption property for the tab specified in Folder. The valid settings for the TabAlignment property follow:

Setting	Description

0	Align to Left

1	Align to Right

2	Align to Center

3	Use the value in Alignment

Syntax

ctlname.TabAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabCaption


MhTab: TabAutoSize

Description

The TabAutoSize property indicates whether the picture area of the tab should automatically size to the image in TabPicture. The valid settings for the TabAutoSize property follow:

Setting	Description

True (-1)	Size the picture area to the size of the TabPicture bitmap.

False (0)	Stretch or shrink the bitmap to the size of the picture area.

Syntax

ctlname.TabAutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabPicture


MhTab: TabBevelSize

Description

The TabBevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the tab specified in Folder. The valid range is zero to 32,767. You can modify the 3-D appearance of the tab by setting the TabBevelSize property to a value greater than zero and trying different TabBevelStyle settings.

Syntax

ctlname.TabBevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabBevelStyle


MhTab: TabBevelStyle

Description

The TabBevelStyle property sets or returns the type of bevel used for the border around the outer edge of the tab specified in Folder. If TabBevelSize is zero, TabBevelStyle is ignored and no bevel is drawn around the tab. The valid settings for the TabBevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the tab with the colors specified in the LightColor and ShadowColor properties. When TabBevelStyle is set to zero, one or two, the bevel is drawn around all four sides of the tab. When TabBevelStyle is three or four, the bevel is drawn around only two sides, giving the tab a shadowed effect.

Syntax

ctlname.TabBevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabBevelSize


MhTab: TabBorderColor

Description

The TabBorderColor property sets or returns the color of the outer border of the tab specified in Folder.

Syntax

ctlname.TabBorderColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabBorderStyle


MhTab: TabBorderStyle

Description

The TabBorderStyle property sets or returns the border style used for the tab specified in Folder. The valid settings for the TabBorderStyle property follow:

Setting	Description

0	Square

1	Rounded

2	Slanted

3	Chamfered

Syntax

ctlname.TabBorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabBorderColor


MhTab: TabCaption

Description

The TabCaption property sets the caption for the tab specified in Folder.

Syntax

ctlname.TabCaption = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folder


MhTab: TabEnabled

Description

The TabEnabled property determines whether the tab specified in Folder is enabled.

Syntax

ctlname.TabEnabled = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabCaption


MhTab: TabFillColor

Description

The TabFillColor property sets or returns the color used to fill the tab specified in Folder.

Syntax

ctlname.TabFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabBorderColor


MhTab: TabFontBold

Description

The TabFontBold property indicates whether the style for the font in TabFontName includes bold.

Syntax

ctlname.TabFontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFontEscapement

Description

The TabFontEscapement property specifies the direction in which text is drawn relative to the first character. This setting applies to all the tab specified in Folder. The default value is zero (draw text from left to right on a horizontal line). The valid range is 0 to 3600.

Syntax

ctlname.TabFontEscapement = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontOrientation


MhTab: TabFontItalic

Description

The TabFontItalic property indicates whether the style for the font in TabFontName includes italic.

Syntax

ctlname.TabFontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFontName

Description

The TabFontName property specifies the name of the font to use with the tab specified in Folder.

Syntax

ctlname.TabFontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontBold, TabFontItalic, TabFontUnderline


MhTab: TabFontOrientation

Description

The TabFontOrientation property sets or returns the number of degrees the characters should be rotated, relative to the baseline specified in TabFontEscapement. This setting applies to the tab specified in Folder.

Syntax

ctlname.TabFontOrientation = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontEscapement


MhTab: TabFontSize

Description

The TabFontSize property specifies the size of the font in TabFontName.

Syntax

ctlname.TabFontSize = value!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFontStrikeThru

Description

The TabFontStrikeThru property indicates whether the style for the font in TabFontName includes strikethrough.

Syntax

ctlname.TabFontStrikeThru = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFontStyle

Description

The TabFontStyle property sets or returns the 3-D effect of the text or caption for the tab specified in Folder. The valid settings for the TabFontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the TabLightColor and TabShadowColor properties. When TabFontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the TabLightColor value and the right and lower portions with the TabShadowColor value. When TabFontStyle is set to three or four (lowered), the outline colors are reversed.

Syntax

ctlname.TabFontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabLightColor, TabShadowColor


MhTab: TabFontTransparent

Description

The TabFontTransparent property determines whether background text or graphics are included with the characters in the font specified by TabFontName.

Syntax

ctlname.TabFontTransparent = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFontUnderline

Description

The TabFontUnderline property indicates whether the style for the font in TabFontName includes underline.

Syntax

ctlname.TabFontUnderline = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabFontName


MhTab: TabFormat

Description

The TabFormat property sets or returns the string that determines the format of the caption for the tab specified by the Folder property. This property follows the conventions of Visual Basic's Format$.

Syntax

ctlname.TabFormat = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folder


MhTab: TabHeight

Description

The TabHeight property sets or returns the height of the tab specified by Folder.

Syntax

ctlname.TabHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabWidth


MhTab: TabLightColor

Description

The TabLightColor property sets or returns the light color, as opposed to the shadow color, of the tab specified in Folder.

Syntax

ctlname.TabLightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabShadowColor


MhTab: TabMultiLine

Description

The TabMultiLine property indicates whether the caption for the tab specified in Folder extends over more than one line. The valid settings for the TabMultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabCaption


MhTab: TabOffset

Description

The TabOffset property sets or returns the amount (in pixels) that subsequent rows of tabs are offset from the first row. This property setting affects all tabs. The default is 12 pixels.

Syntax

ctlname.TabOffset = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folders


MhTab: TabPicture

Description

The TabPicture property specifies the graphics image to be loaded into the picture area of the tab specified by Folder.

Syntax

ctlname.TabPicture = picture

Data Type

Picture

Availability

Run-Time Read

Run-Time Write

See Also

TabAutoSize


MhTab: TabPosition

Description

The TabPosition property indicates the position of the tabs. This property setting affects all tabs. The valid settings for the TabPosition property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Right

3	Left

Syntax

ctlname.TabPosition = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabSpacing


MhTab: TabShadowColor

Description

The TabShadowColor property sets or returns the shadow color of the tab specified in Folder.

Syntax

ctlname.TabShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabLightColor


MhTab: TabSpacing

Description

The TabSpacing property sets or returns the spacing (in pixels) between tabs. This property setting affects all tabs. The default setting is zero indicating tabs are drawn next to each other.

Syntax

ctlname.TabSpacing = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabPosition


MhTab: TabsPerRow

Description

The TabsPerRow property sets or returns the number of tabs on each row. The number of folders is determined by the Folders setting.

Syntax

ctlname.TabsPerRow = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Folders


MhTab: TabTextColor

Description

The TabTextColor property sets or returns the text color for the tab specified in Folder.

Syntax

ctlname.TabTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabLightColor, TabShadowColor


MhTab: TabVAlignment

Description

The TabVAlignment property sets or returns the vertical alignment of the TabCaption property for the tab specified in Folder. The valid settings for the TabVAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	Center

3	Use  the value in VAlignment

Syntax

ctlname.TabVAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabAlignment


MhTab: TabVisible

Description

The TabVisible property indicates whether the tab specified in Folder is visible.

Syntax

ctlname.TabVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabEnabled


MhTab: TabWidth
MhTab: TabWallpaper

Description

The TabWallPaper property sets or returns the method to use when displaying the image in the TabPicture property. The valid settings for the TabWallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.TabWallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabPicture


MhTab: TabWallpaper
MhTab: TabWidth

Description

The TabWidth property sets or returns the width of the tab specified by Folder.

Syntax

ctlname.TabWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabHeight


MhTab: TextColor

Description

The TextColor property sets or returns the color used to draw text in the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTab: Transparent

Description

The Transparent property indicates whether the bitmaps within the control are transparent. The valid settings for the Transparent property follow:

Setting	Description

True (-1)	The bitmap will be drawn so the background or current fill color will show through those portions of the bitmap that contain the TransparentColor.

False (0)	(Default) The bitmap will be drawn with its true color

Syntax

ctlname.Transparent = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TransparentColor


MhTab: TransparentColor

Description

The TransparentColor property sets or returns the color that will be replaced by the fill color in bitmaps that are drawn with transparent portions. This property is ignored unless the Transparent property is set to True. The fill color that will be used in place of this color will be the current fill color. In MhTab that could be any TabFillColor or the default FillColor.

Syntax

ctlname.TransparentColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Transparent


MhTab: VAlignment

Description

The VAlignment property sets or returns the vertical alignment of the TabCaption property for all tabs that have their TabVAlignment property set to 3 (Use VAlignment). The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TabVAlignment


MhTab: TabChanged

Description

The TabChanged event occurs after the folder change is completed. Unlike the TabChanging event, setting the TabNew argument during this event has no effect. Note that this event occurs when setting the ActiveFolder property in code, but not when setting the Folder property.

Syntax

Sub ctlname_TabChanged(TabNew As Integer, TabOld As Integer)


MhTab: TabChanging

Description

The TabChanging event occurs just before the active folder is changed. To direct the MhTab control to select a different active folder than the one contained in the TabNew variable, set the TabNew variable to the desired value during this event. Note that this event occurs when setting the ActiveFolder property in code, but not when setting the Folder property.

Syntax

Sub ctlname_TabChanging(TabNew As Integer, TabOld As Integer)


MhTab: Overview

The MhTab control is a multi-container control with tabs that resemble 3-by-5 tab cards. The tabs are used to select the folders contained within the control. The programmer can define the number of folders per row and the total number of folders. The following figure shows an example of an MhTab control. The following table provides an overview of the MhTab control.

MhTab Control Example.

MhTab Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhTab16.OCX MhTab32.OCX MHTAB.VBX	MhTab	See the MHTAB sample directory.		Mh3dGroup
Development Notes

MhTab controls can contain text and/or pictures. You can also combine the pictures with the text in the same fashion you would with list boxes, with the picture to the left of the text.

There are four tab styles to choose from: square, chamfered (shown above), slanted, and rounded. Each style allows bevels to achieve a 3-D appearance.

For purposes of discussion, a folder is one unit in the tab control and consists of a page and a tab. The tab is the part of the folder that is visible at all times, while the page is the part that becomes visible when the folder is selected. The page is also the part that holds the controls that are placed within the tab control.

In design mode you can select tabs (along with their corresponding pages) with the right mouse button. At run time switching between the containers is accomplished with either the left mouse button or the arrow keys, provided that the tab control has the focus.

The Pagexxx properties affect the page on the specified folder. Folders and tabs are selected by setting the Folder property. When a folder is specified, the corresponding tab and page will be selected at the same time.

Most Tabxxx properties affect the tab associated with a particular folder. Exceptions to this include the TabStop and TabIndex standard properties and the TabBorderStyle, TabOffset, TabPosition, TabSpacing and TabsPerRow custom properties.

MhTab manipulates the TabStop property in order to keep off-screen controls from receiving the focus when using the Tab key to move from control to control within a particular folder. When a control's folder is not active, its TabStop is set to False.

Note:  VB's option button has an anomaly, in that the TabStop property is changed when the Value property is set. Setting the Value property of a standard option button while it is moved off screen will cause the TabStop property to be set to True. It will then be included in the tabbing order and the control could receive focus while it is not visible. The Mh3dOption button in VBTools does not exhibit this behavior. The best solution is to use Mh3dOption buttons rather than VB's option button.

The Folders property tells the control how many folders you want within the control. The Folder property is used to identify a particular folder whose properties you wish to address. At run time, the ActiveFolder property sets or returns the folder with the focus. At design-time, ActiveFolder and Folder will always be the same.

You can control how MhTab handles its child controls using the AssociateChildren property. If AssociateChildren is set to False, controls added to the MhTab container will appear on each folder. This can be used when you don't want to change controls, but want to know what tab the user has selected. A good example of this would be an address book application. You could place a list box on the MhTab and have it show only those entries beginning with the letter selected from the tabs by the user.

You can display images within the control on the tabs and on the pages. The Picturexxx properties let you control their appearance and placement. Load the pictures into the PagePicture and TabPicture properties after selecting the desired Folder. The PagePicture is used like wallpaper for the folder.


MhOddPic: AutoSize

Description

The AutoSize property indicates whether the container should size to the image in the Picture property. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	Size the control to the bitmap dimensions.

False (0)	(Default) Do not resize to the bitmap.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhOddPic: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhOddPic: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhOddPic: Picture

Description

The Picture property sets or returns the main picture to display, in combination with the picture assigned to the PictureMask property, in the control. When you design this bitmap, use black to fill the areas where the background should show through.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask


MhOddPic: PictureMask

Description

The PictureMask property sets or returns the mask picture to use. This picture masks the main picture allowing the background to show through in certain areas of the picture. When you design this bitmap, draw the image using black and white only. Use white to specify the areas of the PictureMask that should let the background show through. Fill the areas of PictureMask that should let the Picture image show with black. For information on creating the bitmaps for MhOddPic controls, please refer to the MhSlide control. The same technique applies to MhOddPic bitmaps.

Syntax

ctlname.PictureMask = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhOddPic: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhOddPic: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhOddPic: UseBitBlt

Description

The UseBitBlt property indicates whether the BitBlt or StretchBlt function is used to display bitmaps. The BitBlt function copies a portion of the source bitmap into the control, but doesn't manipulate the bitmap in any way. StretchBlt shrinks or expands the source bitmap so that it fills the control. Consequently, the BitBlt function is the faster of the two. The valid settings for the UseBitBlt property follow:

Setting	Description

True (-1)	Use BitBlt to display the image(s).

False (0)	(Default) Use StretchBlt to display the image(s).

Syntax

ctlname.AutoSize = boolean%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureMask


MhOddPic: Overview

The MhOddPic control is a specialized picture box control that displays pictures that are not rectangular in shape. The following figure shows several an example MhOddPic control and its output. The following table provides an overview of the MhOddPic control.

 Picture Box	   	   MhOddPic	  MhOddPic on Picture Box

MhOddPic Control Example and Its Output.

MhOddPic Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhOddP16.OCX MhOddP32.OCX MHOP200.VBX	MhOddPic	See the MHODDP sample directory.		MhOutBox
Development Notes

The MhOddPic control is based on the standard VB picture box control but lets you display an irregularly shaped bitmap. When placed on top of a form or control, the transparent portion of the image allows the underlying control or form to show through.

You must assign bitmaps to the Picture and PictureMask properties in order to display a picture in an MhOddPic control. The Picture bitmap contains the image you want to display. Normally, you save this bitmap as a rectangular area. To implement the irregular shape aspect of the MhOddPic control, it uses the bitmap you specify in PictureMask to determine which pixels of the Picture to display and which pixels to ignore.

To avoid needlessly repeating information, please refer to the MhSlide control. The process of creating bitmaps for MhOddPic is similar to the process you must use to create custom buttons for MhSlide controls.

If you specify picture files during design mode, Visual Basic includes those files in your .EXE file when you compile your program. However, if you want to specify the bitmaps at run time, be sure to make the files accessible when you run your program. If you don't, you'll receive a File not found error when you try to load the files.

MhOddPic lets you choose between using the Windows API BitBlt or StretchBlt function to display the bitmaps. Using BitBlt is a little faster than using StretchBlt but it lets you display the bitmap only at its original size. The StretchBlt function is slower but it lets you change the size of the bitmap.


Mh3dDrive: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dDrive: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties.

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3dDrive: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dDrive: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dDrive: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The valid settings for the Case property follow:

Setting	Description

0	Default) Mixed Case: No case conversion performed.

1	Lower Case: All text is converted to lower case.

2	Upper Case: All text is converted to upper case.

Syntax

ctlname.Case = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dDrive: DefaultPics

Description

The DefaultPics property indicates whether the default pictures are used for the control. You can use your own pictures by setting an image in the ListPicture and ListPictureSel properties. The valid settings for the DefaultPics property follow:

Setting	Description

True (-1)	(Default) The default pictures are displayed.

False (0)	The default pictures are not displayed.

Syntax

ctlname.DefaultPics = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dDrive: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDrive: DriveCDRom

Description

The DriveCDRom property indicates whether CDRom drives appear in the drive list. The valid settings for the DriveCDRom property follow:

Setting	Description

True (-1)	(Default) CDRom disk drives appear in the drive list.

False (0)	CDRom disk drives do not appear in the drive list.

Syntax

ctlname.DriveCDRom = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DriveFixed, DriveRamDisk, DriveRemote, DriveRemovable


Mh3dDrive: DriveFixed

Description

The DriveFixed property indicates whether fixed disk drives appear in the drive list. The valid settings for the DriveFixed property follow:

Setting	Description

True (-1)	(Default) Fixed disk drives appear in the drive list.

False (0)	Fixed disk drives do not appear in the drive list.

Syntax

ctlname.DriveFixed = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DriveCDRom, DriveRamDisk, DriveRemote, DriveRemovable


Mh3dDrive: DriveRamDisk

Description

The DriveRamDisk property indicates whether Ram disk drives appear in the drive list. The valid settings for the DriveRamDisk property follow:

Setting	Description

True (-1)	(Default) Ram disk drives appear in the drive list.

False (0)	Ram disk drives do not appear in the drive list.

Syntax

ctlname.DriveRamDisk = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DriveCDRom, DriveFixed, DriveRemote, DriveRemovable


Mh3dDrive: DriveRemote

Description

The DriveRemote property indicates whether remote (network) disk drives appear in the drive list. The valid settings for the DriveRemote property follow:

Setting	Description

True (-1)	(Default) Remote disk drives appear in the drive list.

False (0)	Remote disk drives do not appear in the drive list.

Syntax

ctlname.DriveRemote = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DriveCDRom, DriveFixed, DriveRamDisk, DriveRemovable


Mh3dDrive: DriveRemovable

Description

The DriveRemovable property indicates whether removable disk drives appear in the drive list. The valid settings for the DriveRemovable property follow:

Setting	Description

True (-1)	(Default) Removable disk drives appear in the drive list.

False (0)	Removable disk drives do not appear in the drive list.

Syntax

ctlname.DriveRemovable = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DriveCDRom, DriveFixed, DriveRamDisk, DriveRemote


Mh3dDrive: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dDrive: FindInstr

Description

The FindInstr property performs a Instr search of the list items for the specified string. The search is not case-sensitive. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. Unlike FindString, this property performs an Instr search, looking for the string anywhere within the list items. If the string is found, the FoundIndex property is set to the list index value of the item containing the string. If the string is not found, FoundIndex is set to -1. The position of the string within the item is not returned.

Syntax

ctlname.FindInstr = string$

Data Type

String

Availability

Run-Time Write

See Also

FindString, FoundIndex


Mh3dDrive: FindString

Description

The FindString property specifies a string to search for within the list. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. The comparison is made starting with the first character in each list item. To search for the string anywhere within the list items, use FindInstr.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindInstr, FoundIndex


Mh3dDrive: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDrive: FoundIndex

Description

The FoundIndex property is used in conjunction with the FindInstr and FindString properties to both set the starting index for the search and return the ListIndex value of the list item if the string is found. The valid range for the FoundIndex property is -1 to [control].ListCount - 1.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindInstr or FindString property. If the string is found, this property contains the ListIndex value of the matching list item; otherwise, FoundIndex is -1. To continue searching the items for other occurrences of the string, set the string back into the FindString or FindInstr property until the FoundIndex value is less than its starting value.

Example:

'search the entire list

Dim IndexHldr%([control].ListCount)

[control].FoundIndex = -1

Do

    [control].FindString = "string to find"

    If [control].FoundIndex < IndexHldr% Then

        'no new ones were found

        Exit Do

    End If

    cntr% = cntr% + 1

    IndexHldr%(cntr%) = [control].FoundIndex

Loop

Syntax

ctlname.FoundIndex = index&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FindInstr, FindString


Mh3dDrive: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text. The default is the same as the color defined in Control Panel for the Highlighted Text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer; OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dDrive: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list.

Syntax

setting% = ctlname.LastAdded

Data Type

Integer

Availability

Run-Time Read

See Also

LastReplaced


Mh3dDrive: LastReplaced

Description

The LastReplaced property returns the element number of the last item in the list that was changed. The LastReplaced property returns the element number of the last item in the list modified using the List property.

Syntax

setting% = ctlname.LastReplaced

Data Type

Integer

Availability

Run-Time Read

See Also

LastAdded


Mh3dDrive: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dDrive: ListData

Description

The ListData property sets or returns a long integer value associated with each item in the list. The value placed in the ListData property remains associated with the list item even when its ListIndex value is changed. One use for this property is for storing the record number of the associated list item when displaying data from a file. If the data has been changed, you could use this property with the Put statement when writing the data back to the file. For example:

Open FileName$ For Output as #1

Put #1, [control].LastData(index), [control].List(index)

Close #1

Syntax

ctlname.ListData = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture


Mh3dDrive: ListPicture

Description

The ListPicture property specifies the graphics image displayed on the indicated line while this item is not selected. If you read the ListPicture(index) property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused ListPicture(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is not selected. The ListPictureSel(index) image (if any) is displayed while the line is selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPicture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPictureSel


Mh3dDrive: ListPictureSel

Description

The ListPictureSel property specifies the graphics image displayed on the indicated line while this item is selected. If you read the ListPictureSel(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise, an empty or unused ListPictureSel(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is selected. The ListPicture(index) image (if any) is displayed while the line is not selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPictureSel = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPicture


Mh3dDrive: ListTextColor

Description

The ListTextColor property sets or returns the color used for the text in the specified line.

Syntax

ctlname.ListTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dDrive: MaxDrop

Description

The MaxDrop property sets or returns the maximum number of items that are displayed when a combo box drops-down. The default value is eight. The valid range is 1 to 32,767. Regardless of the value you use, the drop-down list can still be displayed either above or below the control, depending on the control's position on the parent form.

Syntax

ctlname.MaxDrop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dDrive: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


Mh3dDrive: PictureWidth

Description

The PictureWidth property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


Mh3dDrive: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. If you are loading a large number of items into the list, setting ScreenUpdate to False before doing the first AddItem and then setting it back to True when complete, decreases the amount of time it takes to load the items and cuts down on the amount of flicker caused by the control being repainted.

If you set the ScreenUpdate property to False, the control is not updated, and no changes shown, until this property is set to True. The Refresh method does not have any effect on a control that has the ScreenUpdate property set to False.

The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The control is automatically refreshed anytime any item in the list changes. This is similar to the AutoRedraw property in picture-related controls.

False (0)	The control is not automatically refreshed.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dDrive: SelectedColor

Description

The SelectedColor property sets or returns the color used to highlight the selected items in the list.

Syntax

ctlname.SelectedColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dDrive: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dDrive: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dDrive: Transparent
Mh3dDir: Transparent

Description

The Transparent property indicates whether the bitmaps within the control are transparent. The valid settings for the Transparent property follow:

Setting	Description

True (-1)	The pixels in the bitmap that are the transparent color are drawn so the control background shows through.

False (0)	No portion of the background shows through the bitmap.

Syntax

ctlname.Transparent = setting%

Data Type

Integer

Availability

Design Time

Run-Time Read

Run-Time Write

See Also

TransparentColor


Mh3dDrive: TransparentColor
Mh3dDir: TransparentColor

Description

The TransparentColor property sets or returns transparent color of a bitmap. When the bitmap is drawn, any pixel set to the transparent color will not be drawn allowing the background to show through.

Syntax

ctlname.TransparentColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design Time

Run-Time Read

Run-Time Write

See Also

Transparent


Mh3dDrive: WallPaper

Description

The WallPaper property specifies the method used to display the images in the control. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dDrive: CloseUp

Description

The CloseUp event occurs when the list portion of the combo box is closed. You can use this event to trigger any processing that may be required after the user has made or canceled the selection.

Syntax

Sub ctlname_CloseUp(Index As Integer)


Mh3dDrive: Overview

The Mh3dDrive control an enhanced version of the standard Visual Basic drive list box control. This control has all the functionality of the standard VB drive control, with a number of added features and additional functionality. Mh3dDrive offers several unique features as follows.

-  An optional 3-D appearance, including special 3-D drive types and the font used for the drive volume labels

-  Control of all the colors used in the control

-  The ability to search the items in the control for a string

-  The ability to force the case of all items in the list box section of the control

-  Display two pictures for each item in the list portion of the control, one when it's selected and another when it's not (available only when you are not using the default 3-D pictures)

-  Supports the AddItem and RemoveItem methods

The following figure shows an example Mh3dDrive control. The following table provides an overview of the Mh3dDrive control.

Mh3dDrive Control Example.

Mh3dDrive Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhDriv16.OCX MhDriv32.OCX MHGDRL.VBX	Mh3dDrive	See the  MHDRIV sample directory.		Mh3dDir Mh3dFile
Development Notes

The BevelSizeInner and BevelStyleInner properties control the type and width of the 3-D effect. When BevelSizeInner is zero, the control  appears two-dimensional regardless of the other settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor.

By default, the control uses our special 3-D pictures for the different drive types. If you want to use your own pictures in the control, set the DefaultPics property to FALSE and load your images into the ListPicture and ListPictureSel picture arrays. These arrays let you display different images for the selected and deselected states for each line in the list portion of the control. If the PictureHeight and PictureWidth properties are zero, any image loaded into these properties is displayed along the entire width of the specified line and painted using the method specified by the WallPaper property.

The standard VB drive list control displays all the mapped drives on your system, but Mh3dDrive allows you to differentiate between and display fixed, remote, and removable drives. You can even search the control for a specific drive letter or volume label using the FindString and FindInstr properties.

The FindString and FindInstr properties allow you to search all the items in the control for a specific string or portion of a string. The result of the search is returned in the FoundIndex property. You can continue your search for other instances of the string by setting FoundIndex to the element number where the search should begin. Because the search operation can wrap around to the first element and continue searching in an endless loop, the best way to determine if you have found the last matching string is to see if the returned value of FoundIndex is less than the starting value.

Mh3dDrive supports both the AddItem and RemoveItem methods. While this allows you a new level of flexibility, anything that causes a Refresh method will cause the contents of the control to be updated and any changes made through these methods will be lost.

The LastAdded property contains the element number of the last item added to the list, while the LastReplaced property contains the element number of the last item that was changed by setting the List property to a string value. The ListData property allows you to associate a long integer value with every item in the control. One of the more common uses for this property is to store a record number or other identifying value associated with each item in the list.

You can force the case of all text displayed in this control to either upper or lower case by changing the Case property.

The ScreenUpdate property, when set to FALSE, prevents the contents of the control from being updated or refreshed until this property is TRUE.

This control uses two standard VB properties that are not available in the standard drive control: List and ListCount. Since these properties act in the same manner as the standard properties, they are not documented as custom properties.

Mh3dDrive recognizes CD-ROM and RAM drives and displays the appropriate bitmap for the line item.


MhTool: Align

Description

The Align property indicates whether the control can appear anywhere on the form or if it is forced to the top or bottom of the form and automatically sized to the form's width. The valid settings for the Align property follow:

Setting	Description

0	(Default) None - the control can be placed anywhere on the parent and resized at both design and run time.

1	Align to Top - the control is automatically moved to the top of the parent and the control's width set equal to the scale width of the parent.

2	Align to Bottom - the control is automatically moved to the bottom of the parent and the control's width set equal to the scale width of the parent.

Syntax

ctlname.Align = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SizingMode


MhTool: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhTool: BorderStyle

Description

The BorderStyle property sets or returns the control's border style.

Setting	Description

0	No border

1	Thin border

2	Thick border - sizable

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTool: Cols

Description

The Cols property sets or returns the number of columns of tools contained in the control. The default value is one. The range is 1 to 50.

Syntax

ctlname.Cols = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Rows


MhTool: ControlBox

Description

The ControlBox property indicates whether a control box is available on the control. The valid settings for the ControlBox property follow:

Setting	Description

True (-1)	The control box is displayed.

False (0)	(Default) The control box is not displayed.

Syntax

ctlname.ControlBox = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxButton, MinButton


MhTool: DblClickEnabled

Description

The DblClickEnabled property indicates whether the double-click event should be fired when the user double-clicks. The valid settings for the DblClickEnabled property follow:

Setting	Description

True (-1)	Fire the double click event.

False (0)	Do not fire the double click event.

Syntax

ctlname.DblClickEnabled = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MDI


MhTool: FillColor

Description

The FillColor property sets or returns the color displayed between the tools and the outer border.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTool: Group

Description

The Group property sets or returns the group number for the tool specified in ToolIndex. Setting a tool's Group property to zero makes the tool function independently of other tools. The default is zero. The range is zero to 32,767.

If you want to read or set the Group property from code or via the properties bar, you must first set the ToolIndex property to the desired element number. Note that you can also use the GroupArr property instead of Group to specify an element number without using the ToolIndex property.

The following example demonstrates how to group specific tools:

' Assuming you have a control with 5 tools

MhTool1.ToolIndex = 0  ' Select tool 0

MhTool1.Group = 0      ' Independent tool

MhTool1.ToolIndex = 1  ' Select tool 1

MhTool1.Group = 1      ' Group with tool 2

MhTool1.ToolIndex = 2  ' Select tool 2

MhTool1.Group = 1      ' Group with tool 1

MhTool1.ToolIndex = 3  ' Select tool 3

MhTool1.Group = 2      ' Group with tool 4

MhTool1.ToolIndex = 4  ' Select tool 4

MhTool1.Group = 2      ' Group with tool 3

When you click on tool #1, tool #2 will be deselected, and vice-versa. When you click on tool #3, tool #4 will be deselected, and vice-versa. Clicking on tool #0 has no effect on the other tools.

Syntax

ctlname.Group = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GroupArr, ToolIndex


MhTool: GroupArr

Description

The GroupArr property sets or returns the group number for the tool associated with the specified element number. The GroupArr property operates the same as the Group property, except that you specify an element number instead of using the ToolIndex property. Setting a tool's GroupArr property to zero makes the tool function independently of other tools. The default is zero. The range is zero to 32,767.

The following example demonstrates how to group specific tools:

' Assuming you have a control with 5 tools

MhTool1.GroupArr(0) = 0 ' Independent tool

MhTool1.GroupArr(1) = 1 ' Tools 1 and 2

MhTool1.GroupArr(2) = 1 '   are in group 1

MhTool1.GroupArr(3) = 2 ' Tools 3 and 4

MhTool1.GroupArr(4) = 2 '   are in group 2

When you click on tool #1, tool #2 will be deselected, and vice-versa. When you click on tool #3, tool #4 will be deselected, and vice-versa. Clicking on tool #0 has no effect on the other tools.

Syntax

ctlname.GroupArr(element%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Group


MhTool: MaxButton

Description

The MaxButton property indicates whether the control has a maximize button. The property is used only when MDI property is True. The valid settings for the MaxButton property follow:

Setting	Description

True (-1)	The control displays a maximize button.

False (0)	(Default) The control does not display a maximize button.

Syntax

ctlname.MaxButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ControlBox, MinButton


MhTool: MDI

Description

The MDI property indicates whether the control displays a caption, has MDI properties, and can be resized by the user at run time. If the MDI property is False, the control does not display a control box, a minimize button, or a maximize button. The valid settings for the MDI property follow:

Setting	Description

True (-1)	The control has MDI characteristics.

False (0)	The control does not have MDI characteristics.

Syntax

ctlname.MDI = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ControlBox, MaxButton, MinButton


MhTool: MinButton

Description

The MinButton property indicates whether the control has a minimize button. This property is only valid when MDI is True. The valid settings for the MinButton property follow:

Setting	Description

True (-1)	The control displays a minimize button.

False (0)	(Default) The control does not display a minimize button.

Syntax

ctlname.MinButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ControlBox, MaxButton


MhTool: PictureDisabled

Description

The PictureDisabled property sets or returns the image to display when the picture tool specified by ToolIndex is disabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDisabled property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run  time, this property returns the picture's handle.

If you want to read or set the PictureDisabled property from code or via the properties bar, you must first set the ToolIndex property to the desired element number. You can also use the PictureDisabledArr property to perform the same task using a picture array.

Syntax

ctlname.PictureDisabled = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDisabledArr, ToolIndex


MhTool: PictureDisabledArr

Description

The PictureDisabledArr property sets or returns the image to display when the tool associated with the specified element number is disabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDisabledArr property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle. You can also use the PictureDisabled property to perform the same task without using a picture array.

Syntax

ctlname.PictureDisabledArr(element%) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDisabled


MhTool: PictureDown

Description

The PictureDown property sets or returns the image to display when the specified picture tool's Value property is one and the picture tool is enabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

If you want to read or set the PictureDown property from code or via the properties bar, you must first set the ToolIndex property to the desired element number. You can also use the PictureDownArr property to perform the same task using a picture array.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDownArr, ToolIndex


MhTool: PictureDownArr

Description

The PictureDownArr property sets or returns the image to display when the Value property for the picture tool associated with the specified element is one and the picture tool is enabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDownArr property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle. You can also use the PictureDown property to perform the same task without using a picture array.

Syntax

ctlname.PictureDownArr(element%) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown


MhTool: PictureUp

Description

The PictureUp property sets or returns the image to display when the Value property for the picture tool specified by ToolIndex is zero and the picture tool is enabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

If you want to read or set the PictureUp property from code or via the properties bar, you must first set the ToolIndex property to the desired element number. You can also use the PictureUpArr property to perform the same task using a picture array.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUpArr, ToolIndex


MhTool: PictureUpArr

Description

The PictureUpArr property sets or returns the image to display when the Value property of the picture tool associated with the specified element number is zero and the picture tool is enabled. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUpArr property equal to the picture property of another control. By default, there are no pictures loaded. Write-only at design time. At run time, this property returns the specified picture's handle. You can also use the PictureUp property to perform the same task without using a picture array.

Syntax

ctlname.PictureUpArr(element%) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUp


MhTool: Rows

Description

The Rows property sets or returns the number of rows of tools contained in the control. To determine the number of tools in the control, multiply the Col property value by the Rows property value. The default value is one. The range is 1 to 50.

Syntax

ctlname.Rows = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Cols


MhTool: SizingMode

Description

The SizingMode property sets or returns the method used to size the toolbox and the tools within the toolbox. The valid settings for the SizingMode property follow:

Setting	Description

0	Fit Rows/Cols in control (autosize). Each tool is sized so that all tools fit within the control's client area, and the control is then shrunk (if necessary) so that the tools completely fill the client area.

1	Use ToolWidth/ToolHeight. This is similar to the AutoSize property used with Visual Basic Picture controls. The control's dimensions are adjusted so that its size corresponds to the actual size necessary to hold all the tools, with each tool respecting the ToolHeight and ToolWidth properties. When SizingMode is set to one, setting the MaxButton property is not valid and an error 32009 is generated if you try to set it from code.

2	Fit Rows/Cols in window (no sizing). This setting is the same as the zero setting except that the control size is not adjusted. Setting a property value of two can result in blank space on the right and bottom edges, with the space filled using the color specified in the FillColor property.

Syntax

ctlname.SizingMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Cols, Rows


MhTool: StateTool

Description

The StateTool property indicates whether the tool specified by ToolIndex functions like a command button or as a state button. The valid settings for the StateTool property follow:

Setting	Description

True (-1)	Functions as a state button, just like the tools in the Visual Basic Toolbox.

False (0)	Functions like a command button.

Syntax

ctlname.StateTool = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateToolArr


MhTool: StateToolArr

Description

The StateToolArr property indicates whether the tool associated with the specified element number functions like a command button or as a state button. The valid settings for the StateToolArr property follow:

Setting	Description

True (-1)	Functions as a state button, just like the tools in the Visual Basic Toolbox.

False (0)	Functions like a command button.

Syntax

ctlname.StateToolArr(element%) = boolean%

Data Type

Boolean Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateTool


MhTool: ToolEnabled

Description

The ToolEnabled property indicates whether the tool specified by ToolIndex can respond to user-generated events, such as keypress and mouse events. The valid settings for the ToolEnabled property follow:

Setting	Description

True (-1)	Tool is enabled.

False (0)	Tool is disabled.

Syntax

ctlname.ToolEnabled = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ToolEnabledArr


MhTool: ToolEnabledArr

Description

The ToolEnabledArr property indicates whether the tool associated with the specified element number can respond to user-generated events, such as keypress and mouse events. The valid settings for the ToolEnabledArr property follow:

Setting	Description

True (-1)	Tool is enabled.

False (0)	Tool is disabled.

Syntax

ctlname.ToolEnabledArr(element%) = boolean%

Data Type

Boolean Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ToolEnabled


MhTool: ToolFocus

Description

The ToolFocus property returns the element number of the tool that has the focus. You can use this value as the element number when setting the array properties. The following example shows how to determine the current row and column number of the tool that has the focus:

Sub MhTool1_Click()  ' Assume zero-based

  WhichColumn = MhTool1.ToolFocus Mod MhTool1.Cols

  WhichRow = MhTool1.ToolFocus \ MhTool1.Cols - 1

End Sub

Syntax

setting% = ctlname.ToolFocus

Data Type

Integer

Availability

Run-Time Read

See Also

ToolIndex


MhTool: ToolHeight

Description

The ToolHeight property sets or returns the height (in pixels) of all tools in the control when the SizingMode property is one. The ToolHeight and ToolWidth properties do not apply when SizingMode is not one. When SizingMode is one, the default value is 32.

Syntax

ctlname.ToolHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SizingMode, ToolWidth


MhTool: ToolIndex

Description

The ToolIndex property specifies the tool affected when setting or reading the Group, PictureDisabled, PictureDown, PictureUp, StateTool, ToolEnabled and Value properties. The default value is zero. The range is zero to 49.

Syntax

ctlname.ToolIndex = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ToolFocus


MhTool: ToolWidth

Description

The ToolWidth property sets or returns the width (in pixels) of all tools in the control when the SizingMode property is one. The ToolHeight and ToolWidth properties do not apply when SizingMode is not one. When SizingMode is one, the default value is 32.

Syntax

ctlname.ToolWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ToolHeight


MhTool: Value

Description

The Value property sets or returns the state of the tool specified by the ToolIndex property. The valid settings for the Value property follow:

Setting	Description

True (-1)	The tool is in the down position.

False (0)	(Default) The tool is in the up position.

When the Value property changes while the tool is enabled, the appearance of the tool changes accordingly. Button tools are drawn just like standard Visual Basic command buttons. When the Value of a picture tool changes, the corresponding picture is displayed.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ValueArr


MhTool: ValueArr

Description

The ValueArr property sets or returns the state of the tool associated with the specified element number. The valid settings for the ValueArr property follow:

Setting	Description

True (-1)	The tool is in the down position.

False (0)	(Default) The tool is in the up position.

When the ValueArr property changes while the tool is enabled, the appearance of the tool changes accordingly. Button tools are drawn just like standard Visual Basic command buttons. When the ValueArr of a picture tool changes, the corresponding picture is displayed.

Syntax

ctlname.Value = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Value


MhTool: Close

Description

The Close occurs when the Close option is selected from the control box menu.

Syntax

Sub ctlname_Close()


MhTool: Overview

The MhTool control provides a toolbox control that functions very much like the Visual Basic Toolbox. The control handles all the details of displaying the correct bitmaps when you press and release a specific tool button. Additionally, you can create state buttons for your toolbox. The following figure shows an example MhTool control. The following table provides an overview of the MhTool control.

MhTool Control Example.

MhTool Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHTO200.VBX	MhTool	See the MHTOOL sample directory.		Mh3dButn MhCommand
Development Notes

The MhTool control is useful when you want to provide a number of options to the user without using a menu or taking up a large amount of screen space.

By default, each tool in the control appears as a button. These are referred to as button tools. MhTool can use pictures (bitmaps or PCX files can be loaded any time and icons can be loaded at run time) to represent tools. These are called picture tools. Where the documentation refers to tools, the text applies to both picture tools and button tools.

Tools can be used just like Visual Basic command buttons where the appearance changes when the mouse button is pressed and again when the mouse button is released. They can also be defined as toggle or state tools such as those in the Visual Basic Toolbox.

The following steps are required to create your own toolbox using the MhTool control:

-  First, place an MhTool control on the form. When you look at the tool, you'll notice it looks like a square command button control with a Control Box on top.

-  Use the Rows and Cols properties to set the number of rows and columns. At this point, the MhTool control looks like a rectangle filled with square command buttons.

-  To begin customizing the appearance of the toolbox, select the toolbox, position the cursor over the toolbox and  double-click the right mouse button. These actions cause the MhTool dialog box to be displayed. You use this dialog box to load pictures and set the properties of the tools at design time.

The dialog box can also be activated by placing one of the picture properties (PictureUp, PictureDown, or PictureDisabled) in the properties bar and clicking the ellipses button to the right of the settings box.

-  The MhTool dialog allows you to easily control many aspects of an individual tool in the Toolbox. This includes all picture properties, as well as the Value, StateTool, and ToolEnabled properties. The ToolIndex property, available in the dialog box, specifies which tool in the Toolbox is being modified. By using the Next and Previous buttons, you can move from tool to tool.

Picture tools have three picture properties: PictureUp, PictureDown, and PictureDisabled. The PictureUp and PictureDown properties determine which picture is displayed when the Value property changes (and the tool is enabled). The PictureDisabled property determines the picture displayed when the Enabled property is False.

You can use the Group property to segregate the tools into groups. This has an effect similar to placing a number of option button controls within a parent control (such as a frame or picture box). When one tool within a group is selected, all other controls within the group are automatically deselected.

Some properties have an array and a non-array version. For example, there are two Group properties: Group and GroupArr. The Group property uses the ToolIndex property to indicate the tool referenced by the Group property. On the other hand, the GroupArr property uses a subscript to indicate the specific tool.

The array subscript you use when setting or getting a property corresponds to a single tool within the control. The arrays are structured so the subscript associated with each button can be calculated using the following formula:

WhichElement = WhichRow * TotalColumns + WhichColumn

where WhichRow is the row (relative to zero, as usual) and WhichColumn is the column where the button in question is located within the control. You then use the WhichElement variable as the subscript in the property array to set or read the property.

The array properties are more convenient to use at run time because you don't have to set the ToolIndex property each time you want to change one of the array properties — you just use the appropriate element of the array.

Once the toolbox is designed, you can start using it in your applications. If you want to know which tool has the focus, read the ToolFocus property. The value returned can be used to manipulate the array properties.


Mh3dFile: BevelSizeInner

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dFile: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control.

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties.

The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3dFile: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderType


Mh3dFile: BorderType

Description

The BorderType property sets or returns the type of border used for the control. The valid settings for the BorderType property follow:

Setting	Description

0	(Default) No border

1	Thin

2	Sizable

3	Thin with Caption

4	Sizable with Caption

Syntax

ctlname.BorderType = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dFile: Case

Description

The Case property sets or returns the case conversion applied to the contents of the control. The valid settings for the Case property follow:

Setting	Description

0	(Default) Mixed Case: No case conversion performed.

1	Lower Case: All text is converted to lower case.

2	Upper Case: All text is converted to upper case.

Syntax

ctlname.Case = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFile: ClearBox

Description

The ClearBox property is used like a method to clear specific information from a control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = integer%

Data Type

Integer

Availability

Run-Time Write


Mh3dFile: DefaultPics

Description

The DefaultPics property indicates whether the default pictures are used for the control. You can use your own pictures by setting an image in the ListPicture and ListPictureSel properties. The valid settings for the DefaultPics property follow:

Setting	Description

True (-1)	(Default) The default pictures are displayed.

False (0)	The default pictures are not displayed.

Syntax

ctlname.DefaultPics = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dFile: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect, with the dividing lines drawn using both the ShadowColor and the LightColor. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Syntax

ctlname.DividerStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFile: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dFile: FindInstr

Description

The FindInstr property performs a Instr search of the list items for the specified string. The search is not case-sensitive. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. Unlike FindString, this property performs an Instr search, looking for the string anywhere within the list items. If the string is found, the FoundIndex property is set to the list index value of the item containing the string. If the string is not found, FoundIndex is set to -1. The position of the string within the item is not returned.

Syntax

ctlname.FindInstr = string$

Data Type

String

Availability

Run-Time Write

See Also

FindString, FoundIndex


Mh3dFile: FindString

Description

The FindString property specifies a string to search for within the list. This property is used in conjunction with FoundIndex to search for the indicated string. The list items in the control are searched starting with the FoundIndex item. The comparison is made starting with the first character in each list item. To search for the string anywhere within the list items, use FindInstr.

Syntax

ctlname.FindString = string$

Data Type

String

Availability

Run-Time Write

See Also

FindInstr, FoundIndex


Mh3dFile: FocusColor

Description

The FocusColor property defines the color used to indicate that the control has the focus.

Syntax

ctlname.FocusColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor, TextColor


Mh3dFile: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFile: FoundIndex

Description

The FoundIndex property is used in conjunction with the FindInstr and FindString properties to both set the starting index for the search and return the ListIndex value of the list item if the string is found. The valid range for the FoundIndex property is -1 to ListCount - 1.

If you want to search all of the items in the list for the first occurrence of a string, set this property to -1 and then place the string in the FindInstr or FindString property. If the string is found, this property contains the ListIndex value of the matching list item; otherwise, FoundIndex is -1. To continue searching the items for other occurrences of the string, set the string back into the FindString or FindInstr property until the FoundIndex value is less than its starting value.

Example:

'search the entire list

Dim IndexHldr%([control].ListCount)

[control].FoundIndex = -1

Do

    [control].FindString = "string to find"

    If [control].FoundIndex < IndexHldr% Then

        'no new ones were found

        Exit Do

    End If

    cntr% = cntr% + 1

    IndexHldr%(cntr%) = [control].FoundIndex

Loop

Syntax

ctlname.FoundIndex = integer%

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FindInstr, FindString


Mh3dFile: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text. This color is used for selected items regardless of the MultiSelect property setting.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MultiSelect


Mh3dFile: LastAdded

Description

The LastAdded property returns the element number of the last item that was added to the list.

Syntax

ctlname.LastAdded = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

LastReplaced


Mh3dFile: LastReplaced

Description

The LastReplaced property returns the element number of the last item in the list that was changed. The LastReplaced property returns the element number of the last item in the list modified using the List property.

Syntax

ctlname.LastReplaced = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

LastAdded


Mh3dFile: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dFile: ListData

Description

The ListData property sets or returns a long integer value associated with each item in the list. The value placed in the ListData property remains associated with the list item even when its ListIndex value is changed. One use for this property is for storing the record number of the associated list item when displaying data from a file. If the data has been changed, you could use this property with the Put statement when writing the data back to the file. For example:

Open FileName$ For Output as #1

Put #1, [control].LastData(index), [control].List(index)

Close #1

Syntax

ctlname.ListData = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture


Mh3dFile: ListPicture

Description

The ListPicture property specifies the graphics image displayed on the indicated line while this item is not selected.  If you read the ListPicture(index) property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused ListPicture(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is not selected. The ListPictureSel(index) image (if any) is displayed while the line is selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPicture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPictureSel


Mh3dFile: ListPictureSel

Description

The ListPictureSel property specifies the graphics image displayed on the indicated line while this item is selected. If you read the ListPictureSel(index) property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise, an empty or unused ListPictureSel(index) property is returned as zero.

The default value is zero (no graphics image loaded). This property is a picture array that can contain a different image for every item in the list.

If an image is loaded into this property, it is displayed while the (index) item is selected. The ListPicture(index) image (if any) is displayed while the line is not selected. Use the PictureHeight and PictureWidth properties to set the width and height of the area where the picture appears. If PictureHeight and PictureWidth are zero, the image uses the height and width of the line for the display area. The image is displayed using the method indicated by the WallPaper property.

Syntax

ctlname.ListPictureSel = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write

See Also

ListPicture


Mh3dFile: ListTextColor

Description

The ListTextColor property sets or returns the color used for the text in the specified line.

Syntax

ctlname.ListTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dFile: MultiSelect

Description

The MultiSelect property sets or returns the method used to select items in the control. The valid settings for the MultiSelect property follows:

Setting	Description

0	(Default) None. Single select only.

1	Simple. Multiple items can be selected, one at a time, by clicking the left mouse button on the item or pressing the space bar while the item has the focus. If an item is already selected, the same action deselects it.

2	Extended. A group of contiguous items can be selected by pressing and holding the left mouse button while dragging the mouse pointer or pressing one of the shift keys in conjunction with clicking the left mouse button. To select or deselect individual items, use Ctrl and left click.

Syntax

ctlname.MultiSelect = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelectedCount


Mh3dFile: PictureHeight

Description

The PictureHeight property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureWidth


Mh3dFile: PictureWidth

Description

The PictureWidth property sets or returns the height (in pixels) of all pictures displayed in the list. The default value is zero. The valid range is 0 to 32,767. If the PictureHeight and PictureWidth properties are zero, any images loaded in the ListPicture and ListPictureSel properties use the height and width of that line.

Syntax

ctlname.PictureWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureHeight


Mh3dFile: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. If you are loading a large number of items into the list, setting ScreenUpdate to False before doing the first AddItem and then setting it back to True when complete, decreases the amount of time it takes to load the items and cuts down on the amount of flicker caused by the control being repainted.

If you set the ScreenUpdate property to False, the control is not updated, and no changes shown, until this property is set to True. The Refresh method does not have any effect on a control that has the ScreenUpdate property set to False.

The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The control is automatically refreshed anytime any item in the list changes. This is similar to the AutoRedraw property in picture-related controls.

False (0)	The control is not automatically refreshed.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dFile: ScrollBars

Description

The ScrollBars property indicates whether the control can display vertical and/or horizontal scrollbars when needed. The standard Visual Basic list and combo box controls have vertical scrollbars added automatically whenever the number of items in the list exceeds the number that can be displayed. This property allows you to control both the presence and type of scroll bars on the control. Like the standard controls, the scrollbars become visible only when required.

The valid settings for the ScrollBars property follow:

Setting	Description

0	(Default) None

1	Vertical Only

2	Horizontal Only

3	Both

Syntax

ctlname.ScrollBars = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFile: SelectedCount

Description

The SelectedCount property returns the number of elements in the Tagged array that are currently selected (set to True). If the control's MultiSelect property is enabled (not zero), this property tells you how many elements in the control have been selected, without examining each element of the Tagged array and accumulating those that are set to True.

Syntax

ctlname.SelectedCount = integer%

Data Type

Integer

Availability

Run-Time Read

See Also

MultiSelect, Tagged


Mh3dFile: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dFile: Tagged

Description

The Tagged property indicates whether the specified element is currently selected. Each element in the Tagged array corresponds to the same ListIndex item in the control.

Setting this value from code at run-time fires the control's Click event. If you have code in the Click event that can cause this same event to be fired, make sure you include a check to prevent recursion or your program may fail with an Out of Stack Space error.

To determine which elements in the control are selected, create a For/Next loop that examines each element of this array.  For example:

For i = 0 to [control].ListCount - 1

If [control].Tagged(i) Then

'This element is selected- save the element number or

'do your processing

End If

Next

The valid settings for the Tagged property follow:

Setting	Description

True (-1)	The element is selected.

False (0)	The element is not currently selected.

Syntax

ctlname.Tagged = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Mh3dFile: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dFile: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window. When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write


Mh3dFile: WallPaper

Description

The WallPaper property specifies the method used to display the images in the control. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


Mh3dFile: WrapList

Description

The WrapList property indicates whether the control displays the contents in multiple columns. Do not confuse this property with creating multiple columns in a list using a delineating character. Setting this property to True causes the items in the list to appear as though they are concatenated when the number exceeds the height of the control. The text in the List items remains unchanged, only the manner in which they are displayed is modified. The valid settings for the WrapList property follow:

Setting	Description

True (-1)	All items in the list are displayed in a manner similar to the files in the Windows File Manager. A horizontal scrollbar is automatically added (if needed), but the control cannot be scrolled vertically.

False (0)	(Default) The control respects the ScrollBars property and every added item is placed on a separate line.

Caution:  Changing this property at run time causes the contents of the control to be lost. Since the control must be re-created to set this style bit, the original control is destroyed and then re-created.

Caution: Using multiple columns in conjunction with the WrapList property set to True in an Mh3dList control will produce drawing problems.

Syntax

ctlname.WrapList = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dFile: PathChange

Description

The PathChange event occurs when the path in the control changes due to the program’s code.

Syntax

Sub ctlname_PathChange()


Mh3dFile: PatternChange

Description

The PatternChange event occurs when the file specification (*.*, *.doc, etc) changes due to the program’s code.

Syntax

Sub ctlname_PatternChange()


Mh3dFile: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position.

Syntax

Sub ctlname_TopIndexChange()


Mh3dFile: Overview

The Mh3dFile control is an enhanced version of the standard Visual Basic file list box control. The Mh3dFile control has all the functionality of the standard Visual Basic file list box control, with a number of added features and additional functionality. Mh3dFile has several unique features including:

-  An optional 3-D appearance, including special 3-D pictures and the font used for the file names

-  Control of all the colors used in the control

-  The ability to search the items in the control for a string

-  The ability to force the case of all items in the list box section of the control

-  Display two different pictures for every item in the list portion of the control, one when it is selected and another when it is not selected.

-  Single or multi-select capability

-  An optional caption

-  Supports the AddItem and RemoveItem methods

The following figure shows an example Mh3dFile control. The following table provides an overview of the Mh3dFile control.

Mh3dFile Control Example.

Mh3dFile Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhFile16.OCX MhFile32.OCX MHGFIL.VBX	Mh3dFile	See the  MHFILE sample directory.		Mh3dDir Mh3dDrive
Development Notes

The bevel cannot be drawn around the border of the list box. To create a 3-D border around the edge of the control, place the Mh3dFile control within an Mh3dFrame control.

The BevelSizeInner and BevelStyleInner properties control the type and width of the 3-D effect. When BevelSizeInner is zero, the control  appears two-dimensional regardless of the other settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor.

The BorderType property allows you create a control that has one of five different borders: None, Thin, Sizable, Thin with Caption and Sizable with Caption. If you choose a border type that has a visible caption, any string placed into the Caption property is displayed at the top of the control. Otherwise, the Caption property is ignored.

By default, the control uses our special 3-D pictures for the different file types. If you want to use your own pictures in the control, set the DefaultPics property to FALSE and load your images into the ListPicture and ListPictureSel picture arrays. These arrays let you display a different image for the selected and deselected states for each line in the list portion of the control. If the PictureHeight and PictureWidth properties are zero, any image loaded into these properties is displayed along the entire width of the specified line and painted using the method specified by the WallPaper property.

If the Sorted property is TRUE, you lose control of the AddItem method of specifying the element number where a new item should be placed.

The FindString and FindInstr properties allow you to search all the items in the control for a specific string or portion of a string. The result of the search is returned in the FoundIndex property. You can continue your search for other instances of the string by setting FoundIndex to the element number where the search should begin. Because the search operation can wrap around to the first element and continue searching in an endless loop, the best way to determine if you have found the last matching string is to see if the returned value of FoundIndex is less than the starting value.

Mh3dFile allows you to select multiple items in the control, using either the simple or extended multi-select methods. If MultiSelect is enabled, the SelectedCount property returns the number of items currently selected. To determine which items have been selected requires you examine the Tagged property, which is a zero-based integer array with the same number of elements as the control. If a file is selected, the corresponding element in the Tagged array is set to True (-1); otherwise, it is zero.

If the FocusColor property is set to a color other than black (&H0), then this color will be used to indicate a control has focus instead of the standard focus rectangle. This property will override any other color when the control has focus.

The HighColor is used to indicate items in the list that have been selected. This property will override the ListTextColor if ListTextColor is the same as TextColor. If ListTextColor has been changed, the item will remain that color even when selected.

Mh3dFile supports both the AddItem and RemoveItem methods. While this provides a new level of flexibility, anything that causes a Refresh method will cause the contents of the control to be updated and any changes made through these methods will be lost.

The LastAdded property contains the element number of the last item added to the list. The LastReplaced property contains the element number of the last item that was changed by setting the List property to a string value.

The ListData property allows you to associate a long integer value with every item in the control. One of the more common uses for this property is to store a record number or other identifying value associated with each item in the list.

You can force the case of all text displayed in this control to either upper or lower case by changing the Case property.

The ClearBox property, which is write-only at run time, acts much like a method in that setting it to any integer value clears the contents of the control.

The ScreenUpdate property, when set to FALSE, prevents the contents of the control from being updated or refreshed until this property is TRUE.

The ScrollBars property allows you to enable and disable the vertical and horizontal scroll bars.

If you want the control to have the appearance of a standard VB file list control, set the BackColor and FillColor properties both to &H80000005&, the ShadowColor to &H8000000D&, and the PictureHeight and PictureWidth to zero.

This control uses three standard VB properties that are not available in the standard drive control: List, ListCount and TopIndex.


Mh3d: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3d Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


Mh3d: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner, BevelStyle


Mh3d: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inner edge of the control. The default value for the BevelSizeInner property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range for the BevelSizeInner property is zero to 32,767.

You can modify the 3-D appearance of the control by setting BevelSizeInner to a value greater than zero. Try different BevelStyleInner settings to find the effect you want. The BevelSizeInner and BevelSize properties are use to manipulate the inner and outer borders of the control respectively. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize, BevelStyleInner


Mh3d: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3d: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. When the BevelSizeInner property is 0, the BevelStyleInner property is ignored and no bevel is drawn. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3d: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor, BorderStyle


Mh3d: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3d: FillColor

Description

The FillColor property sets or returns the color used for the Percent Complete indicator.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3d: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3d: FormatString

Description

The FormatString property sets or returns the method used to format the caption within the control. This property is similar to the Visual Basic Format function. Usage is the same as the VB Format function. For example, if the Caption property is "100.1" and the FormatString is "$###,###.00", the caption is formatted and displayed as "$100.10". By default, this property is null, indicating no formatting is performed. For more information about formatting, please refer to your Visual Basic documentation.

Syntax

ctlname.FormatString = setting%

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3d: InnerBottom

Description

The InnerBottom property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerBottom property is used with the InnerRight, InnerTop, and InnerLeft properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerLeft, InnerRight, InnerTop


Mh3d: InnerLeft

Description

The InnerLeft property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerLeft property is used with the InnerRight, InnerTop, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerRight, InnerTop


Mh3d: InnerRight

Description

The InnerRight property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerRight property is used with the InnerLeft, InnerTop, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode. The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerLeft, InnerTop


Mh3d: InnerTop

Description

The InnerTop property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerTop property is used with the InnerLeft, InnerRight, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerLeft, InnerRight


Mh3d: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3d: Max

Description

The Max property sets or returns the ending value of the inner area when using the Percent Complete indicator. The default value for Max is 0. The valid range is 0 to 32,767.

Syntax

ctlname.Max = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min, Value


Mh3d: Min

Description

The Min property sets or returns the beginning value of the inner area when using the Percent Complete indicator. The default value for Min is 0. The valid range is 0 to 32,767.

Syntax

ctlname.Min = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Value


Mh3d: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3d: NoPrefix

Description

The NoPrefix property specifies whether ampersand characters (&) are displayed in the caption without requiring the use of double ampersands (&&). Note that the character immediately following the ampersand character is used as the access key for the control, regardless of the NoPrefix setting. The valid settings for the NoPrefix property follow:

Setting	Description

True (-1)	Ampersand characters are displayed and do not cause the next character to be underlined.

False (0)	(Default) Ampersand characters are not displayed unless you embed a double ampersand in the string. The next character after the ampersand is underlined.

Syntax

ctlname.NoPrefix = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3d: OuterFillColor

Description

The OuterFillColor property sets or returns the color that is displayed between the caption area and the outer border.

Syntax

ctlname.OuterFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor, TextFillColor


Mh3d: ReverseFill

Description

The ReverseFill property sets or returns the direction in which the control fills the inner area when the Percent Complete indicator is used. Normally, the control fills from the left (or the bottom, if VerticalFill is True). If you set the ReverseFill property to True, the control fills from the right or the top. The valid settings for the ReverseFill property follow:

Setting	Description

True (-1)	Fills from the left or the bottom.

False (0)	(Default) Fills from the right or the top.

Syntax

ctlname.ReverseFill = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VerticalFill


Mh3d: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. This property is identical to the standard VB ScaleMode property except for the limitation on the number of valid settings. This property is provided for the convenience of our customers who have version 1.0 of the control product, in which the control required the use of pixels. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3d: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3d: Style

Description

The Style property specifies whether the control appears depressed or raised. The valid settings for the Style property follow:

Setting	Description

0	(Default) Depressed

1	Raised

2	Use bevel styles

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle, BorderStyle


Mh3d: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3d: TextFillColor

Description

The TextFillColor property sets or returns the background color of the caption.

Syntax

ctlname.TextFillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor, OuterFillColor


Mh3d: VAlignment

Description

The VAlignment property specifies the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	(Default) Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


Mh3d: Value

Description

The Value property sets or returns the portion of the inner area that is filled when using the Percent Complete indicator. The amount of the inner area that is filled is based on the relationship of Value to Min and Max. For example, if Min is zero, Max is 100, and Value is 50, then one-half of the inner area is filled with FillColor. If you specify an amount less than or equal to the value of the Min property, the control won't fill any of the inner area. If you specify an amount greater than or equal to the value of the Max property, the control completely fills the inner area. The default value for the Value property is zero.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Min


Mh3d: VerticalFill

Description

The VerticalFill property indicates the direction of the fill (either vertical or horizontal) when using the Percent Complete indicator. The valid settings for the VerticalFill property follow:

Setting	Description

True (-1)	Fills vertically.

False (0)	(Default) Fills horizontally.

Syntax

ctlname.VerticalFill = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


Mh3d: Overview

The Mh3d control is an enhanced version of the standard Visual Basic label control. You can use Mh3d to create custom labels that have depressed or raised shading and other 3-D effects. Mh3d controls have a Percent Complete feature as well as the ability to display multiline captions. The following figure shows several example Mh3d controls. The following table provides an overview of the Mh3d control.

Mh3d Control Examples.

Mh3d Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhLbl16.OCX MhLbl32.OCX MH3D200.VBX	MhThreeD	See the MHLBL sample directory.		MhMarque
Development Notes

Use the Style property to determine whether the control appears depressed, raised, or as a percent complete indicator.

When using the Mh3d control as a percent complete indicator, you must first set the Min and Max properties to the desired values. Once you have done this, you must assign the Value property to a value ranging between the Min to Max values. Mh3d uses the FillColor value to fill a portion of the caption area. The control caption , defined by the Caption property, is left intact. You can also use the ReverseFill and VerticalFill properties to customize the direction in which the inner area is filled by the control.

The Bevelxxx properties can be used to create 3-D effects. The 3-D effect is created by contrasting the colors specified in the LightColor and ShadowColor properties against the background color specified by the BackColor property of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect. The color specified in ShadowColor must be a darker shade of the parent's background color (the BackColor property) to achieve a true 3-D effect.

The FontStyle property determines the 3-D effect of the text displayed in the control and includes a variety of lowered and raised styles.


Mh3dGauge: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dGauge Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGauge: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dGauge: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dGauge: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inner edge of the control. The default value for the BevelSizeInner property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range for the BevelSizeInner property is zero to 32,767.

You can modify the 3-D appearance of the control by setting BevelSizeInner to a value greater than zero. Try different BevelStyleInner settings to find the effect you want. The BevelSizeInner and BevelSize properties are use to manipulate the inner and outer borders of the control respectively. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


Mh3dGauge: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dGauge: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control.

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties.

The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


Mh3dGauge: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGauge: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dGauge: FillBarColor

Description

The FillBarColor property sets or returns the color used to fill a Mh3dGauge control. This is the color that will be used to indicate the Percentage Complete as the FillValue property changes.

Syntax

ctlname.FillBarColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillValue, GaugeStyle


Mh3dGauge: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGauge: FillValue

Description

The FillValue property sets or returns the fill value used when painting the Percent Complete bar or drawing the needle on a Mh3dGauge control. The default value is zero. The valid range is Min to Max.

By setting the Min, Max, and FillValue properties, the control can be used to present a graphical representation of FillValue as a percentage of the range between Min and Max. This Percent Complete bar is painted using FillColor.

For the Mh3dGauge control, the FillValue property determines the positioning of the needle when GaugeStyle is set to either 2 or 3.

If an image is loaded in the Picture property, the Percent Complete bar overwrites and totally obscures the relative percentage of the image regardless of the color selected in the FillColor property.

Syntax

ctlname.FillValue = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GaugeStyle, Picture


Mh3dGauge: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGauge: GaugeStyle

Description

The GaugeStyle property sets or returns the style of the gauge. The valid settings for the GaugeStyle property follow:

Setting	Description

0	(Default) Horizontal Bar

1	Vertical Bar

2	Semi-Needle

3	Full-Needle

4	Horizontal Bitmap

5	Vertical Bitmap

Syntax

ctlname.GaugeStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillBarColor, FillValue


Mh3dGauge: InnerBottom

Description

The InnerBottom property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerBottom property is used with the InnerRight, InnerTop, and InnerLeft properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerBottom = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerLeft, InnerRight, InnerTop


Mh3dGauge: InnerLeft

Description

The InnerLeft property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerLeft property is used with the InnerRight, InnerTop, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerRight, InnerTop


Mh3dGauge: InnerRight

Description

The InnerRight property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerRight property is used with the InnerLeft, InnerTop, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerRight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerLeft, InnerTop


Mh3dGauge: InnerTop

Description

The InnerTop property sets or returns the position of the inner portion of the control relative to the borders of the control. The inner portion of the control is the area of the control where the caption is displayed.

The InnerTop property is used with the InnerLeft, InnerRight, and InnerBottom properties. The values for these properties must be positive and expressed using values in the control's ScaleMode.  The values for the InnerTop and InnerLeft properties are relative to the top left borders of the control. In other words, the top left corner of the inner area is InnerTop units below the top border and InnerLeft units to the right of the left border. Similarly, the values for the InnerBottom and InnerRight properties are relative to the bottom right edge of the control.

Syntax

ctlname.InnerTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

InnerBottom, InnerLeft, InnerRight


Mh3dGauge: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dGauge: Max

Description

The Max property sets or returns the valid maximum range of the FillValue property. The default value is 100. The range is zero to 32,767. If both Min and Max are set to zero, setting the FillValue property has no effect.

Syntax

ctlname.Max = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillValue, Min


Mh3dGauge: Min

Description

The Min property sets or returns the valid minimum range of the FillValue property. The default value is 0. The range is zero to 32,767. If both Min and Max are set to zero, setting the FillValue property has no effect.

Syntax

ctlname.Min = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillValue, Max


Mh3dGauge: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGauge: NeedleWidth

Description

The NeedleWidth property sets or returns the line width of the indicator needle. This property is measured using the unit of measure specified by the control's ScaleMode setting. NeedleWidth is valid only when the GaugeStyle property is set to 2 (Semi-Needle) or 3 (Full Needle).

Syntax

ctlname.NeedleWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GaugeStyle, ScaleMode


Mh3dGauge: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded. For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor, WallPaper


Mh3dGauge: PictureFill

Description

The PictureFill property specifies the graphics image displayed to represent Percent Complete. The PictureFill property allows you to use bitmaps to display the Percent Complete value instead of a linear or needle indicator. You must set an image into this property for either of the bitmap fill operations (GaugeStyle settings 4 and 5) to work. Please refer to the Description in the Picture property for more information on the loading and saving of images in the picture related properties. The valid settings for the PictureFill property follow:

Setting	Description

(none)	(Default) No picture

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureFill = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GaugeStyle, Picture


Mh3dGauge: ReverseFill

Description

The ReverseFill property sets or returns the direction used to draw the fill color. The valid settings for the ReverseFill property follow:

Setting	Description

True (-1)	Linear horizontal gauges fill from right to left and vertical linear gauges fill from top to bottom.

False (0)	(Default) Linear horizontal gauges fill from left to right and vertical linear gauges fill from bottom to top.

Syntax

ctlname.ReverseFill = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


Mh3dGauge: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. This property is identical to the standard VB ScaleMode property except for the limitation on the number of valid settings. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

NeedleWidth


Mh3dGauge: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dGauge: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGauge: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.  The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


Mh3dGauge: Change

Description

The Change event occurs when the FillValue property changes.

Syntax

Sub ctlname_Change()


Mh3dGauge: Overview

The Mh3dGauge control is a unique control used to display linear, needle or bitmap style gauges. Mh3dGauge controls are useful for Percent Complete indicators, fuel gauges, thermometers or any other type of analog gauge. Mh3dGauge features:

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  The ability to align the caption

-  The ability to use two different pictures to indicate the Percent Complete

This figure shows an example Mh3dGauge control. This table provides an overview of the Mh3dGauge control.

Mh3dGauge Control Example.

Mh3dGauge Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhGaug16.OCX MhGaug32.OCX MHGGAG.VBX	Mh3dGauge	See the MHGAUG sample directory.		Mh3d MhMultiLabel
Development Notes

The Mh3dGauge control supports six different styles, which you set using the GaugeStyle property as follows:

Setting	Description

0	Horizontal Bar: The inner area is filled from left to right.

1	Vertical Bar: The inner area is filled from bottom to top.

2	Semi-Needle: The needle is drawn in a semi-circular arc from left to right.

3	Full- Needle: The needle is drawn in a full 360 degree circle from left to right.

4	Horizontal Bitmap: PictureFill image overlays Picture image from left to right.

5	Vertical Bitmap: PictureFill image overlays Picture image from bottom to top.

If the ReverseFill property is set to TRUE, the direction of the fill  is reversed, but needle movement is not affected.

If you define an image for either the Picture or PictureFill properties, the method used to paint the pictures is controlled by the WallPaper setting. This property allows you to copy, stretch or replicate the selected image onto the control. You can set an image into either one or both of these properties to achieve your desired effect. Any image loaded into the PictureFill property will be painted over the Picture image as the FillValue increases.

The gauge range is set with the Max and Min properties. The positioning of the needle, or the amount of area filled in, is calculated as ((FillValue - Min) / (Max - Min)). The range of the FillValue property is from Min to Max and is used to give a graphical representation.

The NeedleWidth property allows you to vary the width of the needle that is drawn when the GaugeStyle property is set to either 2 (Semi-Needle) or 3 (Full Needle).

Setting the MultiLine property to TRUE causes the caption to be word-wrapped like the standard VB text control. The Alignment property controls the horizontal alignment of the caption within the control in the same manner as a standard VB label.

In design mode you can use the right mouse button to move and resize the inner area of the control. The inner area is that portion of the control where the fill bar, needle and all images are displayed. As the mouse pointer moves over the edges of this area, it changes shapes. When the four-directional arrow is visible, holding down the right button allows you to move the inner area within the control. To resize the inner area, position the mouse pointer near the edge of this area. When the mouse pointer changes to a straight line with two arrows, holding the right button down allows you to resize the inner area. You can also change the size of this area by modifying the Innerxxx properties.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The BevelSizeInner and BevelStyleInner properties are used to display a 3-D border around the inside area of the control. If the BevelStyle and BevelStyleInner properties are the same value, the bevel appears to be the total width of BevelSize and BevelSizeInner. However, by setting BevelStyle and BevelStyleInner to different values, you can achieve some interesting effects.

If the control is bound to a data control, the selected DataField appears as the control's caption.

To use bitmaps, you must supply both Picture and PictureFill properties. You must also set GaugeStyle to 4 (Horizontal Bitmap) or 5 (Vertical Bitmap). If you miss any of these settings, the control’s background is filled with white. No borders or bevels are used with bitmaps. The InnerBottom, InnerLeft, InnerRight, and InnerTop properties are also ignored with bitmaps.


Mh3dGroup: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dGroup Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: AllowAllUp

Description

The AllowAllUp property indicates whether all the buttons in the group can be up at the same time.

Setting	Description

True (-1)	All the buttons can be up at the same time.

False (0)	At least one button has be to depressed at all times.

Syntax

ctlname.AllowAllUp = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picture image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picture image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, WallPaper


Mh3dGroup: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero.

Syntax

ctlname.BevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dGroup: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dGroup: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dGroup: DataStyle

Description

The DataStyle property sets or returns the type of data that is the linked to the specified DataField and defines how the data is evaluated. The valid settings for the DataStyle property follow:

Setting	Description

0	(Default) Boolean

1	String

Note: Property only applies to VBX.

Syntax

ctlname.DataStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: DataText

Description

The DataText property sets or returns the text that is linked to DataField when the DataStyle property is set to 1 (Text). When a Mh3dGroup control is bound to a DataField, the value and type of data in that field effects the state of the control. The type of data in the bound control is specified by the DataStyle property. When DataStyle is set to 1 (Text), this property is used as the link to the DataField, not the Caption. Should you want the caption of the control to reflect the data in the DataField, do a variable assignment as follows:

Mh3dOption1.Caption = Mh3dOption1.DataText

Syntax

ctlname.DataText = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DataStyle


Mh3dGroup: FillColor

Description

The FillColor property sets or returns the color used to fill the control. If an image is being used for the Picture property, the FillColor value is ignored since the background is not painted.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGroup: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGroup: Group

Description

The Group property sets or returns the group number for the control. The default group number is zero. The valid range is zero to 32,767. All controls assigned the same group number have the same functionality as a group of option buttons, in that only one control in the group can be selected or depressed at any one time. The controls do not have to be placed within a container object (i.e., frame or picture) to be assigned to a group -- all that is required is that their Group property be set to the same value and they are placed on the same parent (which can be a form).

Syntax

ctlname.Group = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dGroup: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: NoFocusRect

Description

The NoFocusRect property sets or returns the operation of the focus rectangle. The valid settings for the NoFocusRect property follow:

Setting	Description

True (-1)	The focus rectangle and the heavy border is never drawn, even when the control has focus.

False (0)	(Default) The focus rectangle is drawn normally.

Syntax

ctlname.NoFocusRect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dGroup: Picture

Description

The Picture property specifies the graphics image to be loaded into the control. This property is normally write-only. If you read the Picture property at run time, an integer value is returned. If an image is loaded in this property, the returned value is non-zero; otherwise, an empty or unused Picture property is returned as zero.

At run time, you can use the LoadPicture function to load any external bitmap, icon, or metafile and SavePicture to save the image to a disk file.

If you place a graphics image in an object's Picture property, the background area of the object is drawn using this image instead of the color specified in the FillColor property. If the AutoSize property is set to False, the image is drawn using the method selected in the WallPaper property.

Any images assigned at design time are actually saved as a part of your form and increase your program's file size.  If you are using the same image in more than one control on the same form, you can decrease your program's file size by setting the other control's picture related properties at run time to the one object's property that has the image loaded.  For example:

MyControl.Picture = YourControl.Picture

Setting the picture related properties to another image related property that does not have an image loaded clears the displayed image. If a graphics image is loaded into this property, the object's FillColor property is not used.

The valid settings for the Picture property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDisabled, PictureDown, PicturePressed, PictureUp


Mh3dGroup: PictureDisabled

Description

The PictureDisabled property specifies the graphics image to be displayed when the button is disabled. The PictureDisabled property is used in the same way as the standard VB Picture property. You can use the LoadPicture function or set the PictureDisabled property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run  time, this property returns the picture's handle.

This picture is designed to be used in conjunction with PictureUp, PictureDown, and PicturePressed. It is displayed when the control is disabled regardless of the current value of the control. PictureDisabled is not used if Picture is used. In other words, Picture overrides PictureDisabled, PictureUp, PictureDown and PicturePressed. Please refer to Description in the Picture property for more information on the loading and saving of images in the picture-related properties.

The valid settings for the PictureDisabled property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureDisabled = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PicturePressed


Mh3dGroup: PictureDown

Description

The PictureDown property specifies the image to be displayed when the button is down. The PictureDown property is used in the same way as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded. This property is write-only at design time. At run time, this property returns the picture's handle. The valid settings for the PictureDown property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureUp


Mh3dGroup: PicturePressed

Description

The PicturePressed property specifies the graphics image to display when the button is pressed. The valid settings for the PicturePressed property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PicturePressed = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureDisabled


Mh3dGroup: PictureUp

Description

The PictureUp property specifies the graphics image to be displayed when the control is up. This property is normally write-only. If you read the PictureUp property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise, zero is returned for an empty or unused PictureUp property.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. By default, there is no picture loaded.  This property is write-only at design time. At run time, this property returns the picture's handle.

The valid settings for the PictureUp property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture, PictureDown


Mh3dGroup: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dGroup: StateButton

Description

The StateButton property indicates whether the control acts like a normal VB command button or as a state (or toggle) button.  State buttons toggle between raised and depressed states. The valid settings for the StateButton property follow:

Setting	Description

True (-1)	(Default) Pressing the button causes the control to change between the raised and depressed states, toggling the Value property between zero (raised) and -1 (depressed). The PictureUp image is displayed when the Value property is zero, the PicturePressed image is displayed while the button is being depressed and the PictureDown image while the Value property equals -1.

False (0)	The control acts like a normal VB command button. The PictureUp property is displayed except when the button is being depressed. While pressed, the control shows the image placed in the PictureDown property.

Syntax

ctlname.StateButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Value


Mh3dGroup: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dGroup: Value

Description

The Value property sets or returns the current state of the button (raised or depressed). The valid settings for the Value property follow:

Setting	Description

True (-1)	The button is depressed

False (0)	(Default) The button is raised

Syntax

ctlname.Value = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

StateButton


Mh3dGroup: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picture property if the AutoSize property is False. The selected method is used to display all images loaded into the control's Picture properties.  The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


Mh3dGroup: Overview

The Mh3dGroup control is an enhanced version of the standard Visual Basic command button control that has the combined functionality of the Mh3dCommand custom control and an option button. An Mh3dGroup control has all of the functionality of Mh3dCommand. In addition, this control has the ability to function in tandem with other instances of the same control as a group of option buttons. Mh3dGroup has the following unique features:

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  A multi or single line caption that can be aligned

-  The ability to display pictures for the three different states: Down, Pressed and Up

-  Create a state button -- one that can be toggled between the up and down positions

-  A group property that makes multiple instances of this control work like option buttons

This figure shows an example Mh3dGroup control. This table provides an overview of the Mh3dGroup control.

Mh3dGroup Control Example.

Mh3dGroup Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhGrp16.OCX MhGrp32.OCX MHGGRP.VBX	Mh3dGroup	See the MHGRP sample directory.		Mh3dCommand Mh3dOption
Development Notes

Unlike Mh3dCommand, this control does not support the different BevelStyle settings. Since this control is designed to work as part of a group of command buttons, it has a more traditional appearance, but does allow you to vary the width of the bevel.

All Mh3dGroup controls that are assigned the same group number operate in the same fashion as a group of option buttons  When one button in the group is pressed all other buttons in the same group are returned to the up position. Unlike option buttons however, you do not have to place Mh3dGroup buttons within a container object (such as a frame or picture) to group them together. You can change the groupings at run time. Simply set the Group property of controls to the same value and the StateButton property for all members of the group to TRUE. However, all members of the same group must be on the same parent.

While you can create control arrays and assign all elements in the array to the same group, you can also have several different groups within the same array. You can even have controls in the same group that are part of different arrays.

The BevelSize property controls the width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

Setting the MultiLine property to TRUE causes the caption to be word-wrapped. The Alignment property controls the horizontal alignment of the caption within the control.

Using the PictureDown, PictureUp, and PicturePressed properties, you can display a different background image to graphically represent the various states. The method used to paint these pictures is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. If you are using dark images in any of these properties, you may want to set the TextColor property to a lighter color so the caption remains legible. When setting an image into one of the Picturexxxx properties, you may want to first set the AutoSize property to FALSE to prevent the control from being resized to the dimensions of the picture.

A standard VB command button always returns to an up position when the mouse pointer is moved from the control or the left button is no longer pressed. By setting the StateButton property to TRUE, you can create a toggle button which remains in the down or depressed state when it is clicked. A subsequent click returns the control to the up position. The current state of the control can be both examined and set through the Value property. A value of zero indicates the control is in the up position, while a value of -1 is returned when the button is depressed. Setting the Value property at run time causes the control's Click event to be fired.

If you place code in the Click event which sets the Value property, the code will cause this same event to be fired and you will probably have a problem with recursion that will result in an Out of Stack Space error.  To prevent this error, add a static variable to the procedure that is set to TRUE when code is executed that fires the event and cleared when the procedure is re-entered.

For example:

Sub Mh3dGroup1_Click ()

Static Active%

If Active% Then  	'Our code caused event

Active% = FALSE	'Clear flag and get out

Exit Sub

Else

Active% = TRUE	'Next line causes event

Mh3dGroup1.Value = FALSE

End If

End Sub


Mh3dKeyStat: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The only difference between the Mh3dKeyStat Alignment property and the standard VB Alignment property is the default value. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	(Default) Align to center

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize


Mh3dKeyStat: AutoSize

Description

The AutoSize property indicates whether the control should automatically size the picture area according to the size of the Picturexxx image or respect the WallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the Picturexxx image.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of the WallPaper property.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown, PictureUp, WallPaper


Mh3dKeyStat: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is 2. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


Mh3dKeyStat: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


Mh3dKeyStat: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dKeyStat: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dKeyStat: CaptionOff

Description

The CaptionOff property sets or returns the caption that is displayed when the selected state key is off. The default value is [KeyType] Off, where [KeyType] is the state key selected in the KeyStyle property. You can set this caption to any string, but if you change the KeyStyle property, the caption is changed to the default value.

Syntax

ctlname.CaptionOff = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionOn, KeyStyle


Mh3dKeyStat: CaptionOn

Description

The CaptionOn property sets or returns the caption that is displayed when the selected state key is on. The default value is [KeyType] On, where [KeyType] is the state key selected in the KeyStyle property. You can set this caption to any string, but if you change the KeyStyle property, the caption is changed to the default value.

Syntax

ctlname.CaptionOn = string$

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionOff, KeyStyle


Mh3dKeyStat: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dKeyStat: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dKeyStat: Interval

Description

The Interval property sets or returns the interval (in milliseconds) at which the control polls and updates its status. The default value is 1,000. The range is zero to 2,147,483,647.

Syntax

ctlname.Interval = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

KeyStyle


Mh3dKeyStat: KeyStyle

Description

The KeyStyle property specifies the state key that is monitored by the control. The valid settings for the KeyStyle property follow:

Setting	Description

0	(Default) Caps Lock

1	Num Lock

2	Insert State

3	Scroll Lock

Syntax

ctlname.KeyStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionOn, CaptionOff


Mh3dKeyStat: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dKeyStat: MultiLine

Description

The MultiLine property indicates whether the caption can extend over more than one line. The valid settings for the MultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.MultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionOn, CaptionOff


Mh3dKeyStat: PictureDown

Description

The PictureDown property specifies the graphics image to displayed when the key is down. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureDown property equal to the picture property of another control. By default, there is no picture loaded.  This property is write-only at design time. At run time, this property returns the picture's handle. The valid settings for the PictureDown property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureDown = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUp


Mh3dKeyStat: PictureUp

Description

The PictureUp property specifies the graphics image to be displayed when the control is in an up state. This property is normally write-only. If you read the PictureUp property at run time, an integer value is returned. If an image is loaded in this property, the return value is non-zero; otherwise, an empty or unused PictureUp property is returned as zero.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureUp property equal to the picture property of another control. By default, there is no picture loaded.  This property is write-only at design time. At run time, this property returns the picture's handle. The valid settings for the PictureUp property follow:

Setting	Description

(none)	(Default) No picture is loaded.

(Bitmap)	A graphics image is loaded.

Syntax

ctlname.PictureUp = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureDown


Mh3dKeyStat: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


Mh3dKeyStat: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dKeyStat: Value

Description

The Value property sets or returns the current state of the button (raised or depressed). The valid settings for the Value property follow:

Setting	Description

True (-1)	The button is depressed

False (0)	(Default) The button is raised

Syntax

ctlname.Value = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionOn, CaptionOff


Mh3dKeyStat: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image in the Picturexxx property if the AutoSize property is False.

The selected method is used to display all images loaded into the control's Picturexxx properties.  The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, PictureDown, PictureUp


Mh3dKeyStat: Change

Description

The Change event occurs when the Value property changes.

Examples

Sub ctlname_Change()


Mh3dKeyStat: Overview

The Mh3dKeyStat control is an enhanced command button control that is used to monitor the four PC keyboard state keys. Mh3dKeyStat provides the following features:

-  Different images for the on and off states

-  An optional 3-D appearance, including the font used in the caption

-  Control of all the colors used in the control

-  The ability to align the caption

The following figure shows an example Mh3dKeyStat control. The following table provides an overview of the Mh3dKeyStat control.

Mh3dKeyStat Control Example.

Mh3dKeyStat Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhKySt16.OCX MhKySt32.OCX MHGKEY.VBX	Mh3dKeyStat	See the  MHKYST sample directory.		Mh3dCommand
Development Notes

The Mh3dKeyStat custom control has most of the functionality of Mh3dCommand but also includes the ability to constantly monitor the current status of one of the four state keys on a PC keyboard (Caps Lock, Num Lock, Scroll Lock, and Insert).

The KeyStyle property is used to determine which of the four state keys are monitored by the control. By default, the CaptionOff and CaptionOn properties are set to [KeyType] Off and [KeyType] On. You can change these captions to anything you wish; however,  changing the KeyStyle setting causes the captions to return to the default values.

The CaptionOff property is displayed when the selected key is off and the button is raised. The CaptionOn property is displayed when the selected key is on and the button is depressed.

The Value property reflects the raised/depressed state of the button with -1 (True) indicating the button is depressed and zero (False) meaning that the button is raised.

Using the PictureDown and PictureUp properties, you can display a background that graphically represents the two states. The method used to paint these pictures is controlled by the WallPaper setting, which allows you to copy, stretch or replicate the selected image onto the control. If you are using dark images in any of these properties, you may want to set the TextColor property to a lighter color so the caption will remain legible. When setting any image into one of the Picturexxx properties, you may want to first set the AutoSize property to FALSE to prevent the control from being resized to the dimensions of the picture.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The Interval property has the same functionality as in the standard VB timer control. It determines the interval (in milliseconds) at which  the Mh3dKeyStat control will check the state of the selected key. While reducing the interval value from its default value of 1000 will improve the response of the control, it may also effect the overall performance of all Windows applications, especially if your application is using several timer-based controls.

Setting the MultiLine property to TRUE causes the caption to be word-wrapped like the standard VB text control. The Alignment property controls the horizontal alignment of the caption within the control.


Mh3dMenu: Align

Description

The Align property indicates whether the control can appear anywhere on the form or if it is forced to the top or bottom of the form and automatically sized to the form's width. The valid settings for the Align property follow:

Setting	Description

0	(Default) None - the control can be placed anywhere on the parent and resized at both design and run time.

1	Align to Top - the control is automatically moved to the top of the parent and the control's width set equal to the scale width of the parent.

2	Align to Bottom - the control is automatically moved to the bottom of the parent and the control's width set equal to the scale width of the parent.

Syntax

ctlname.Align = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ItemAlignment


Mh3dMenu: BevelSizeItem

Description

The BevelSizeItem property sets or returns the size (in pixels) of the bevel that is drawn around the selected menu item. The default value is zero, which means that no border is drawn around the edge of the selected item. The valid range is 0 to 32,767.

Syntax

ctlname.BevelSizeItem = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleItem


Mh3dMenu: BevelSizeMenu

Description

The BevelSizeMenu property sets or returns the size (in pixels) of the bevel that is drawn around the dropdown portion of the menu. The default value is zero, which means that no border is drawn around the edge of the selected item. The valid range is 0 to 32,767. This property also effects the bevel size of the outer edge drawn around pop-up and tear-off menus.

Syntax

ctlname.BevelSizeMenu = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleMenu


Mh3dMenu: BevelSizeTop

Description

The BevelSizeTop property sets or returns the size (in pixels) of the bevel that is drawn around the top-level menu items. The default value is zero, which means that no border is drawn around the edge of the selected item. The valid range is 0 to 32,767.

Syntax

ctlname.BevelSizeTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleTop


Mh3dMenu: BevelStyleItem

Description

The BevelStyleItem property sets or returns the type of bevel used for the border around the selected item in the menu. If the BevelSizeItem property is zero, BevelStyleItem is ignored and no bevel is drawn around the control. The valid settings for the BevelStyleItem property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the edge of the control using the colors specified in the LightColor and ShadowColor properties.

Syntax

ctlname.BevelStyleItem = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeItem


Mh3dMenu: BevelStyleMenu

Description

The BevelStyleMenu property sets or returns the type of bevel used for the border around the dropdown portion of the menu. If the BevelSizeMenu property is zero, BevelStyleMenu is ignored and no bevel is drawn around the control. The valid settings for the BevelStyleMenu property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. This property also affects the type of bevel drawn around the outer edge of pop-up menus.

Syntax

ctlname.BevelStyleMenu = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeMenu


Mh3dMenu: BevelStyleTop

Description

The BevelStyleTop property sets or returns the type of bevel used for the border around the top-level menu items. If the BevelSizeTop property is zero, BevelStyleTop is ignored and no bevel is drawn

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties.

Syntax

ctlname.BevelStyleTop = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeTop


Mh3dMenu: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


Mh3dMenu: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dMenu: CheckHeight

Description

The CheckHeight property sets or returns the height (in pixels) of the area on the left side of each menu selection. The PictureChecked and PictureUnchecked images are displayed in this area. The default value is -1 (use the default VB height and width for a check-mark). The valid range is -1 to 32.

Normally you would leave these properties at their default settings of -1. Be careful of the values you use, as any images that are loaded may prevent your menu captions from being legible.

Syntax

ctlname.CheckHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CheckWidth


Mh3dMenu: CheckWidth

Description

The CheckWidth property sets or returns the width (in pixels) of the area on the left side of each menu selection. The PictureChecked and PictureUnchecked images are displayed in this area. The default value is -1 (use the default VB height and width for a check-mark). The valid range is -1 to 32.

Normally you would leave these properties at their default settings of -1. Be careful of the values you use, as any images that are loaded may prevent your menu captions from being legible.

Syntax

ctlname.CheckWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CheckHeight


Mh3dMenu: DisabledColor

Description

The DisabledColor property sets or returns the color of the menu text when the Enabled property is False.

Syntax

ctlname.DisabledColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write


Mh3dMenu: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items in the menu. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect with the dividing lines drawn using ShadowColor and LightColor.

Syntax

ctlname.DividerStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SeparatorStyle


Mh3dMenu: Events

Description

The Events property indicates which actions fire the menu item's Click event. The valid settings for the Events property follow:

Setting	Description

0	(Default) Click Only

1	Click and Select

2	Click, Select and Key

When set to zero (default) only the actual click event is fired. When set to one or two, selecting a menu item (moving the highlight bar to the item) also fires the click event. When set to two, pressing a function key while a menu item is highlighted also fires the click event.

To interpret the Click event when this property is set to one or two, check the value of WhichEvent.

Syntax

ctlname.Events = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WhichEvent


Mh3dMenu: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


Mh3dMenu: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid setting for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in LightColor and ShadowColor. When FontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to three or four (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dMenu: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


Mh3dMenu: Item

Description

The Item property returns the menu item (element) that is affected by setting the Itemxxx properties. To change the properties of the different menu items, see the SelCaption property.

Syntax

integer% = ctlname.Item

Data Type

Integer

Availability

Run-Time Read

See Also

SelCaption


Mh3dMenu: ItemAlignment

Description

The ItemAlignment property sets or returns the alignment of the item’s text in relation to the picture (if used). SelCaption defines the item affected by this property. The valid settings for the ItemAlignment property follow:

Setting	Description

0	(Default) Left

1	Right

2	Over (on top of the picture)

3	Above

4	Below

Syntax

ctlname.ItemAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemAutoSize

Description

The ItemAutoSize property indicates whether the item specified by SelCaption should automatically size the picture area according to the size of the ItemPicture image or respect the ItemWallPaper property.

Setting	Description

True (-1)	(Default) Automatically resize the picture areas based on the size of the images.

False (0)	Stretch or shrink the picture area(s) of the control based on the value of WallPaper.

Syntax

ctlname.ItemAutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemMultiLine

Description

The ItemMultiLine property indicates whether the text for the menu item specified by SelCaption can extend over more than one line. The valid settings for the ItemMultiLine property follow:

Setting	Description

True (-1)	The caption can appear on multiple lines.

False (0)	(Default) The caption appears on a single line.

Syntax

ctlname.ItemMultiLine = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemPicture

Description

The ItemPicture property specifies the graphics image to be loaded into the item specified by SelCaption. This property is normally write-only. If you read the ItemPicture property at run time, an integer value is returned. If an image is loaded in this property the returned value is non-zero; otherwise an empty or unused ItemPicture property is returned as zero.

Syntax

ctlname.ItemPicture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemPictureChecked

Description

The ItemPictureChecked property specifies the graphics image to be displayed when the menu items specified by SelCaption is checked.

Syntax

ctlname.ItemPictureChecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ItemPictureUnchecked


Mh3dMenu: ItemPictureUnchecked

Description

The ItemPictureUnchecked property specifies the graphics image to be displayed when the menu items specified by SelCaption is not checked.

Syntax

ctlname.ItemPictureUnchecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ItemPictureChecked


Mh3dMenu: ItemTextColor

Description

The ItemTextColor property specifies the color used for the text in the menu item specified by SelCaption.

Syntax

ctlname.ItemTextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemWallPaper

Description

The ItemWallPaper property sets or returns the method to use when displaying the image in the ItemPicture property if the ItemAutoSize property is False. This property affects the menu item specified by SelCaption. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt.  The size of the image is changed to match the size of the control.

1	BitBlt.  The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control.

Syntax

ctlname.ItemWallPaper = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: ItemWidth

Description

The ItemWidth property specifies the width (in twips) of the menu item specified by SelCaption. By default, the width of a drop-down or pop-up menu is set to display the longest caption in the menu list. Since Mh3dMenu allows you to set the ItemAlignment and ItemMultiLine properties for all menu selections, this property is used primarily when you want a selection that has ItemMultiLine set to True or the ItemAlignment property set to anything other than left alignment. Setting the ItemWidth property for any of the selections in a drop-down or pop-up menu affects the width of all items in that menu list.

Syntax

ctlname.ItemWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelCaption


Mh3dMenu: LastKey

Description

The LastKey property returns the virtual key-code of the last key that was pressed. This property is used when the Events property is set to two and the menu item's Click event was fired by a keypress (indicated by WhichEvent being set to two). The LastKey property contains the virtual key-code of the key that caused the event to be fired.

Syntax

integer% = ctlname.LastKey

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Events, WhichEvent


Mh3dMenu: LightColor

Description

The LightColor property sets or returns the light color, as opposed to the shadow color of the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


Mh3dMenu: Menu3d

Description

The Menu3d property indicates whether the form's menus use 3-D effects.

Setting	Description

True (-1)	(Default) The form's menus are drawn using the selected 3-D effects.

False (0)	The form's menus appear normal and all 3-D related properties are ignored. Setting this property to False does not effect the other features of the Mh3dMenu control. You can still create pop-up and tear-off menus and modify the form's system menu.

Caution: The Menu3d property is not dependable when set to True and the menu is used with an MDI application.

Syntax

ctlname.Menu3d = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dMenu: MenuRefresh

Description

The MenuRefresh property causes all the menus on the form to be refreshed. This property acts like a method, in that setting it to any value causes all the menus on the form to be refreshed. This includes pop-up and tear-off menus. When setting and modifying some of the custom menu properties at run time, VB may not be aware that the menu has changed. This property forces all of the menus on the form to be refreshed.

Syntax

ctlname.MenuRefresh = integer%

Data Type

Integer

Availability

Run-Time Write

See Also

Menu3d


Mh3dMenu: PictureChecked

Description

The PictureChecked property specifies the image to be displayed when the control is checked.

Syntax

ctlname.PictureChecked = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureUnchecked


Mh3dMenu: PictureUnchecked

Description

The PictureUnchecked property specifies the image to be displayed when the control is not checked.

Syntax

ctlname.PictureUnchecked = picture

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureChecked


Mh3dMenu: PopupAlignment

Description

The PopupAlignment property sets or returns the horizontal alignment of the popup menu in relation to the PopupTop and PopupLeft properties. The valid settings for the PopupAlignment property follow:

Setting	Description

0	Left

1	Right

2	(Default) Center

Syntax

ctlname.PopupAlignment = integer

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PopupLeft, PopupTop


Mh3dMenu: PopupCreate

Description

The PopupCreate property causes the selected sub-menu to be used as a pop-up menu. This property works like a method. Setting PopupCreate to any integer value causes the selected sub-menu items to be placed in a pop-up menu.

Since Mh3dMenu allows you to use the standard VB menu design interface, it needs you to tell it which of the created menu items you want to use for the pop-up. A pop-up menu can only be created from a sub-menu, never a top-level menu.

After creating your menu structure using the standard VB menu design, indicate which sub-menu is to be used for the pop-up by placing the menu's caption into the SelCaption property. You can do this be setting SelCaption equal to the Caption property

Mh3dMenu1.SelCaption = MyMenu(3).Caption

or by setting it equal to a variable length string that is the same as the sub-menu item's Caption property.

Mh3dMenu1.SelCaption - "My Menu Caption"

After selecting the sub-menu to be used, set the PopupCreate property to any value. Next, position the pop-up menu, using the PopupLeft and PopupTop properties. Finally make it visible by setting PopupVisible to True.

As soon as the pop-up menu is created, the corresponding sub-menu from which it was created is automatically hidden. If you want this sub-menu to remain visible you must first set its Visible property to False and then back to True. Since VB thinks the sub-menu is already visible, simply setting it to True without first setting it to False, has no effect. When you set the menu's Visible property to False, all of the Click events for both the sub-menu and the pop-up menu are disabled. This is why you must use these two lines of code in sequence:

MyPopupMenu.Visible = False

MyPopupMenu.Visible = True

Syntax

ctlname.PopupCreate = integer%

Data Type

Integer

Availability

Run-Time Write

See Also

PopupVisible


Mh3dMenu: PopupLeft

Description

The PopupLeft property sets or returns the horizontal screen coordinate for the pop-up menu. After a pop-up menu has been created by setting the PopupCreate property, use the PopupLeft and PopupTop properties to position the menu relative to the parent form.

Syntax

ctlname.PopupLeft = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

PopupTop


Mh3dMenu: PopupTop

Description

The PopupTop property sets or returns the vertical screen coordinate for the pop-up menu. After a pop-up menu has been created by setting the PopupCreate property, use the PopupLeft and PopupTop properties to position the menu relative to the parent form.

Syntax

ctlname.PopupTop = integer%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

PopupLeft


Mh3dMenu: PopupVisible

Description

The PopupVisible property sets or returns the visible state of the pop-up menu. You must create the menu (using the steps outlined in PopupCreate prior to setting this property to True. Once you make a selection from a pop-up menu, it is automatically hidden, but not destroyed.  You can re-display the pop-up menu by setting the PopupVisible property to True. There is no default value. The valid settings for the PopupVisible property follow:

Setting	Description

True (-1)	Make the pop-up menu visible

False (0)	Make the pop-up invisible (hidden)

Syntax

ctlname.PopupVisible = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

PopupCreate


Mh3dMenu: SelCaption

Description

The SelCaption property selects the menu item to be modified by the Itemxxx properties or used in the creation of a pop-up menu. Before you can modify a menu item using any of the Itemxxx properties or create a pop-up menu you must select the menu item to be changed. Setting the selected menu item's Caption property into this property identifies that item to Mh3dMenu. Once you select a menu item using this property, it continues to be the one that is modified until another item is selected.

Syntax

ctlname.SelCaption = string$

Data Type

String

Availability

Run-Time Write


Mh3dMenu: SeparatorStyle

Description

The SeparatorStyle property sets or returns the style used for all menu separators. The valid settings for the SeparatorStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Unlike the DividerStyle property, which affects all of the lines between the menu items, this property affects only defined menu separators.

Syntax

ctlname.SeparatorStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DividerStyle


Mh3dMenu: ShadowColor

Description

The ShadowColor property defines the color used for shadows in the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor


Mh3dMenu: SystemCreate

Description

The SystemCreate property replaces the form's default system menu with the custom menu previously selected with the SelCaption property.  SystemCreate and PopupCreate work in the same manner. The only difference is that SystemCreate replaces the form's default system menu instead of creating a pop-up or tear-off menu.

This property works like a method. Setting SystemCreate to any integer value causes the selected sub-menu items to be placed in a pop-up menu.

Since Mh3dMenu allows you to use the standard VB menu design interface, you must tell it which of the created menu items you want to use to replace the default system menu. The replacement system menu can be created only from a sub-menu, never a top-level menu.

A custom system menu completely replaces the current system menu and does not contain any of the standard system menu options unless you provide for them as described below. These special menu selections are handled by the system in the same manner as the original options (the Click events in your code for these standard system options are not fired).

You indicate which of the standard system menu options to include by placing one of the following strings enclosed within square braces "[]" in the caption. This bracketed string must be the first item in the caption, and should be followed by whatever caption you want to appear in the menu for that item. When we create the new system menu the bracketed string is removed from the caption. The following are the valid options:

[SC_CLOSE]

[SC_SIZE]

[SC_MOVE]

[SC_MINIMIZE]

[SC_MAXIMIZE]

[SC_RESTORE]

[SC_TASKLIST]

For example, to place a Close option in your custom system menu you would set the caption to [SC_CLOSE]&Close. You can place the standard system menu options in any order.

Warning:  In order for a system menu to show up when the form is minimized, it must have a minimum of three specific standard system menu items: RESTORE, MOVE, and MINIMIZE.

After creating your menu structure using the standard VB menu design, you indicate which sub-menu is to be used for the new system menu by placing the sub-menu's caption into the SelCaption property. You can do this be setting SelCaption equal to the Caption property:

Mh3dMenu1.SelCaption = MyMenu(3).Caption

or by setting it equal to a variable length string that is same as the sub-menu items Caption property.

Mh3dMenu1.SelCaption - "My Menu Caption"

After selecting the sub-menu to be used, set the SystemCreate property equal to any value. This replaces the form's default system menu with the sub-menu you selected.

Mh3dMenu1.SystemCreate = 0

As soon as the new system menu is created, the corresponding sub-menu from which it was created is automatically hidden. If you want this sub-menu to remain visible, you must first set its Visible property to False, and then back to True. Since VB thinks the sub-menu is already visible, if you do not first set it to False, simply setting it to True has no effect. When you set the menu's Visible property to False, all of the Click events for both the sub-menu and the pop-up menu are disabled. That is why you must use these two lines of code in sequence.  For example:

MyNewSysMenu.Visible = False

MyNewSysMenu.Visible = True

Syntax

ctlname.SystemCreate = value%

Data Type

Integer

Availability

Run-Time Write

See Also

PopupCreate


Mh3dMenu: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


Mh3dMenu: WhichEvent

Description

The WhichEvent property returns the event number that fired the menu's Click event. The valid range is zero to Events. When you enable the custom events for the menus on the form, all three of the events cause the Click event to be fired. This property tells you which of the events caused the Click event to be fired. For example:

MyMenu_Click(Index As Integer)

Select Case MyMenu.WhichEvent

Case 0	'click event

'do something here

Case 1	'select

'do something here

Case 2	'keypress

'do something here

End Select

Syntax

eventnr% = ctlname.WhichEvent

Data Type

Integer

Availability

Run-Time Read

See Also

Events


Mh3dMenu: Closed

Description

The Closed event occurs when all of the menu items have been closed. Normally, you would not need to know when all the menu items have been closed. However, if you are tracking the currently selected menu item and displaying some type of menu-related information for the user, it may be helpful to know when no menu items are currently selected.

Syntax

Sub ctlname_Closed(Index As Integer)


Mh3dMenu: Overview

The Mh3dMenu control is used to give a 3-D appearance to any menu, create pop-up and tear-off menus, and replace the system menu. In addition to the optional 3-D effects, Mh3dMenu offers the following features:

-  Modify any form's system menu and still access the standard events.

-  Create pop-up and tear-off menus

-  Use custom pictures to indicate the check and unchecked states

-  Optional 3-D fonts used in the menu items

-  Control of all the colors used in the control

Note:  This control cannot be used with Microsoft Visual/C++. Visual Basic creates and handles menus very differently from C.

The following figure shows an example Mh3dMenu control. The following table provides an overview of the Mh3dMenu control.

Mh3dMenu Control Example.

Mh3dMenu Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHGMNU.VBX	Mh3dMenu	See the MH3DMEN sample directory.		Mh3dCheck
Development Notes

Mh3dMenu lets you use the standard VB menu design interface to create all of your menus. These menus respond to the click events. All customized system menus, as well as the pop-up or tear-off menus, are actually sub-menus that you create in your normal menu structure. You cannot use top level menus for this purpose. (Top level menus are those that actually appear on the menu bar at the top of your form.)

The method used to create pop-up menus and replace your system menu is the same. First create the menu structure using the VB menu design system. When you want to create the custom menu you must first identify the sub-menu item to Mh3dMenu by setting its caption into the SelCaption property.

Mh3dMenu1.SelCaption = MyMenu(3).Caption

Next, create the menu by setting any value into the PopupCreate or SystemCreate property.

Mh3dMenu1.PopupCreate = 0

If you are creating a pop-up menu, position the menu relative to the parent form using the PopupLeft and PopupTop properties, then set the PopupVisible property to TRUE. The Click events associated with the sub-menu items are fired just as if they were attached to the menu bar.

By default, we automatically hide the original sub-menu when the pop-up is created. In order to make the original sub-menu visible, you must first set its Visible property to FALSE and then back to TRUE. If you check the Visible property of the sub-menu after the pop-up is created, you will see that it is still TRUE (-1) even though the original sub-menu is now hidden. This happens because the control hides the menu without setting the Visible property to FALSE. Setting the Visible property to FALSE disables the Click event and would in turn disable the newly created pop-up menu. Since VB thinks the menu is already visible, simply setting the property to TRUE after creating the pop-up would have no effect. Toggling the property to FALSE and back to TRUE causes the menu to be refreshed and the original sub-menu to be redisplayed. Examples of how to create pop-up, tear-off and custom system menus are detailed with the different properties.

Note:  When designing a system menu you should be aware that it will completely replace the current system menu. This means there are no standard system menu options unless you provide them. We have provided a way to put some standard system menu options in your system menus. Please refer to the SystemCreate property for details.

To modify the different menu items using the Itemxxx properties, you must first select or identify the menu item by setting its caption into the SelCaption property.

The PictureChecked and PictureUnchecked properties allow you to provide your own images to indicate the status of a menu item's Checked property. The size of an image loaded into these properties is controlled by the CheckHeight and CheckWidth properties. The default is -1 indicating that the control should use the menu default check size.

The Events property allows you to determine which events fire the menu's Click events. This allows you to display unique information for each menu selection and respond to keypresses when an item is highlighted.

There are three BevelSize and BevelStyle properties that control the type and width of the 3-D effect. The BevelxxxItem properties affect the currently selected menu item. The BevelxxxMenu properties effect the actual drop-down portion of the sub-menus and the border around the pop-up menus. The BevelxxxTop properties affect only the top level menus (those that are placed at the top of the form).

When BevelSize is zero, the corresponding BevelStyle property is ignored. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color and obtain a similar 3-D effect as long as the ShadowColor is a darker shade of the parent's BackColor. If you wish to turn off all 3-D effects for all of the menus on the form, set the Menu3d property to FALSE.

While a single instance of the Mh3dMenu control must be placed on each form that will use the features of the control, the control itself is not visible at run time.

The SeparatorStyle property is similar to and has the same settings as DividerStyle, but will only modify the appearance of menu separators.  The DividerStyle property places dividers between all menu selections regardless of the existence of separators.

You may find that the highlight and function key events do not work for the last top level menu item. To resolve this problem, create a dummy top level menu as the last selection and set the Visible property to False in the menu design window. This problem only occurs with the last top-level menu item.

Using Mh3dMenu with MDIForms (VB2 and later):

Mh3dMenu only works with MDIForms if the Menu3d property is set to False. This allows you to use the event features of the menu control, but not the 3-D features.

If you try to use the 3-D features with MDI applications anyway and experience problems one of the following items might resolve your problems.

Where to place Mh3dMenu controls:

There should be a menu control on the MDI form, as well as all MDI child forms. This will let the controls work together to keep the changing menus in sync. It will also give a more consistent look to your application.

Starting an application with a child form maximized:

You cannot set the WindowState property in design mode to maximized when the form is an MDI child and you are using 3-D menus. Instead, place the following lines in the Paint event for the MDI child in question.

Static beenhere%

If Not beenhere% Then

    beenhere% = True

    FormName.Windowstate = 2

End If

Adding or removing from the menu:

If you add or remove items from the menu in an MDI application use the MenuRefresh property to update the menu control. This will help you avoid problems when maximizing or switching forms.


MhIntInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhIntInput: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	(Default) The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIntInput: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero. Try different BevelStyle settings to find the effect you want.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhIntInput: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhIntInput: BorderColor

Description

The BorderColor property sets or returns the color of the outer border. The default value for the BorderColor property is the same as the color defined in Control Panel for the Window Frame.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhIntInput: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	(Default) Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhIntInput: CaretColor

Description

The CaretColor property sets or returns the color of the caret.

Syntax

ctlname.CaretColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhIntInput: CaretHeight

Description

The CaretHeight property sets or returns the height of the caret. The default setting is zero, in which case the caret is sized according to the current font.

Syntax

ctlname.CaretHeight = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretWidth


MhIntInput: CaretInterval

Description

The CaretInterval property sets or returns the timer interval (in milliseconds) for the flashing caret. The default setting is zero, in which case the caret uses the system's default blink time.

Syntax

ctlname.CaretInterval = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhIntInput: CaretStyle

Description

The CaretStyle property sets or returns the shape of the caret. The valid settings for the CaretStyle property follow:

Setting	Description

0	(Default) Block.

1	Up arrow.

2	Down arrow.

Syntax

ctlname.CaretStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretColor, CaretInterval


MhIntInput: CaretVAlign

Description

The CaretVAlign property specifies where the caret is displayed within the control. The valid settings for the CaretVAlign property follow:

Setting	Description

0	(Default) The caret is positioned over the text.

1	The caret is positioned below the text.

2	The caret is positioned above the text.

Syntax

ctlname.CaretVAlign = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVisible


MhIntInput: CaretVisible

Description

The CaretVisible property indicates whether the caret is visible. The valid settings for the CaretVisible property follow:

Setting	Description

True (-1)	(Default) The caret is visible within the control.

False (0)	The caret is not visible within the control.

Syntax

ctlname.CaretVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVAlign


MhIntInput: CaretWidth

Description

The CaretWidth property sets or returns the width of the caret. The default setting is zero, in which case the caret is sized according to the system's border width.

Syntax

ctlname.CaretWidth = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretHeight


MhIntInput: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhIntInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Setting	Description

True (-1)	All text in the control is automatically selected when the control receives the focus.

False (0)	The text in the control is not automatically selected.

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhIntInput: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text, needle, and markings that are printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhIntInput: Indent

Description

The Indent property sets or returns the amount of space (in pixels) between characters in the control and the control's border. The default is zero. The range is zero-32767. This property is useful when you specify a thin border and the control is in insert mode.

Syntax

ctlname.Indent = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIntInput: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhIntInput: Max

Description

The Max property sets or returns the highest value that can be entered in the control. The default value is 214748647. The range is the range of long integers.

Syntax

ctlname.Max = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min


MhIntInput: Min

Description

The Min property sets or returns the lowest value that may be entered in the control. The default value is -2147483647. The range is the range of long integers.

Syntax

ctlname.Min = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max


MhIntInput: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	The control does not allow its contents to be edited.

False (0)	(Default) The control allows its contents to be edited.

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIntInput: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhIntInput: Spin

Description

The Spin property defines where the spin buttons (if any) are positioned within the control. The valid settings for the Spin property follow:

Setting	Description

0	(Default) The control does not display spin buttons.

1	The spin buttons are aligned to the left.

2	The spin buttons are aligned to the right.

Syntax

ctlname.Spin = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SpinChange, SpinDelay, SpinSpeed


MhIntInput: SpinChange

Description

The SpinChange property specifies the amount to increment/decrement the value of the control when the spin buttons are used. The default value is one.

Syntax

ctlname.SpinChange = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinDelay, SpinSpeed


MhIntInput: SpinDelay

Description

The SpinDelay property sets or returns the amount of time (in milliseconds) that occurs before the first repeat when using the spin buttons. The default value is 500 milliseconds. The delay that occurs between successive repeats is determined by the SpinSpeed property.

Syntax

ctlname.SpinDelay = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChange, SpinSpeed


MhIntInput: SpinSpeed

Description

The SpinSpeed property sets or returns the amount of time (in milliseconds) that occurs between each repeat when using the spin buttons. The default value is 100 milliseconds. The initial delay before the first repeat is determined by the SpinDelay property.

Syntax

ctlname.SpinSpeed = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChange, SpinDelay


MhIntInput: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhIntInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = integer%

Data Type

Integer

Availability

Run-Time Write


MhIntInput: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	(Default) Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhIntInput: Value

Description

The Value property sets or returns the current contents of the control. The default value is zero. The range is the range of long integers.

Syntax

ctlname.Value = long&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIntInput: InvalidEntry

Description

The InvalidEntry event occurs when the value within the control is outside the range of the values in the Max or Min properties, and the control loses the focus.

Syntax

Sub ctlname_InvalidEntry()


MhIntInput: InvalidSetText

Description

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The Cancel parameter determines whether the invalid text is accepted by the control. If you set Cancel to True, the invalid text is not accepted. If Cancel is False, and you do not change the InvalidText string yourself, the text is accepted regardless of any invalid characters.

The InvalidText parameter contains the invalid text string that is being set into the control. You can clean up or override the invalid text simply by setting the InvalidText string to the desired string. If you do not set Cancel to True, the control will receive the modified InvalidText string.

Syntax

Sub ctlname_InvalidSetText(Cancel As Integer, InvalidText As String)


MhIntInput: Overview

The MhIntInput control is an enhanced version of the VB text box control designed specifically for numeric input. The MhIntInput control is ideal for data entry applications and other situations where you want to restrict user input to a certain long integer range. MhIntInput features the following:

-  Optional built-in spin buttons, with complete control over the position, increment/decrement values and repeat rate.

-  Optional horizontal scrolling when the text length exceeds the physical width of the control.

-  Horizontal and vertical alignment of the text.

-  Optional 3-D effects.

-  Complete control over the size, appearance and behavior of the caret.

-  The ability to define minimum and maximum values allowed by the control.

-  Custom events that occur when an invalid entry is made, or when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The following figure shows several example MhIntInput controls. The following table provides an overview of the MhIntInput control.

Typical MhIntInput Control Examples.

MhIntInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhIInp16.OCX MhIInp32.OCX MHININT.VBX	MhIntInput	See the MHIINT sample directory.		MhDateInput MhInput MhMaskInput MhRealInput
Development Notes

The AutoHScroll property determines whether the text is scrolled horizontally when its length exceeds the physical width of the control. When AutoHScroll is False, the number of characters that can be entered in the text box is limited by the physical width of the control.

The Min and Max properties define the range of long integers that may be entered in the control. Note that when AutoHScroll is False (no horizontal scrolling), and the control is not wide enough to display the Max value, the actual range is limited by the number of characters that will fit in the physical width of the control.

The Alignment and VAlignment properties allow you to align the text horizontally and vertically within the control.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

The Caretxxxx properties give you complete control over the size, appearance and behavior of the caret.

The Spin property determines where the spin buttons (if any) are positioned within the control, and the remaining Spinxxxx properties allow you to set the increment/decrement value, and repeat rate.

The InvalidEntry event occurs when the value within the control is outside the range specified by the Max or Min properties, and the control loses the focus. The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.


MhOutOfBounds: ChData

Description

The ChData property is a string array that sets the names of the controls that are bound using this instance of MhOutOfBounds. This property is a string array that contains the names of the controls that are bound with MhOutOfBounds. This property can be set only at design time using the configuration dialog.

Syntax

ctlname.ChData(Element%) = String$

Data Type

String Array

Availability

Design-Time

See Also

ChDataChanged


MhOutOfBounds: ChDataChangeAllowed

Description

The ChDataChangeAllowed property indicates whether the linked data field is automatically updated when linked data is changed. The valid settings for the ChDataChangeAllowed property follow:

Setting	Description

True (-1)	The linked data field will be automatically updated when the data changes.

False (0)	(Default) The linked data field will not be changed.

The indices of this array correspond to the controls in the ChData() array. The linked fields are the control properties that are specified in the ChDataField array.

Syntax

ctlname.ChDataChangeAllowed(Element%) = boolean%

Data Type

Boolean Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ChDataChanged


MhOutOfBounds: ChDataChanged

Description

The ChDataChanged property indicates that the data for the control has changed. This property is identical in functionality to the VB3 DataChanged property. The indices of this Boolean array correspond to the controls in the ChData() array and the Data Control in the ChDataSource array.

Syntax

value% = ctlname.ChDataChanged(element)

Data Type

Boolean Array

Availability

Run-Time Read

See Also

ChDataChangeAllowed


MhOutOfBounds: ChDataConfigure

Description

The ChDataConfigure property provides access to the configuration dialog. To access the configuration dialog, double-click the left mouse button on the ChDataConfigure property in the property list.

Data Type

String

Availability

Design-Time

See Also

ChDataSource


MhOutOfBounds: ChDataField

Description

The ChDataField property sets the data fields that are bound using this instance of the control. This property is identical in functionality to the standard VB 3 DataField property. The indices of this array correspond to the controls in the ChData() array and the Data Control in the ChDataSource array.

Data Type

String Array

Availability

Design-Time

See Also

ChData


MhOutOfBounds: ChDataSource

Description

The ChDataSource property sets the data source that is used to bind the controls. This property is identical in functionality to the standard VB 3 DataSource property. The indices of this array correspond to the controls in the ChData() array.

Data Type

String Array

Availability

Design-Time

See Also

ChData


MhOutOfBounds: ChDataTarget

Description

The ChDataTarget property sets the property that is bound to the same index value of the ChDataField property. The indices of this array correspond to the controls in the ChData() array. These are the control properties that are linked to the field specified in the ChDataField array.

Data Type

String Array

Availability

Design-Time

See Also

ChData


MhOutOfBounds: Overview

The MhOutOfBounds control is used to bind any or all controls on the parent form, including the form and menu. This control is very unique and will work only with Visual Basic version 3 or later. The following table provides an overview of the MhOutOfBounds control.

MhOutOfBounds Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MHGOBD.VBX	MhOutOfBounds	See the MHOBD sample directory.		MhStretch
Development Notes

Since the MhOutOfBounds control is only used to bind properties of other controls with a data field, it is not visible at run time.

One of the more unique features of Visual Basic versions 3 and later is the ability to bind custom controls to specific fields within tables in a database. While you can manipulate any database using Visual Basic code, the ability to read and write records without writing a single line of code is very powerful and unique feature.

While many VBTools Mh3dxxx custom controls are bound, there are several standard VB controls as well as dozens of other custom controls that are not bound or data aware. By placing one instance of an MhOutOfBounds control on any form, you can not only bind all of the controls on the form, you can even bind the form and the form's menu.

The only limitation is that MhOutOfBounds should not be used to bind an array related property. This includes attempting to populate a list or combo box. While you may not be able to fill a list with MhOutOfBounds you can bind any of the other static properties in the control.

The MhOutOfBounds control has only a few properties and the control itself is not visible at run time. To configure the control, double-click the left mouse button on the ChDataConfigure property in the properties list. The following dialog will be displayed:

A list of all controls on the form - as well as the form and menu names  - will appear in the list box on the right side of the dialog. To bind a control, you must first move it to the list box on the right. This can be done by either double-clicking the left mouse button on the control name or selecting the control and pressing the Add command button. To unbind or remove a control from the right list box, double-click the left mouse button on the control name or select the control and press the Del command button.

The Clear command button will remove all of the control names from the right (Bound Controls) list box. If the MhOutOfBounds control is placed on a container control, like a frame, the dialog will display only the controls on the container. If the All check box is checked, all of the controls and menus on the form will appear in the Controls list box.

To specify the Data Control and control property to bind, do the following:

1) Select the control in the right list box.

2) Select the data source and data field to use.

3) Select the control property that will be bound to the selected data field.

4) Repeat steps 1 - 3 for all bound controls.

The Update Database check box is used to set the corresponding ChDataChangeAllowed element to True. If this box is checked, the linked field will be automatically updated if the data changes.

If you add a control to a form after the MhOutOfBounds control and it does not appear in the dialog, close the form (double-click on the system menu) and then re-open it. The control should then appear in the list.

Note:  With the exception of the ChDataChanged array, all of the properties for this control are design time only.

Important:  Make sure the data type for the data field and control property are the same.

Note:  This control will only work with VB 3 or later. If you attempt to load this control into VB 1 or 2, it will load without error; however, nothing will appear in the toolbar and the control will not be registered.


MhSlide: LargeDown

Description

The LargeDown property sets or returns the amount to increase the Value property when the Page Down key is pressed. The range is zero to 32,767.

Syntax

ctlname.LargeDown = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LargeUp, SmallDown


MhSlide: LargeUp

Description

The LargeUp property sets or returns the amount to decrease the Value property when the Page Up key is pressed. The range is zero to 32,767.

Syntax

ctlname.LargeUp = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LargeDown, SmallUp


MhSlide: Max

Description

The Max property sets or returns the maximum amount for the Value property. Vertical slides are at the Max when the button is at the bottom of the slide. Horizontal slides are at this point when the button is at the right end of the slide. The range is zero to 32,767.

Syntax

ctlname.Max = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min, Value


MhSlide: Min

Description

The Min property sets or returns the minimum for the Value property. Vertical slides are at the Min point when the button is at the top of the slide. Horizontal slides are at this point when the button is at the left end of the slide. The range is zero to 32,767.

Syntax

ctlname.Min = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Value


MhSlide: PictureButton

Description

The PictureButton property sets or returns the bitmap, used in combination with the bitmap assigned to the PictureMask property, to draw the button or indicator on the slide. Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the PictureButton property equal to the picture property of another control. By default, there is no picture loaded.  Write-only at design time.  At run time, this property returns the picture's handle.

For more information on creating the images that make up the slide, please refer to the PictureMask property.

Syntax

ctlname.PictureButton = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask


MhSlide: PictureMask

Description

The PictureMask property sets or returns the bitmap used (in combination with the PictureButton property) to draw the button or indicator on the slide.

Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the PictureMask property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

MhSlide combines the PictureButton and the PictureMask bitmaps so that the background (the scale) shows through certain portions of the button. For information on creating custom slides, please refer to the Development Notes for the MhSlide control.

Syntax

ctlname.PictureMask = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureButton


MhSlide: PictureSlide

Description

The PictureSlide property sets or returns the bitmap used to draw the slide. If you don't specify a bitmap, the control uses the default bitmap.

Usage is the same as the standard Visual Basic Picture property. You can use the LoadPicture function or set the PictureSlide property equal to the picture property of another control. By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

MhSlide places copies of the bitmap end to end until it fills the height (for Style zero) or the width (for Style one) of the control. The best slides display some type of scale.

Syntax

ctlname.PictureSlide = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureButton, PictureMask


MhSlide: SmallDown

Description

The SmallDown property sets or return the amount to increase the Value property when the left/down arrow keys are pressed. The valid range is zero to 32,767.

Syntax

ctlname.SmallDown = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LargeDown, SmallUp


MhSlide: SmallUp

Description

The SmallUp property sets or return the amount to decrease the Value property when the right/up arrow keys are pressed. The valid range is zero to 32,767.

Syntax

ctlname.SmallUp = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LargeUp, SmallDown


MhSlide: Style

Description

The Style property sets or returns the slide orientation. Although this property is read/write at run time, it is generally set only at design time.  If you change the value of Style at run time, you'll need to swap the values of the control's Height and Width properties to maintain the same relative size. The valid settings for the Style property follow:

Setting	Description

0	(Default) Vertical

1	Horizontal

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSlide: Value

Description

The Value property sets or returns the button position on the slide. If you assign a number greater than Max, the control sets the Value property to Max. If you assign a number less Min, the control sets the Value property to Min. The range is zero to 32,767.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max, Min


MhSlide: Overview

The MhSlide control is a scrollbar-like control used to display a custom scale and button. You move the slide's button to set the Value of the control. MhSlide provides four different slides you can use in your program, or you can create your own slides.

MhSlide controls are useful for representing volume controls, slides on industrial equipment, rulers for positioning text or any situation where you want to display a scale and position a pointer within a range of values.

The following figure shows example MhSlide controls. The following table provides an overview of the MhSlide control.

MhSlide Control Examples.

MhSlide Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhSlid16.OCX MhSlid32.OCX MHSL200.VBX	MhSlide	See the MHSLID sample directory.		N/A
Development Notes

When you create an MhSlide control, the Style property defaults to zero (Vertical). As you draw the slide, the default bitmaps are used to completely fill the control. If you change the orientation of a slide, you must adjust the height and width you've reserved on your form to match the new direction.

The control contains bitmaps for the default slide, so if you use the defaults, you don't need to include any other files with your program. If you specify custom bitmaps during design mode, Visual Basic includes those bitmap files in your .EXE file when you compile your program. However, if you want to specify the bitmaps at run time, be sure to make the bitmap files accessible when you run your program. If you don't, you'll receive a File not found error when you try to load the files.

While the operation of MhSlide is similar to Visual Basic's scroll bar controls, there are some differences as follows:

-  You can use either the BackColor or ForeColor property to define the color that fills the scale on MhSlide controls.

-  You can specify custom bitmaps. If you do, be sure to set the Style property to match the orientation (vertical or horizontal) of your bitmap. If you don't, MhSlide won't be able to display your slide the way you intend.

Creating your own slides

The MhSlide control contains all the instructions to move the button and to set and return the value of the button. Consequently, if you want to create a custom slide, all you have to do is design three bitmaps like the ones shown below — one for the slide, one for the button and one for the mask.

Slide	Button	Mask

When you set the Picturexxx properties of the control to your bitmap filenames, MhSlide will do the rest.

To create bitmap files, you can use PaintBrush or a program like the resource compiler Microsoft ships with its Windows SDK. Let's look at guidelines for creating bitmaps - we'll use the bitmaps for the default vertical slide.

The Slide bitmap

When you design a slide bitmap, you need only create a bitmap that contains the unique portion of your slide's scale. MhSlide automatically fills the height (for Style zero) or the width (for Style one) of your slide with this bitmap. We suggest you use scales of some type.

The Button bitmap

MhSlide uses the button bitmap - in combination with the mask bitmap - to draw the indicator on the slide. The button bitmap should represent the button, or pointing object, of the slide. As you can see from the example above, the button bitmap appears slightly different from the button of the default MhSlide control. This difference is due to the action of the mask bitmap.

The Mask bitmap

To draw the indicator on the slide, MhSlide combines the bitmaps of the slide, button and mask in such a way that the scale shows through certain portions of the button. The mask bitmap determines which portions of the button bitmap will be visible and which portions will allow the scale to show through.

You should draw the mask with black and white only. Use black where you want to see the pointing device and white where you want the slide to show through. Be sure that these two bitmaps are the same size!

When you design these three bitmaps, picture them displayed one on top of the other. Each white pixel on the mask bitmap lets the slide bitmap show, while the black pixels let the button bitmap show through.


MhStretch: AutoCutoff

Description

The AutoCutoff property sets or returns the reusable state of the control. The valid settings for the AutoCutoff property follow:

Setting	Description

True (-1)	(Default) The control allows only one resizing.

False (0)	You can resize the same control several times.

Syntax

ctlname.AutoCutoff = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhStretch: AutoLinkhWnd

Description

The AutoLinkhWnd property sets or returns the hWnd of a control or form that this sizing control is hooked to for automatic resizing. The valid settings for the AutoLinkhWnd property follow:

Setting	Description

Zero	(Default) Do not autosize any other window.

Non-zero	When set to a valid hWnd for another control on the same form (or the form itself), the MhStretch control automatically resizes the other object when the user resizes this control, so you don't have to write any code.

Syntax

ctlname.AutoLinkhWnd = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhStretch: CornerWidth

Description

The CornerWidth property sets or returns the width (in twips) of the corners of the control in which MhStretch presents the diagonal sizing cursors. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.CornerWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Thickness


MhStretch: GrabHandleColor

Description

The GrabHandleColor property sets or returns the color of the grab handles when the control is active. The grab handles will always be black (&H00000000&) at design-time. This property is only used at run time.

Syntax

ctlname.GrabHandleColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CornerWidth, Thickness


MhStretch: Thickness

Description

The Thickness property sets or returns the width (in twips) of the sizing handles of the control. The default value is zero. The range is zero to 32,767.

Syntax

ctlname.Thickness = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CornerWidth, GrabHandleColor


MhStretch: LinkResize

Description

The LinkResize event occurs when AutoLinkhWnd is True and the control receives a sizing message from Windows. The event will also occur after the user completes a resize operation.

Syntax

Sub ctlname_LinkResize()


MhStretch: Resize

Description

The Resize event occurs when the control receives a sizing message from Window or after the user completes a resize operation. If the AutoCutoff property is set to True, the MhStretch control allows only one resizing.

Syntax

Sub ctlname_Resize()


MhStretch: Overview

The MhStretch control lets the user size other controls or mark a rectangular area of the display. An MhStretch control, when enabled, looks like a rectangle with a set of sizing handles as shown in the following figure. The following table provides an overview of the MhStretch control.

MhStretch Control Example.

MhStretch Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhStre16.OCX MhStre32.OCX MHSR200.VBX	MhStretch	See the MHSTRE sample directory.	N/A	MhDragDrop MhInvisible
Development Notes

The MhStretch control is helpful when you want to make it easy for users to mark an area of the display or customize the appearance of your forms. For example, suppose you create a form with a number of controls. Depending on the task the user is performing, they may want to see some of the controls larger or smaller than your original design. You can use the MhStretch control to let users resize any of your controls.

The only non-standard aspect of the MhStretch control is that its borders can be dragged by the mouse.  When you make this control visible, the user can manipulate it with the mouse.

Automatic Resizing

The automatic approach involves using the AutoLinkhWnd property which lets you add resizing features to your programs with a minimum of effort. For example, to resize a control named X, simply execute the following statements:

MhStretch1.AutoLinkhWnd = X.hWnd

MhStretch1.Visible = -1

The first instruction sets up a link between the MhStretch1 control and the control (named X) to be resized. The second instruction makes the MhStretch1 control visible so the user can grab the sizing handles and resize it. That's all it takes to resize a control!

You need to be aware of one special consideration when you use the AutoLinkhWnd property: When you link two controls using this property, the link is maintained until you set AutoLinkhWnd to zero or you set the MhStretch control's Visible property to False.

You can control the automatic resizing using the AutoCutoff property. The default is True, but you can allow repeated resizing with:

MhStretch1.AutoCutoff = False

before you install the auto link between the controls.  This instruction specifies that you want to leave the automatic link in place after resizing. Of course, you can resize the control as many times as you want. Setting this property gives you the opportunity to make that choice after each resize operation.

Manual Resizing

You can also resize controls manually, using code like this:

MhStretch1.AutoLinkhWnd = 0 	'Make sure not active

StretchActive = -1         	'Flag to get out of loop

'Position MhStretch over the X control

MhStretch1.Move X.Left, X.Top, X.Width, X.Height

Do 	'All the stretching you want until you

   	'set StretchActive to False at some point here

  yy = DoEvents()

Loop While StretchActive

' Now resize the control manually because

' MhStretch can't do it for you since it doesn't

' know which control it was!

X.Move MhStretch1.Left, MhStretch1.Top, MhStretch1.Width, MhStretch1.Height

X.Refresh 	'Refresh the contents of the control

After using the control to mark or capture a portion of the display, your program can query the MhStretch control's Height, Width, Left, and Top properties and use those values to take whatever action is appropriate.

Note:  If you are experiencing a problem with an MhStretch control obscuring the control that is being resized, try placing one or two DoEvents() statements in the code that handles the resizing.


MhWave: Date

Description

The Date property plays the wave files necessary to sound-out the specified date string. The date string must contain either 8 or 10 characters with slashes (“/”) separating the month, day, and year. The following examples demonstrate the 8 and 10 character string formats.

MhWave1.ReadNumbersFile = “MHWAVE.MHW”

MhWave1.Date = “01/05/95”

MhWave1.Date=  “01/05/1995”

Syntax

ctlname.Date = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Dollar, Number


MhWave: Description

Description

The Description property sets or returns a description of the wave file specified by the current value of WaveIndex. The default value for Description is the name of the wave file.

Syntax

ctlname.Description = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveIndex


MhWave: Dollar

Description

The Dollar property plays the wave files necessary to sound-out the specified dollar string. The following example demonstrates how to set the dollar string.

MhWave1.ReadNumbersFile = “MHWAVE.MHW”

MhWave1.Dollar = “$123,456.78”

Syntax

ctlname.Dollar = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Date, Number


MhWave: FilenameRead

Description

The FilenameRead property reads the specified wave file into the currently selected WaveIndex. The following example demonstrates how to use the FilenameRead property.

MhWave1.FilenameRead = “CHIMES.WAV”

Syntax

ctlname.FilenameRead = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FilenameWrite


MhWave: FilenameWrite

Description

The FilenameWrite property writes the wave file referenced by WaveIndex to a disk file. The following example demonstrates how you can write the current wave file to disk.

MhWave1.FilenameWrite = “CHIMES.WAV”

Syntax

ctlname.FilenameWrite = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FilenameRead


MhWave: Number

Description

The Number property plays the wave files necessary to sound-out the specified number string. The following example demonstrates how to use the Number property.

MhWave1.Number = “123,456”

Syntax

ctlname.Number = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Date, Dollar


MhWave: Play

Description

The Play property plays the specified wave file. The valid range for the Play property is 0 to 255. The following demonstrates the use of the Play property.

MhWave1.WaveIndex = 12

MhWave1.FilenameRead = “CHIMES.WAV”

MhWave1.Play = 12

Syntax

ctlname.Play = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveIndex


MhWave: Playing

Description

The Playing property returns a value that indicates whether a wave file is currently being played.

Syntax

boolean% = ctlname.Playing

Data Type

Boolean

Availability

Run-Time Read

See Also

Play


MhWave: PlayList

Description

The PlayList property plays the specified wave files in order. Set this property to a comma-delimited string of WaveIndex values. The corresponding wave files will be played in order. The valid range for the PlayList property is 0 to 255. The following example demonstrates how to use the PlayList property.

MhWave1.PlayList = “1,2,3,5,9,1”

Syntax

ctlname.PlayList = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WaveIndex


MhWave: PlayQueue

Description

The PlayQueue property returns the number of files that are in the queue waiting to be played.

Syntax

integer% = ctlname.PlayQueue

Data Type

Integer

Availability

Run-Time Read

See Also

Play


MhWave: ReadNumbersFile

Description

The ReadNumbersFile property reads a numbers file. The MHWAVE.MHW numbers file is provided with OLETools and VBTools. This file contains English wave files for all numbers, dates, and dollars.

Syntax

ctlname.ReadNumbersFile = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WriteNumbersFile


MhWave: Reverse

Description

The Reverse property indicates whether wave files are played forwards or backwards. The valid settings for the Reverse property follow:

Setting	Description

True	Wave files are played backwards (in reverse order).

False	Wave files are played forwards (normally).

Syntax

ctlname.Reverse = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Play


MhWave: WaveIndex

Description

The WaveIndex property sets or returns the index of the current wave file. The valid range is 0 to 255.

Syntax

ctlname.WaveIndex = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PlayList


MhWave: WaveSize

Description

The WaveSize property returns the size of the current wave file.

Syntax

long& = ctlname.WaveSize

Data Type

Long

Availability

Design-Time

Run-Time Read

See Also

PlayList


MhWave: WriteNumbersFile

Description

The WriteNumbersFile property writes a numbers file to disk. The MHWAVE.MHW numbers file is provided with OLETools and VBTools. This file contains the English wave files for all numbers, dates, and dollars. You can make your own numbers file by loading wave files into the appropriate WaveIndexes and setting WriteNumbersFile to the name of your numbers file. The following table lists the available indexes in a numbers file.

WaveIndex	Description

200	Zero

201	One

202	Two

203	Three

204	Four

205	Five

206	Six

207	Seven

208	Eight

209	Nine

210	Ten

211	Eleven

212	Twelve

213	Thirteen

214	Fourteen

215	Fifteen

216	Sixteen

217	Seventeen

218	Eighteen

219	Nineteen

220	Twenty

221	Thirty

222	Forty

223	Fifty

224	Sixty

225	Seventy

226	Eighty

227	Ninety

228	Hundred

229	Thousand

230	Million

231	Billion

232	Point

233	Dollar

234	Dollars

235	And

236	No

237	Cent

238	Cents

239	January

240	February

241	March

242	April

243	May

244	June

245	July

246	August

247	September

248	October

249	November

250	December

251	Negative

Syntax

ctlname.WriteNumbersFile = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ReadNumbersFile


MhWave: EndQueue

Description

The EndQueue event occurs after all wave files in the queue have been played.

Syntax

Sub ctlname_EndQueue()


MhWave: EndWave

Description

The EndWave event occurs when a wave file has finished playing.

Syntax

Sub ctlname_EndWave()


MhWave: Overview

The MhWave control makes storing and playing wave (.WAV) files easy. MhWave also includes special functionality that you can use to play pre-recorded numbers and dates. The MhWave control requires a sound card for the playback of wave files. The following table provides an overview of the MhWave control.

MhWave Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhWave16.OCX MhWave32.OCX MHWAVE.VBX	MhWave	See the MHWAVE sample directory.	N/A	MhAVI
Development Notes

The MhWave control is easy to use. Simply load a wave file, then play it. Wave files can be loaded at design-time or during run-time. To load a wave file at design-time, first set the WaveIndex property to the value you want to associate with a particular wave file. WaveIndex can be any value from 0 to 255. Next, right-double-click on the control. A dialog box will be displayed that allows you to locate, test, and load a wave file. The wave file you load will be associated with the value specified in WaveIndex and will be saved in the form. By setting WaveIndex to different values, you can save up to 255 wave files in the control during design-time. Any wave file loaded at design-time is saved in the form so you will not have to ship these wave files with your application. Wave files can also be loaded during run-time. However, files that are loaded during run-time are not saved in the form.

The Play property allows you play the wave file corresponding to the value specified in WaveIndex. You can also set PlayList to a comma-delimited string with a number of WaveIndexes to play a series of wave files. Wave files are played in the order that they are added to PlayQueue.

MhWave also provides the ability to automatically play dates and numbers. To take advantage of this ability, first set ReadNumbersFile to MHWAVE.MHW. This file is provided with OLETools and VBTools. Next, set either the Date or Number property. When these properties are set, the control will automatically play the appropriate wave files in the order needed to sound-out the number or date.


MhIni: Action

Description

The Action property performs the specified operation on the INI file defined in INIFileName. After the specified operation has been completed, the property is reset to zero. The valid settings for the Action property follow:

Setting	Description

0	Idle

1	Clear - clears the EntryValueArray

2	Read entry (INI Files)

3	Write entry (INI Files)

4	Remove entry (INI Files)

5	Read comment (INI Files)

6	Write comment (INI Files)

7	Convert the entry to a comment (INI Files)

8	Evaluate sections - fills the EntryValueArray with all the sections in the current INI file (INI Files)

9	Evaluate entries - fills the EntryValueArray with all the entries in the specified section of the current INI file (INI Files)

10	Convert a commented entry back to a valid entry (INI Files)

11	Create key (Registry)

12	Set key value (Registry)

13	Query key value (Registry)

14	Enumerate key (Registry)

15	Delete key (Registry)

Note:  For Windows 3.1 and 3.11, only HKEY_CLASSES_ROOT is available for registration database functions.

Note:  Action and EntryStyle are used together. If EntryStyle is not defined, the default value of Normal will be used.

Syntax

ctlname.Action = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

INIFileName


MhIni: AutoWindow

Description

The AutoWindow property indicates whether the control automatically reads its parent window’s state from an INI file on startup and writes its parent window’s state when closed. The valid settings for the AutoWindow property follow:

Setting	Description

True (-1)	The control automatically reads/writes the parent window’s state.

False (0)	The control does not read/write the parent window’s state.

Syntax

ctlname.AutoWindow = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wState


MhIni: BorderStyle

Description

The BorderStyle property sets or returns the border style for the control. The valid settings for the BorderStyle property follow:

Setting	Description

0	None

1	Fixed single

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIni: CaseSensitive

Description

The CaseSensitive property indicates whether string comparisons and searches are case-sensitive. The valid setting for the CaseSensitive property follow:

Setting	Description

True (-1)	String comparisons and searches are case-sensitive.

False (0)	String comparisons and searches are not case-sensitive.

Syntax

ctlname.CaseSensitive = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhIni: Comment

Description

The Comment property sets or returns a comment for an INI file.

Syntax

ctlname.Comment = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryItem


MhIni: Count

Description

The Count property is used to specify the index in EntryValueArr.

Syntax

ctlname.Count = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryValueArr


MhIni: DefaultValue

Description

The DefaultValue property specifies the default value for the entry in EntryItem.

Syntax

ctlname.DefaultValue = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryItem


MhIni: EntryEncrypt

Description

The EntryEncrypt property indicates whether to encrypt or decrypt a value. The valid settings for the EntryEncrypt property follow:

Setting	Description

True (-1)	The value is encrypted.

False (0)	(Default) The value is not encrypted

Syntax

ctlname.EntryEncrypt = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaskChar


MhIni: EntryItem

Description

The EntryItem property specifies the item in the INI file that is the target of the operation specified in Action. The item is located in the section specified in EntrySection.

Syntax

ctlname.EntryItem = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntrySection


MhIni: EntrySection

Description

The EntrySection property specifies the section in the INI file that is the target of the operation specified in Action. The item in the section affected by Action is specified in EntryItem.

Syntax

ctlname.EntrySection = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryItem


MhIni: EntryStyle

Description

The EntryStyle property specifies the style for the INI operation specified in Action. The valid settings for the EntryStyle property follow:

Setting	Description

0	Normal

1	Parsed

2	Array

4	Window State

5	Device

Syntax

ctlname.EntryStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhIni: EntryValue

Description

The EntryValue property sets or returns the value of the entry specified by EntryItem and EntrySection.

Syntax

ctlname.EntryValue = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryItem, EntrySection


MhIni: EntryValueArr

Description

The EntryValueArr property is a string array that can be used to set or retrieve multiple values in an INI file. For example, you can set/get all the sections in an INI file or all the items in a section.

Syntax

ctlname.EntryValueArr(element) = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryValue


MhIni: INIFileName

Description

The INIFileName property specifies the INI file manipulated by the Action property. The INIPath property specifies the path for this INI file.

Syntax

ctlname.INIFileName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

INIPath


MhIni: INIPath

Description

The INIPath property specifies the path of the INI file in INIFileName. MhIni assumes the INI file is in the Windows directory. Use the INIPath property if the INI file is not in the Windows directory.

Syntax

ctlname.INIPath = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

INIFileName


MhIni: Key

Description

The Key property sets or returns the root registry key of the key you wish to access, create or modify. The valid settings for the Key property follow:

Setting	Description

1	Classes Root

2	Current User

3	Local Machine

4	Users

5	Performance Configuration

6	Current Configuration

7	Dynamic Data

Note: Under Windows 3.1x the only Root key which is valid is Classes_Root. Also, the VBX and 16-bit OCX can only work with the Classes_Root key.

Syntax

ctlname.Key = setting$

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhIni: MaskChar

Description

The MaskChar property is used to encrypt or decrypt EntryValue when EntryEncrypt is True. The value specified in this property is XORed with the value in EntryValue to set or retrieve the appropriate entry value. The valid values are any letters A-Z (ASCII 65-90)or a-z (ASCII 97-122).

Syntax

ctlname.MaskChar = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EntryValue


MhIni: wHeight

Description

The wHeight property returns the current height of the control’s parent window when reading the window state values from an INI file.

Syntax

ctlname.wHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wWidth


MhIni: wLeft

Description

The wLeft property returns the current left position of the control’s parent window when reading the window state values from an INI file.

Syntax

ctlname.wLeft = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wTop


MhIni: wState

Description

The wState property returns the current state of the control’s parent window from an INI file.

Syntax

ctlname.wState = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wHeight, wLeft, wTop, wWidth


MhIni: wTop

Description

The wTop property returns the current top position of the control’s parent window when reading the window state values from an INI file.

Syntax

ctlname.wTop = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wLeft


MhIni: wWidth

Description

The wWidth property returns the current width of the control’s parent window when reading the window state values from an INI file.

Syntax

ctlname.wWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

wHeight


MhIni: Error

Description

The Error event occurs when an error is encountered.

Syntax

ctlname_Error(ErrorValue As Type Integer, Description As Type String)


MhIni: ReadWindowState

Description

The ReadWindowState event occurs when reading the control’s parent window state from the INI file.

Syntax

ctlname_ReadWindowState()


MhIni: SaveWindowState

Description

The SaveWindowState event occurs when writing the control’s parent window state to the INI file.

Syntax

ctlname_SaveWindowState()


MhIni: Overview

The MhIni control provides the capability to retrieve, add, and modify information in Windows initialization (INI) files and the Windows Registry. The following table provides an overview of the MhIni control.

MhIni Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhIni16.OCX MhIni32.OCX MhIni.VBX	MhIni	See the MHINI sample directory.		N/A

Development Notes

Use the INIFileName property to specify the name of the initialization file you want to access. The Action property specifies the action performed on the initialization file specified in INIFileName.

The following is a brief discussion of each Action value and how you would go about performing each one.

Note: For Action values between 2 and 10 you must always set INIFileName to a valid INI file. The INIPath property is optional; if it is not set, then the path defaults to the directory in which Windows is installed. The behavior of some Action values differs depending on the value of EntryStyle as shown below.

The discussion below will use the following sample INI file named INITest.ini for the examples:

[Animals]

Bear1=Grizzly

Bear2=Black

Bear3=Brown

Bear4=Polar

Bird=Parrot

Cats=Tiger,Lion,Panther

[Computer]

device=monitor.sys

device=keyboard.sys

speed=75

device=mouse.com

0 (Idle)

A value of 0 indicates that the control is inactive. After setting Action to a non-zero value, MhIni resets the Action property  to 0 automatically. Therefore, you can check to determine if the Action has completed

1 (Clear)

Setting Action to 1 clears EntryValueArr (Entry Value Array).

2 (Read)

To read a value from an INI file:

EntryStyle

0 - Normal

Supply:	INIFileName, EntrySection, EntryItem

Returns:	EntryValue

Example:	Supply

MhIni1.INIFileName = ”INITest.ini”

MhIni1.EntrySection = ”Animals”

MhIni1.EntryItem = ”Bird”

Returns

MhIni1.EntryValue = "Parrot"

1 - Parsed

Supply:	INIFileName, EntrySection, EntryItem

Returns:	Value(s) in EntryValueArr

Example:	Supply

MhIni1.INIFileName =”INITest.ini”

MhIni1.EntrySection =”Animals”

MhIni1.EntryItem=”Cats”

Returns

MhIni1.EntryValueArr(0) = "Tiger"

MhIni1.EntryValueArr(1) = "Lion"

MhIni1.EntryValueArr(2) = "Panther"

2 - Array

Supply:	INIFileName, EntrySection, EntryItem, Count

Returns:	Value(s) in EntryValueArr

Example:	Supply

MhIni1.INIFileName = ”INITest.ini”

MhIni1.EntrySection = ”Animals”

MhIni1.EntryItem = ”Bear”

MhIni1.Count = 3

Returns

MhIni1.EntryValueArr(0) = "Grizzly"

MhIni1.EntryValueArr(1) = "Black"

MhIni1.EntryValueArr(2) = "Brown"

3 - WindowState

Supply:	INIFileName, EntrySection

Returns:	wTop, wLeft, wHeight, wWidth, wState

4 - Device

Supply:	INIFileName,  EntrySection, EntryValue

Returns:	Value(s) in EntryValueArr

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = ”Computer”

Returns

MhIni1.EntryValueArr(0) = "monitor.sys"

MhIni1.EntryValueArr(1) = "keyboard.sys"

MhIni1.EntryValueArr(2) = "mouse.com"

3 (Write)

To write a value to an INI file:

EntryStyle

0 - Normal

Supply:  	INIFileName, EntrySection, EntryItem, EntryValue

Sets:	EntryValue or DefaultValue

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = "Section1"

MhIni1.EntryItem = ”Item1”

MhIni1.EntryValue = "Value1"

Sets

[Section1]

Item1=Value1

1 - Parsed

Supply:	INIFileName, EntrySection, EntryItem, EntryValueArr

Sets:	One entry with multiple values

Example:	Supply

MhIni1.INIFileName = ”INITest.ini”

MhIni1.EntrySection = "Section1"

MhIni1.EntryItem = ”Item1”

MhIni1.EntryValueArr(0) = "Value1"

MhIni1.EntryValueArr(1) = "Value2"

MhIni1.EntryValueArr(2) = "Value3"

Sets

[Section1]

Item1=Value1,Value2,Value3

2 - Array

Supply:	INIFileName, EntrySection, EntryItem, Count

Sets:	Multiple entries with common name

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = "Section1"

MhIni1.EntryItem = ”Item”

MhIni1.Count = 3

MhIni1.EntryValueArr(0) = "Value1"

MhIni1.EntryValueArr(1) = "Value2"

MhIni1.EntryValueArr(2) = "Value3"

Creates

[Section1]

Item1=Value1

Item2=Value2

Item3=Value3

3 - WindowState

Supply:	INIFileName, EntrySection, wTop, wLeft, wHeight, wWidth, wState

Sets:	Appropriate the aforementioned entries in the whichever section is specified.

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = "Window State"

MhIni1.wTop = 100

MhIni1.wLeft = 100

MhIni1.wHeight = 200

MhIni1.wWidth = 500

MhIni1.wState = "Normal"

4 - Device

Supply:	INIFileName, EntrySection, EntryValue

Sets:	Value in "device=" entry

4 (Remove Entry)

Supply:	INIFileName, EntrySection, EntryItem, EntryValue

Results:	Removes entry if found

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = "Animals"

MhIni1.EntryItem = ”Bear4”

MhIni1.EntryValue = "Polar"

Returns

Deletes line in INI file if found.

5 (Read Comment)

Supply:	INIFileName, EntrySection, EntryItem

Results:	Comment returned in Comment property if found

6 (Write Comment)

Supply:	INIFileName, EntrySection, EntryItem, EntryValue, Comment

Results:	Writes comment just above specified line

7 (Comment Out Entry)

Supply:	INIFileName, EntrySection, EntryItem, EntryValue

Results:	Preceeds specified line with a semi-colon

Example:	Start With

Bird=Parrot

Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1. EntrySection = ”Animals”

MhIni1. EntryItem = ”Bird”

Returns

;Bird=Parrot

8 (Enumerate Sections)

Supply:	INIFileName

Results:	Returns all sections in the EntryValueArr for Count times

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

Returns

MhIni1.EntryValueArr(0) = "Animals"

MhIni1.EntryValueArr(1) = "Computer"

MhIni1.Count = 2

9 (Enumerate Items)

Supply:	INIFileName, EntrySection

Results:	Returns all the items in the EntryValueArr for the specified section for count times

Example:	Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1.EntrySection = ”Animals”

Returns

MhIni1.EntryValueArr(0) = "Bear1"

MhIni1.EntryValueArr(1) = "Bear2"

MhIni1.EntryValueArr(2) = "Bear3"

MhIni1.EntryValueArr(3) = "Bear4"

MhIni1.EntryValueArr(4) = "Bird"

MhIni1.EntryValueArr(5) = "Cats"

MhIni1.Count = 6

10 (Uncomment Entry)

Supply:	INIFileName, EntrySection, EntryItem, EntryValue

Results:	If item is commented out, the semi-colon will be removed

Example:	Start With

;Bird=Parrot

Supply

MhIni1. INIFileName = ”INITest.ini”

MhIni1. EntrySection = ”Animals”

MhIni1. EntryItem = ”Bird”

Returns

Bird=Parrot

11 (Create Key)

Supply:	Key (32-bit), EntrySection (key)

Results:	Creates key off of root or wherever specified; ignores EntryItem and EntryValue settings.

Example:	MhIni1.Key = 1

MhIni1.EntrySection = "MyKey\SubKey"

12 (Set Value)

Supply:	EntrySection (key), EntryItem (optional), EntryValue, Key (32-bit)

Results:	Sets Value for specified key. Set Value will create the key if it does not already exist.

Example:	MhIni1.Key = 1

MhIni1.EntrySection = "MyKey\SubKey"

MhIni1.EntryItem = ""

MhIni1.EntryValue = "Good Day, eh"

13 (Query Value)

Supply:	Key (32-bit), EntrySection (key), EntryItem (optional)

Results:	Gets the value and returns it in EntryValue

Example:	MhIni1.Key = 1

MhIni1.EntrySection = "MyKey\SubKey"

MhIni1.EntryItem = "Value 1"

14 (Enumerate Keys)

Supply:	Key (32-bit), EntrySection (key)

Results:	Returns all the SUB KEYS in the EntryValueArr for Count times

15 (Delete Keys)

Supply:	Key (32-bit), EntrySection (key)

Results:	Deletes key specified and all subkeys beneath it


MhNetwork: Connection

Description

The Connection property specifies the action performed for the next connection attempt. The valid settings for the Connection property follow:

Setting	Description

0	Idle

1	Add

2	Cancel

3	Get

Syntax

ctlname.Connection = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Dialog


MhNetwork: Dialog

Description

The Dialog property specifies the type of dialog to display.

Setting	Description

0	Idle

1	Browse (Not available in 32-bit; only in NT for 16-bit)

2	Connection

3	Disconnect

4	View Queue (Not available in 32-bit; only in NT for 16-bit)

Syntax

ctlname.Dialog = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Connection


MhNetwork: ForceClose

Description

The ForceClose property indicates whether all open files are automatically closed when a connection is canceled. The valid settings for the ForceClose property follow:

Setting	Description

True	Files are automatically closed when a connection is canceled.

False	Files are not automatically closed when a connection is canceled.

Syntax

ctlname.ForceClose = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Connection


MhNetwork: GetUser

Description

The GetUser property gets the name of the current user and returns the name in UserName. The valid settings for the GetUser property follow:

Setting	Description

True	The user name is retrieved and returned in UserName.

False	No action is performed.

Syntax

ctlname.GetUser = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

UserName


MhNetwork: LocalName

Description

The LocalName property is used to store or return paths for the local machine.

Syntax

ctlname.LocalName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

RemoteName


MhNetwork: NetPass

Description

The NetPass property specifies the password needed by actions that require a password.

Syntax

ctlname.NetPass = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Connection


MhNetwork: NetPath

Description

The NetPath property is used to store and return network paths.

Syntax

ctlname.NetPath = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LocalName


MhNetwork: RemoteName

Description

The RemoteName property is used to store and return paths for the remote machine.

Syntax

ctlname.RemoteName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LocalName


MhNetwork: UserName

Description

The UserName property stores the user name returned by GetUser.

Syntax

ctlname.UserName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GetUser


MhNetwork: Cancel

Description

The Cancel event occurs when the user chooses the Cancel button in a dialog box.

Syntax

Sub ctlname_Cancel()


MhNetwork: Overview

The MhNetwork control provides quick and easy access to standard Windows network dialogs and functionality. The following table provides an overview of the MhNetwork control.

MhNetwork Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhNet16.OCX MhNet32.OCX MHNET.VBX	MhNetwork	See the  MHNET sample directory.		MhCommonDialog


MhImage: AutoSize

Description

The AutoSize property indicates whether the control should automatically be sized the image. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	Size the control to the image.

False (0)	Neither the picture or control is resized.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileName


MhImage: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhImage: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties.

Syntax

ctlname.BevelStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhImage: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhImage: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhImage: CaptionXPosition

Description

The CaptionXPosition property specifies the horizontal position of the caption’s baseline.

Syntax

ctlname.CaptionXPosition = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionYPosition


MhImage: CaptionYPosition

Description

The CaptionYPosition property specifies the vertical position of the caption’s baseline.

Syntax

ctlname.CaptionYPosition = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaptionXPosition


MhImage: FileName

Description

The FileName property specifies the name of the image file displayed in the control. Setting this property displays the file in the control.

Syntax

ctlname.FileName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, WallPaper


MhImage: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhImage: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is displayed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhImage: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhImage: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhImage: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhImage: WallPaper

Description

The WallPaper property sets or returns the method to use when displaying the image if the AutoSize property is False. The valid settings for the WallPaper property follow:

Setting	Description

0	(Default) StrBlt. The size of the image is changed to match the size of the control.

1	BitBlt. The image is displayed using its original dimensions.

2	Replicate. The image is displayed using its original dimensions and duplicated as many times as necessary to fill the control. This is the same effect used by the WallPaper/Tile setting in the Control Panel.

Syntax

ctlname.WallPaper = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, FileName


MhImage: ZoomPercent

Description

The ZoomPercent property sets or returns the zoom factor for the image in the control. A value of 100 displays the image in its original size, 50 displays the image using half its original width and height, and 200 specifies the image using twice its original width and height. The valid range for this property is any positive integer value. This property is only valid when the WallPaper property is set to 1 (BitBlt).

Syntax

ctlname.ZoomPercent = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, WallPaper


MhImage: Overview

The MhImage control displays many of the most popular image file formats including:

-  BMP	-  PCX

-  TGA	-  TIF

-  ICON	-  WMF

-  GIF

24-bit color images are supported. The following provides an overview of the MhImage control.

MhImage Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhImag16.OCX MhImag32.OCX MhImag.VBX	MhImage	See the MHIMAG sample directory.		MhMarque

Development Notes

To quickly display a graphics file with MhImage, set FileName to the file you want to view. Setting FileName displays the specified file. MhImage supports BMP, GIF, PCX, TGA, TIF, ICO, and WMF image formats.

The displayed image can contain a caption. To display a caption, set Caption to the string you want to display. CaptionXPosition and CaptionYPosition specify the location of the caption.

MhImage allows you to size the displayed image. To size an image, set ZoomPercent to the appropriate zoom value. ZoomPercent is a percentage value where 100% is the actual size of the image, 50% is half the width and height of the original image, and 200% is twice the width and height of the original image.


MhAVI: Action

Description

The Action property specifies the action performed by the control. The Action property is automatically reset to 0 after the specified action has been invoked. Therefore, reading Action will always return 0. The valid settings for the Action property follow:

Setting	Description

0	Idle

1	Stop

2	Play (plays the AVI file in Filename)

3	PlayReverse (the AVI file in Filename is played in reverse)

4	ResetLoad (forces the control to revalidate the AVI file in Filename)

Syntax

ctlname.Action = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Filename


MhAVI: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The valid settings for the Alignment property follow:

Setting	Description

0	Align to Left

1	Align to Right

2	Align to Center

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhAVI: AutoSize

Description

The AutoSize property indicates whether the control is automatically sized to fit the frame width and height of the AVI file. The valid settings for the AutoSize property follow:

Setting	Description

True	The control is sized to the frame size of the AVI file.

False	The control is not automatically sized.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Sizeable


MhAVI: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767.

Syntax

ctlname.BevelSize = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhAVI: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767.

Syntax

ctlname.BevelSizeInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


MhAVI: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. If BevelSize is zero, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to zero, one or two, the bevel is drawn around all four sides of the control. When BevelStyle is three or four, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhAVI: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	Lowered

1	Raised

2	Chiseled

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


MhAVI: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Thin border

2	Thick border - sizable

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Sizeable


MhAVI: Filename

Description

The Filename property specifies the name of the AVI file to play.

Syntax

ctlname.Filename = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhAVI: FillColor

Description

The FillColor property defines the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


MhAVI: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhAVI: Length

Description

The Length property returns the number of frames in the AVI file specified by Filename.

Syntax

setting& = ctlname.Length

Data Type

Long Integer

Availability

Run-Time Read

See Also

Filename


MhAVI: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhAVI: MDI

Description

The MDI property indicates whether the control displays a caption, has MDI properties and can be resized by the user at run time. If the MDI property is False, the control does not display the control box, the minimize button or the maximize button, even if those properties are True. The valid settings for the MDI property follow:

Setting	Description

True (-1)	The control has MDI characteristics.

False (0)	The control does not have MDI characteristics.

Syntax

ctlname.MDI = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhAVI: PlayBar

Description

The PlayBar property indicates whether a play bar is drawn in the control window. The Play Bar contains controls that the user can use to play, stop, rewind, and pause the AVI file. The valid settings for the PlayBar property follow:

Setting	Description

True (-1)	The Play Bar is drawn.

False (0)	The Play Bar is not drawn

Syntax

ctlname.PlayBar = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Action


MhAVI: Position

Description

The Position property sets or returns a frame number in the AVI file. If you set this property, the control will move to this specified position, or frame, in the AVI file.  If you read this property, the current position, or frame, in the AVI file is returned.

Syntax

ctlname.Position = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Length


MhAVI: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhAVI: ShowTitle

Description

The ShowTitle property indicates whether a title (the text in the Caption property) is drawn in the title box of the control window. The valid settings for the ShowTitle property follow:

Setting	Description

True (-1)	Show the title

False (0)	Do not show the title

Syntax

ctlname.ShowTitle = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleHeight,TitleText


MhAVI: Sizeable

Description

The Sizeable property indicates whether the control window is sizable. The valid settings for the Sizeable property follow:

Setting	Description

True	The control window is sizable.

False	The control window is not sizable.

Syntax

ctlname.Sizeable = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhAVI: Speed

Description

The Speed property specifies the speed of the playback of the AVI file specified in Filename. This value is relative to a base value of 100. For example, a value of 200 doubles the playback speed.

Syntax

ctlname.Speed = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Filename


MhAVI: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhAVI: TitleHeight

Description

The TitleHeight property sets or returns the height of the title box of the control window. This property is only valid when ShowTitle is True.

Syntax

ctlname.TitleHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShowTitle,TitleText


MhAVI: TitleText

Description

The TitleText property sets or returns the text for the tiltle box of the control window. This property is only valid when ShowTitle is True.

Syntax

ctlname.TitleHeight = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShowTitle,TitleHeight


MhAVI: VAlignment

Description

The VAlignment property sets or returns how the title is positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhAVI: Volume

Description

The Volume property sets or returns the volume level for the playback of the AVI file in Filename. This value is relative to a base value of 1000. For example, a setting of 500 would set the volume to half. The range for the Volume property is 0 to 1000.

Syntax

ctlname.Volume = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Filename


MhAVI: WhatsThisHelpID

Description

The WhatsThisHelpID property returns the Help ID associated with the AVI file in Filename.

Syntax

ctlname.WhatThisHelpID = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

Filename


MhAVI: PositionChanged

Description

The PositionChanged event occurs when the position, or frame, of the AVI file is changed.

Syntax

ctlname_PositionChanged()


MhAVI: Clear

Description

The Clear method clears the control and sets Filename to “”.

Syntax

ctlname.Clear


MhAVI: Overview

The MhAVI control provides the ability to open and play audio-visual interleave (AVI) files. AVI files contain video and (optionally) audio in the Microsoft Video for Windows format. The followig table provides an overview of the MhAVI control.

MhAVI Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhAVI16.OCX MhAVI32.OCX MhAVI.VBX	MhAVI	See the MHAVI sample directory.	N/A	MhWave

Development Notes

To load an AVI file as design-time, set Filename to the name of the AVI file and set Action to 2 (Play). The process is the same at run-time. The control will only play the sound portion of the AVI file at design-time due to compatibility issues with the 16-bit version. During run-time, however, the video and audio portions of the file will be played.


MhTimeInput: Alignment

Description

The Alignment property sets or returns the horizontal alignment of the text displayed on the control. The valid settings for the Alignment property follow:

Setting	Description

0	Align to left

1	Align to right

2	Align to center

Syntax

ctlname.Alignment = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

VAlignment


MhTimeInput: AllowBlank

Description

The AllowBlank property indicates whether the control can be blank or whether it is automatically filled with the system time. The valid settings for the AllowBlank property follow:

Setting	Description

True	The control can be left blank.

False	The control is automatically filled with the system time and cannot be left blank.

Syntax

ctlname.AllowBlank = boolean%

Data Type

Boolean

Availability

Design-Time 	Run-Time Read     Run-Time Write

See Also

VAlignment


MhTimeInput: Am

Description

The Am property indicates whether the time is in the AM or the PM. This property is only valid when using a 12 hour time format. The valid settings for the Am property follow:

Setting	Description

True	The time specified is in the AM.

False	The time specified is in the PM.

Syntax

ctlname.Am= boolean%

Data Type

Boolean

Availability

Design-Time 	Run-Time Read     Run-Time Write


MhTimeInput: AutoHScroll

Description

The AutoHScroll property indicates whether the control automatically scrolls the text within the text box. If this property is False, the number of characters that can be entered in the text box is limited by the physical width of the control. The valid settings for the AutoHScroll property follow:

Setting	Description

True (-1)	The number of characters that can be entered into the text box may exceed the physical width of the control, and the text is automatically scrolled.

False (0)	The number of characters that can be entered into the text box is limited by the physical width of the control.

Syntax

ctlname.AutoHScroll = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTimeInput: BevelSize

Description

The BevelSize property sets or returns the size (in pixels) of the bevel or border around the outer edge of the control. The default value for the BevelSize property is zero. A value of zero indicates no border is drawn around the edge of the control. The valid range of the BevelSize property is zero to 32,767. You can modify the 3-D appearance of the control by setting the BevelSize property to a value greater than zero.

Syntax

ctlname.BevelSize = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyle


MhTimeInput: BevelStyle

Description

The BevelStyle property sets or returns the type of bevel used for the border around the outer edge of the control. When BevelSize is set to 0, BevelStyle is ignored and no bevel is drawn around the control. The valid settings for the BevelStyle property follow:

Setting	Description

0	(Default) Lowered

1	Raised

2	Chiseled

3	Shadowed Right

4	Shadowed Left

The 3-D effect is accomplished by drawing the bevel around the edge of the control with the colors specified in the LightColor and ShadowColor properties. When BevelStyle is set to 0, 1, or 2, the bevel is drawn around all four sides of the control. When BevelStyle is 3 or 4, the bevel is drawn around only two sides, giving the control a shadowed effect.

Syntax

ctlname.BevelStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSize


MhTimeInput: BorderColor

Description

The BorderColor property sets or returns the color of the outer border.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderStyle


MhTimeInput: BorderStyle

Description

The BorderStyle property sets or returns the control’s border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	No border

1	Single Line

2	Single Line with Rounded Corners

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTimeInput: CaretColor

Description

The CaretColor property sets or returns the color of the caret.

Syntax

ctlname.CaretColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretStyle


MhTimeInput: CaretHeight

Description

The CaretHeight property sets or returns the height of the caret. The default setting is zero, in which case the caret is sized according to the current font.

Syntax

ctlname.CaretHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretWidth


MhTimeInput: CaretInterval

Description

The CaretInterval property sets or returns the timer interval (in milliseconds) for the flashing caret. The default setting is zero, in which case the caret uses the system's default blink time.

Syntax

ctlname.CaretInterval = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTimeInput: CaretStyle

Description

The CaretStyle property sets or returns the shape of the caret. The valid settings for the CaretStyle property follow:

Setting	Description

0	(Default) Block.

1	Up arrow.

2	Down arrow.

Syntax

ctlname.CaretStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretColor, CaretInterval


MhTimeInput: CaretVAlign

Description

The CaretVAlign property specifies where the caret is displayed within the control. The valid settings for the CaretVAlign property follow:

Setting	Description

0	The caret is positioned over the text.

1	The caret is positioned below the text.

2	The caret is positioned above the text.

Syntax

ctlname.CaretVAlign = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTimeInput: CaretVisible

Description

The CaretVisible property indicates whether the caret is visible. The valid settings for the CaretVisible property follow:

Setting	Description

True (-1)	(Default) The caret is visible within the control.

False (0)	The caret is not visible within the control.

Syntax

ctlname.CaretVisible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretVAlign


MhTimeInput: CaretWidth

Description

The CaretWidth property sets or returns the width of the caret. The default setting is zero, in which case the caret is sized according to the system's border width.

Syntax

ctlname.CaretWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CaretHeight


MhTimeInput: Country

Description

The Country property specifies the language to use for the control. The valid settings for the Country property follow:

Setting	Description

0	Use Control Panel settings

1	Australia

2	Austria

3	Belgium (Dutch)

4	Belgium (French)

5	Brazil

6	Canada (English)

7	Canada (French)

8	Denmark

9	Finland

10	France

11	Germany

12	Iceland

13	Ireland

14	Italy

15	Mexico

16	Netherlands

17	New Zealand

18	Norway

19	Portugal

20	South Korea

21	Spain

22	Sweden

23	Switzerland (French)

24	Switzerland (German)

25	Switzerland (Italian)

26	Taiwan

27	United Kingdom

28	United States

29	User Defined

Syntax

ctlname.Country = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeFormat


MhTimeInput: FillColor

Description

The FillColor property sets or returns the control's background color.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTimeInput: FocusSelect

Description

The FocusSelect property indicates whether all the text in the control is selected when the control receives the focus. The valid settings for the FocusSelect property follow:

Syntax

ctlname.FocusSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTimeInput: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control. The valid settings for the FontStyle property follow:

Setting	Description

0	(Default) None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to 1 or 2 (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to 3 or 4 (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTimeInput: Indent

Description

The Indent property sets or returns the amount of space between characters in the control and the control’s border. The default is zero. The range is 0 to 32,767.

Syntax

ctlname.Indent = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeFormat


MhTimeInput: LightColor

Description

The LightColor property sets or returns the light color (as opposed to the shadow color) of the control. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor, TextColor


MhTimeInput: MaxHours

Description

The MaxHour property sets or returns the maximum hour that may be entered in the control. The default is 12. The range is 0 to 24.

Syntax

ctlname.MaxHour = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinHours


MhTimeInput: MaxMinutes

Description

The MaxMinutes property sets or returns the maximum minute value that may be entered in the control. The default is 59. The range is 0 to 59.

Syntax

ctlname.MaxMinutes = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinMinutes


MhTimeInput: MaxSeconds

Description

The MaxSeconds property sets or returns the maximum second value that may be entered in the control. The default is 59. The range is 0 to 59.

Syntax

ctlname.MaxSeconds = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MinSeconds


MhTimeInput: MinHours

Description

The MinHours property sets or returns the minimum hour value that may be entered in the control. The default is 0. The range is 0 to 24.

Syntax

ctlname.MinHours = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxHours


MhTimeInput: MinMinutes

Description

The MinMinutes property sets or returns the minimum minute value that may be entered in the control. The default is 0. The range is 0 to 59.

Syntax

ctlname.MinMinutes = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxMinutes


MhTimeInput: MinSeconds

Description

The MinSeconds property sets or returns the minimum second value that may be entered in the control. The default is 0. The range is 0 to 59.

Syntax

ctlname.MinSeconds = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MaxSeconds


MhTimeInput: ReadOnly

Description

The ReadOnly property indicates whether the contents of the control may be edited. The valid settings for the ReadOnly property follow:

Setting	Description

True (-1)	The control does not allow its contents to be edited.

False (0)	(Default) The control allows its contents to be edited.

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeFormat


MhTimeInput: Separator

Description

The Separator property specifies the character used to separate the hour, minute, and seconds values. When set to zero, the Control Panel settings are used.

Syntax

ctlname.Separator = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeFormat


MhTimeInput: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, TextColor


MhTimeInput: Spin

Description

The Spin property defines where the spin buttons (if any) are positioned within the control. The valid settings for the Spin property follow:

Setting	Description

0	(Default) The control does not display spin buttons.

1	The spin buttons are aligned to the left.

2	The spin buttons are aligned to the right.

Syntax

ctlname.Spin = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SpinChange, SpinDelay, SpinSpeed


MhTimeInput: SpinChange

Description

The SpinChange property specifies the amount to increment/decrement the value of the control when the spin buttons are used. The default value is one.

Syntax

ctlname.SpinChange = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinDelay, SpinSpeed


MhTimeInput: SpinDelay

Description

The SpinDelay property sets or returns the amount of time (in milliseconds) that occurs before the first repeat when using the spin buttons. The default value is 500 milliseconds. The delay that occurs between successive repeats is determined by the SpinSpeed property.

Syntax

ctlname.SpinDelay = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChange, SpinSpeed


MhTimeInput: SpinSpeed

Description

The SpinSpeed property sets or returns the amount of time (in milliseconds) that occurs between each repeat when using the spin buttons. The default value is 100 milliseconds. The initial delay before the first repeat is determined by the SpinDelay property.

Syntax

ctlname.SpinSpeed = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Spin, SpinChange, SpinDelay


MhTimeInput: TextColor

Description

The TextColor property sets or returns the foreground color of the caption. Three colors are used when creating the 3-D effect for the control border and text: LightColor, ShadowColor, and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTimeInput: TimeFormat

Description

The TimeFormat property specifies the entry format of the time. The valid settings for the TimeFormat property follow:

Setting	Description

0	h:mm:ss (12 hour time with no leading zero)

1	hh:mm:ss (12 hour time with leading zero)

2	H:mm:ss (24 hour time with no leading zero)

3	HH:mm:ss (24 hour time with leading zero)

Syntax

ctlname.TimeFormat = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeZone


MhTimeInput: TimeZone

Description

The TimeZone property returns the time adjusted for the specified time zone. If the current time zone is US, adjustments are not made for daylight savings time.

Syntax

ctlname.TimeZone = setting%

Data Type

Integer

Availability

Run-Time Read

See Also

TimeFormat


MhTimeInput: Undo

Description

The Undo property is a property used like a method to undo the last edit. Placing any value into the Undo property will cause the undo to occur.

Syntax

ctlname.Undo = setting%

Data Type

Integer

Availability

Run-Time Write


MhTimeInput: VAlignment

Description

The VAlignment property the method by which the contents of the control are positioned vertically within the control. The valid settings for the VAlignment property follow:

Setting	Description

0	Top

1	Bottom

2	Center

Syntax

ctlname.VAlignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Alignment


MhTimeInput: Verbose

Description

The Verbose property indicates whether the time text includes AM and PM. The valid settings for the Verbose property follow:

Setting	Description

True (-1)	AM and PM are included in the time text

False(0)	Time text does not include AM and PM

Syntax

ctlname.Verbose = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TimeFormat


MhTimeInput: AutoTerminate

Description

The AutoTerminate event occurs when a valid key is pressed while the caret is on the last character of the control. The AutoTerminate event lets you automatically SetFocus to another control when the user has filled the control with the desired number of characters.

Syntax

CtlName_AutoTerminate(KeyAscii As Integer)


MhTimeInput: InvalidEntry

Description

The InvalidEntry event occurs when the time within the control is outside the Maxxxx or Minxxx properties and the control loses the focus.

Syntax

Sub ctlname_InvalidEntry()


MhTimeInput: InvalidSetText

Description

The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The Cancel parameter determines whether the invalid text is accepted by the control. If you set Cancel to True, the invalid text is not accepted. If Cancel is False, and you do not change the InvalidText string yourself, the text is accepted regardless of any invalid characters.

The InvalidText parameter contains the invalid text string that is being set into the control. You can clean up or override the invalid text simply by setting the InvalidText string to the desired string. If you do not set Cancel to True, the control will receive the modified InvalidText string.

Syntax

Sub ctlname_InvalidSetText(Cancel As Integer, InvalidText As String)


MhTimeInput: Overview

The MhTimeInput control is an enhanced version of the VB text box control designed specifically for time input. MhTimeInput is ideal for data entry applications and other situations where you want to restrict user input to a certain range of times. MhTimeInput features the following:

-  Optional built-in spin buttons, with complete control over the position, increment/decrement values and repeat rate.

-  Optional horizontal scrolling when the text length exceeds the physical width of the control.

-  Horizontal and vertical alignment of the text.

-  Optional 3-D effects.

-  Complete control over the size, appearance and behavior of the caret.

-  The ability to define minimum and maximum times allowed by the control.

-  Custom events that occur when an invalid entry is made, or when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.

The following table provides an overview of the MhTimeInput control.

MhTimeInput Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhTInp16.OCX MhTInp32.OCX MHTINP.VBX	MhTimeInput	See the  MHTINP sample directory.		MhDateInput
Development Notes

The Minxxx and Maxxxx properties define the range of times that may be entered in the control.

The AutoHScroll property determines whether the text is scrolled horizontally when its length exceeds the physical width of the control. When AutoHScroll is False, the number of characters that can be entered in the text box is limited by the physical width of the control.

The Alignment and VAlignment properties allow you to align the text horizontally and vertically within the control.

The BevelSize and BevelStyle properties control the type and width of the 3-D effect. When BevelSize is zero, the control appears two-dimensional, regardless of the other property settings. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

The Caretxxx properties give you complete control over the size, appearance and behavior of the caret.

The Spin property determines where the spin buttons (if any) are positioned within the control, and the remaining Spinxxx properties allow you to set the increment/decrement value, and repeat rate.

The InvalidEntry event occurs when the time value within the control is outside the time range defined by the Maxxxx or Minxxx properties, and the control loses the focus. The InvalidSetText event occurs when an invalid text string is set into the control. This includes setting the Text property, SelText property, the Windows SendMessage call (with WM_SETTEXT), data retrieved from a database, a DDE link, or a paste from the clipboard.


MhTree: AddItemColumn

Description

The AddItemColumn property sets or returns the column number that will be affected by the next use of the AddItem method. Since the AddItem method uses only line numbers, you must set the AddItemColumn property before using AddItem. The following example adds a new item at row 4, column 2:

MhTree1.AddItemColumn = 2

MhTree1.AddItem "Test", 4

Syntax

ctlname.AddItemColumn = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTree: BevelSizeInner

Description

The BevelSizeInner property sets or returns the size (in pixels) of the bevel or border around the inside edge of the control. The default value is zero, which means that no border is drawn around the edge of the control. The valid range is zero to 32,767.

You can modify the 3-D appearance of the control by setting the BevelSizeInner property to a value greater than zero and trying different BevelStyleInner settings. Varying these values, along with the BevelStyle and BevelStyleInner properties, allows you to enhance the 3-D appearance of a control.

Syntax

ctlname.BevelSizeInner = integer%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelStyleInner


MhTree: BevelStyleInner

Description

The BevelStyleInner property sets or returns the type of bevel used for the border around the inside edge of the control. If the BevelSizeInner property is zero, the BevelStyleInner property is ignored and no bevel is drawn around the inside of the control. The valid settings for the BevelStyleInner property follow:

Setting	Description

0	(Default) Lowered

1	Raised

The 3-D effect is accomplished by drawing the bevel around the inside edge of the control with the colors specified in the LightColor and ShadowColor properties. Varying the settings of the BevelStyle and BevelStyleInner properties, along with size of the bevels, allows you to create different 3-D effects for your controls.

Syntax

ctlname.BevelStyleInner = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BevelSizeInner


MhTree: BitmapTransparent

Description

The BitmapTransparent property determines how bitmaps are displayed when using the 3-D background effects. The valid settings for the BitmapTransparent property follow:

Setting	Description

True (-1)	(Default) All pixels that are set to the transparent color are transparent.

False (0)	All bitmaps are displayed normally.

Syntax

ctlname.BitmapTransparent = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListPicture, ListPictureSel


MhTree: BorderColor

Description

The BorderColor property sets or returns the border color.

Syntax

ctlname.BorderColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


MhTree: ClearBox

Description

The ClearBox property clears specific information from a control. Any time you set this property, regardless of the value, the list box is cleared.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Run-Time Write


MhTree: ClearTags

Description

The ClearTags property clears all the list box items that are selected (that have ListTagged properties set to True). Any time you set this property, regardless of the value, the selected items are cleared.

Syntax

ctlname.ClearTags = setting%

Data Type

Integer

Availability

Run-Time Write

See Also

ListTagged


MhTree: ColBackColor

Description

The ColBackColor property sets or returns the background color of the column specified by the Column property.

Syntax

ctlname.ColBackColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColForeColor


MhTree: ColFontIndex

Description

The ColFontIndex property indicates which element in the custom font array is used for the level specified by the Column property. The font you specify must be configured before you assign its value by setting the FontxxxArr properties for this array element. Note that the value is not a font handle. The range is 0 to Fonts. If set to zero, the control's font is used.

The following example tells the control to use custom font number 1 for column zero:

MhTree1.Column = 0

MhTree1.ColFontIndex = 1

Syntax

ctlname.ColFontIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Column, Fonts


MhTree: ColForeColor

Description

The ColForeColor property sets or returns the foreground color of the column specified by the Column property. The default value is the value of the control's ForeColor property.

Syntax

ctlname.ColForeColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ColBackColor


MhTree: ColHighColor

Description

The ColHighColor property sets or returns the color used to highlight information in the column specified by the Column property.

Syntax

ctlname.ColHighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Column


MhTree: ColPicture

Description

The ColPicture property sets or returns the element number of a picture in the LoadedPicture array that is displayed when an item appears in the column specified by the Column property and that item is not selected. The valid settings for the ColPicture property follow:

Setting	Description

Zero	(Default) Indicates there is no picture associated with this column.

Non-zero	A picture. This can be set using LoadPicture, by referencing one of the pictures in the LoadedPicture array, or by using the Picture property of a Picture Box control.

Syntax

ctlname.ColPicture = element%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

ColPictureSel, Column


MhTree: ColPictureSel

Description

The ColPictureSel property sets or returns the element number of a picture in the LoadedPicture array that is displayed when an item appears in the column specified by the Column property and that item is selected. The valid settings for the ColPictureSel property follow:

Setting	Description

Zero	(Default) Indicates there is no picture associated with this column.

Non-zero	A picture. This can be set using LoadPicture, by referencing one of the pictures in the LoadedPicture array, or by using the Picture property of a Picture Box control.

Syntax

ctlname.ColPicture = element%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

ColPicture, Column


MhTree: ColTitle

Description

The ColTitle property sets or returns the title for the column specified by the Column property.

Syntax

ctlname.ColTitle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Column


MhTree: Column

Description

The Column property sets or returns the current column affected by the Colxxx properties. The default value is zero. The range is zero to Columns.

Syntax

ctlname.Column = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Columns


MhTree: Columns

Description

The Columns property sets or returns the maximum number of columns the control can display. The columns are numbered from zero to Columns - 1. The default value is 32.

Syntax

setting% = [form.]ctlname.Columns

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Column


MhTree: ColWidth

Description

The ColWidth property sets or returns the width of the column specified in Column. The value of the ColumnWidth property is expressed in characters. The columns are separated by embedded tabs within the text of a list item. The columns are numbered from zero to 30. Note that when FileList is True, the control automatically maintains this property.

Note: Changing the ColumnWidth of a column affects the ColumnLeft property of columns to the right. In other words, if ColumnLeft(x) is 10 and ColumnWidth(x) is 10 (thus spanning pixels 10 through 19), changing ColumnWidth(x) to 5 causes ColumnLeft(x+1) to be decreased by five.

Syntax

ctlname.ColumnWidth(column%) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

Column


MhTree: Connect

Description

The Connect property indicates whether lines will be drawn in the tree to depict the tree structure. The valid settings for the Connect property follow:

Setting	Description

True (-1)	(Default) Lines will be drawn to show the tree structure.

False (0)	No lines will be drawn.

Syntax

ctlname.Connect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LineColor, LineWidth


MhTree: ControlBox

Description

The ControlBox property indicates whether a control box is available on the control. You must set both the MDI and ControlBox properties to True for the control to display a control box. The valid settings for the ControlBox property follow:

Setting	Description

True (-1)	The control box is displayed.

False (0)	(Default) The control box is not displayed.

Syntax

ctlname.ControlBox = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MDI


MhTree: DefaultPics

Description

The DefaultPics property indicates whether the control automatically loads 14 default pictures into the LoadedPicture array. The valid settings for the DefaultPics property follow:

Setting	Description

True (-1)	The control automatically loads 14 default pictures into the LoadedPicture array. Thepictures are similar to those used by the File Manager program and are particularly useful when using this control as a file/directory tree.

False (0)	No default pictures are automatically loaded in the LoadedPicture array.

Syntax

ctlname.DefaultPics = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LoadedPicture


MhTree: Dir

Description

The Dir property indicates whether the control includes directory entries in the list. This property only affects the control when FileList is set to True. The valid settings for the Dir property follow:

Setting	Description

True (-1)	(Default) The tree includes directory entries in the list.

False (0)	Directory entries are excluded from the list.

Syntax

ctlname.Dir = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileList


MhTree: DividerStyle

Description

The DividerStyle property sets or returns the type of divider used between items and columns in the list. The valid settings for the DividerStyle property follow:

Setting	Description

0	(Default) None

1	Single (Border Color)

2	Single (Shadow Color)

3	Lowered

4	Raised

Both the vertical (column lines) and horizontal (item lines) are affected by this setting. Only settings three and four have a 3-D effect with the dividing lines drawn using both ShadowColor and LightColor.

Syntax

ctlname.DividerStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTree: DrawItemLeft

Description

The DrawItemLeft property specifies the amount of space reserved for a user-drawn item. This value is specified in the units of the container.

Syntax

ctlname.DrawItemLeft = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DrawItem, FireDrawItem


MhTree: Expand

Description

The Expand property sets the rightmost column that will be automatically displayed by the control. If you want all the columns to be displayed, set the Expand property to Columns - 1. The first column is column number zero.

Syntax

ctlname.Expand = setting%

Data Type

Integer

Availability

Run-Time Write

See Also

Columns


MhTree: ExtendedSelect

Description

The ExtendedSelect property indicates whether the mouse can be used for extended selection. The term extended selection refers to the way multiple items can be selected in a list.

The ExtendedSelect property allows the selection of multiple contiguous items when using the <Shift> key and multiple items that are not contiguous when using the <Ctrl> key. The SingleSelect property allows the user to select multiple items, whether or not they are contiguous. If you set this property to True, the SingleSelect property is automatically set to False.  The valid settings for the ExtendedSelect property follow:

Setting	Description

True (-1)	Allows use of the mouse for extended selection.

False (0)	(Default) Does not allow extended selection.

Syntax

ctlname.ExtendedSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SingleSelect


MhTree: FileList

Description

The FileList property indicates whether the control is automatically loaded with the contents of the disk directory specified by the Path property. The valid settings for the FileList property follow:

Setting	Description

True (-1)	Directory information is automatically loaded into the control.

False (0)	Directory information is not automatically loaded into the control.

The directory information is loaded only when the FileList property is set to True from code. The Archive, Hidden, Normal, ReadOnly, and System properties determine which directory entries are loaded into the list.

There is a lot of overhead involved in reading the directories. Consequently, this property is available only at run time, and the drive is read only when this property is set to True from code.

Syntax

ctlname.FileList = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


MhTree: FillColor

Description

The FillColor property sets or returns the color used to fill the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BorderColor


MhTree: FireDrawItem

Description

The FireDrawItem property indicates whether the DrawItem event should be fired.

Syntax

ctlname.FireDrawItem = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DrawItem, DrawItemLeft


MhTree: FontBoldArr

Description

The FontBoldArr property sets or returns the bold attribute of the custom font associated with the specified element number. The valid settings for the FontBoldArr property follow:

Setting	Description

True (-1)	Turns on the bold attribute for the custom font.

False (0)	Turns off the bold attribute for the custom font.

Syntax

ctlname.FontBoldArr(element%) = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

FontItalicArr, FontStikeThruArr, FontUnderlineArr


MhTree: FontItalicArr

Description

The FontItalicArr property sets or returns the italic attribute of the custom font associated with the specified element number. The valid settings for the FontItalicArr property follow:

Setting	Description

True (-1)	Turns on the italic attribute for the custom font.

False (0)	Turns off the italic attribute for the custom font.

Syntax

ctlname.FontItalicArr(element%) = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

FontBoldArr, FontStikeThruArr, FontUnderlineArr


MhTree: FontNameArr

Description

The FontNameArr property sets or returns the font name of the specified custom font. The default value is the control's FontName value.

Syntax

ctlname.FontNameArr(element%) = string$

Data Type

String Array

Availability

Run-Time Read

Run-Time Write

See Also

FontSizeArr


MhTree: Fonts

Description

The Fonts property sets or returns the number of custom fonts used in the control. If you don't specify any custom fonts, all cells default to the control's font properties. If your control can benefit from additional fonts, setting this property dimensions an array of fonts that you can customize. The default value is zero. The range is zero to 1,000.

Syntax

ctlname.Fonts = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FontNameArr, FontSizeArr


MhTree: FontSizeArr

Description

The FontSizeArr property sets or returns the font size for the specified custom font. The default value is the control's FontSize value.

Syntax

ctlname.FontSizeArr(element%) = single!

Data Type

Single Precision Array

Availability

Run-Time Read

Run-Time Write

See Also

FontNameArr


MhTree: FontStrikeThruArr

Description

The FontStrikeThruArr property sets or returns the strikethrough attribute of the custom font associated with the specified element number. The valid settings for the FontStrikeThru property follow:

Setting	Description

True (-1)	Turns on the strikethrough attribute for the custom font.

False (0)	Turns off the strikethrough attribute for the custom font.

Syntax

ctlname.FontStrikeThroughArr(element%) = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

FontBoldArr, FontItalicArr, FontUnderlineArr


MhTree: FontStyle

Description

The FontStyle property sets or returns the 3-D effect of the text or caption that is printed on the control.

Setting	Description

0	None.

1	Raised (the text appears raised off the control).

2	Raised with more shading.

3	Lowered (the text appears inset into the control).

4	Lowered with more shading.

The 3-D effect is accomplished by outlining the text with the colors specified in the LightColor and ShadowColor properties. When FontStyle is set to one or two (raised), the outline around the top and left sides of the text are drawn with the LightColor value and the right and lower portions with the ShadowColor value. When FontStyle is set to three or four (lowered), the outline colors are reversed.

Syntax

ctlname.FontStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTree: FontUnderlineArr

Description

The FontUnderlineArr property sets or returns the underline attribute of the custom font associated with the specified element number. The valid settings for the FontUnderlineArr property follow:

Setting	Description

True (-1)	Turns on the underline attribute for the custom font.

False (0)	Turns off the underline attribute for the custom font.

Syntax

ctlname.FontUnderlineArr(element%) = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write

See Also

FontBoldArr, FontItalicArr, FontStikeThruArr


MhTree: Group

Description

The Group property sets or returns the current group affected by the Groupxxx properties. Think of the Group property as the element number of the Groupxxx arrays. The Groupxxx properties are set automatically FileList is set to True. The range for Group is zero to Groups - 1.

Syntax

ctlname.Group = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Groups


MhTree: GroupBackColor

Description

The GroupBackColor property sets or returns the color of the background for the group specified by the Group property.

Syntax

ctlname.GroupBackColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GroupForeColor


MhTree: GroupConnect

Description

The GroupConnect property indicates whether the horizontal lines for the group specified by Group are connected to items belonging to that group. This property is set automatically when FleList is set to True. The valid settings for the GroupConnect property follow:

Setting	Description

True (-1)	(Default) Connects the horizontal and vertical lines that outline the tree structure.

False (0)	Leaves the horizontal and vertical lines that outline the tree structure unconnected.

Syntax

ctlname.GroupConnect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListConnect


MhTree: GroupFontIndex

Description

The GroupFontIndex property sets or returns the Fontxxx array element number to be used for the group specified by Group. The font which you assign to the GroupFontIndex property should be configured before you assign it to the GroupFontIndex property. To configure the font, set the FontxxxArr properties for the array element.

Syntax

ctlname.GroupFontIndex = fontelementnumber%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Group


MhTree: GroupForeColor

Description

The GroupForeColor property sets or returns the color of the background for the group specified by the Group property.

Syntax

ctlname.GroupForeColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GroupBackColor


MhTree: GroupHighColor

Description

The GroupHighColor property sets or returns the color of highlighted information for the group specified by Group.

Syntax

ctlname.GroupHighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Group


MhTree: GroupPicture

Description

The GroupPicture property sets or returns the picture displayed for an item whose group is specified by Group when the item is not selected. You may assign the GroupPicture pictures from the LoadedPicture array. The usage is the same as the VB standard Picture property.

Syntax

ctlname.GroupPicture = picture

Data Type

Picture

Availability

Run-Time Read

Run-Time Write

See Also

GroupPictureSel


MhTree: GroupPictureSel

Description

The GroupPictureSel property sets or returns the picture displayed for an item whose group is specified by Group when the item isselected. You may assign the GroupPictureSel pictures from the LoadedPicture array. The usage is the same as the VB standard Picture property.

Syntax

ctlname.GroupPictureSel = picture

Data Type

Picture

Availability

Run-Time Read

Run-Time Write

See Also

GroupPicture


MhTree: Groups

Description

The Groups property sets or returns the number of user-defined groups. The default value is 2. The range is zero to 1,000. When the FileList property is set to True, this property is set to 2.

Syntax

ctlname.Groups = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileList


MhTree: HighColor

Description

The HighColor property sets or returns the foreground color used to display selected items or text.

Syntax

ctlname.HighColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SelectedColor


MhTree: IconHeight

Description

The IconHeight property set or returns the height in twips or pixels (depending on the ScaleMode property) of all pictures in the control. If set to a positive value, the IconHeight property affects all pictures in the control. If set to zero (the default), the pictures are drawn their actual height. When the FileList property is set to True, this property is set to 16 pixels.

Syntax

ctlname.IconHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IconWidth


MhTree: IconWidth

Description

The IconWidth property set or returns the width in twips or pixels (depending on the ScaleMode property) of all pictures in the control. If set to a positive value, the IconWidth property affects all pictures in the control. If set to zero (the default), the pictures are drawn their actual width. When the FileList property is set to True, this property is set to 16 pixels.

Syntax

ctlname.IconWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IconHeight


MhTree: LightColor

Description

The LightColor property sets or returns the light color, as opposed to the shadow color, of the control.

Syntax

ctlname.LightColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ShadowColor


MhTree: LineColor

Description

The LineColor property sets or returns the color of the lines used to draw the tree.

Syntax

ctlname.LineColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LineWidth


MhTree: LineWidth

Description

The LineWidth property sets or returns the width in twips or pixels (depending on the ScaleMode property) of the lines used to draw the tree. The default value is 1 pixel. The range is zero to 32,767.

Syntax

ctlname.LineWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LineColor


MhTree: List

Description

The List property sets or returns the text associated with the specified line. The default value of a List element is a null string.

Syntax

ctlname.List(linenumber%) = string$

Data Type

String Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListTagged


MhTree: ListAlignment

Description

The ListAlignment property sets or returns the alignment of the specified line. The valid settings for the ListAlignment property follow:

Setting	Description

0	(Default) Left aligned.

1	Right aligned.

2	Centered.

The ListAlignment property can only be used when the ListMultiLine property is True for the specified item. The alignment is relative to the longest line for the specified item - not the actual box containing the tree display.

Syntax

ctlname.ListAlignment(linenumber%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListBackColor

Description

The ListBackColor property sets or returns the background color of the specified line.

Syntax

ctlname.ListBackColor(linenumber%) = colorvalue&

Data Type

Long Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListForeColor


MhTree: ListColumn

Description

The ListColumn property sets or returns the column, or level, associated with the specified line. The default value is zero. Note that this property, along with the order of the list, determines the structure of the tree.

Syntax

ctlname.ListColumn(linenumber%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListConnect

Description

The ListConnect property indicates whether the vertical and horizontal lines are connected for the specified line. The valid settings for the ListConnect property follow:

Setting	Description

0	(Default) Use the value of the GroupConnect property.

1	Connect the vertical and horizontal lines, regardless of the setting of the GroupConnect property.

2	Don't connect the vertical and horizontal lines, regardless of the setting of the GroupConnect property.

Syntax

ctlname.ListConnect(linenumber%) = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GroupConnect


MhTree: ListCount

Description

The ListCount property sets or returns the number of items allowed in the list. You can think of this as redimensioning an array to hold a specific number of entries. The default value is 1000. MhTree defines the purpose of the ListCount property differently than the standard ListCount property. The standard ListCount property is read-only and returns the number of items in a list box. In the MhTree control, the ListCount property dimensions the number of list items. Additionally, it can be modified at any time, but preserves the current List information when it is set to a larger value (all contents are lost if you set it to a smaller value).

Syntax

ctlname.ListCount = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListExpand

Description

The ListExpand property sets or returns the current expansion state for the specified item in the list. Setting this property while the item is not visible will result in user-defined error number 32002 (cannot expand unless visible). You should check the ListVisible property for this list item before attempting to set the ListExpand property. The valid settings for the ListExpand property follows:

Setting	Description

True (-1)	The list item is expanded.

False (0)	The list item is not expanded.

Syntax

ctlname.ListExpand(indexnumber%) = boolean%

Data Type

Integer Array (Boolean)

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListFontIndex

Description

The ListFontIndex property sets or returns the element number in the Fonts array corresponding to the font you want to use for the specified line. The default value is zero. You must configure the font (by setting the FontxxxArr properties) for a line before assigning its index number to the ListFontIndex property.

Syntax

ctlname.ListFontIndex(linenumber%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Fonts


MhTree: ListForeColor

Description

The ListForeColor property sets or returns the foreground color of the specified line.

Syntax

ctlname.ListForeColor(linenumber%) = colorvalue&

Data Type

Long Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListBackColor


MhTree: ListGroup

Description

The ListGroup property sets or returns the group associated with the specified line. The default value is zero. Members of a group share attributes set by the Groupxxx properties. If the FileList property is True, the groups are directory (group zero) and file (group one), and are read-only. For user-defined data, you may define any custom groups you choose. The range for the ListGroup property is zero to Groups - 1.

Syntax

ctlname.ListGroup(linenumber%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FileList, Groups


MhTree: ListHasChildren

Description

The ListHasChildren property indicates whether the specified item has any children. True is returned when the item has children.

Syntax

boolean% = ctlname.ListHasChildren(linenumber%)

Data Type

Boolean Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListTagged


MhTree: ListHighColor

Description

The ListHighColor property sets or returns the color used to highlight information on the specified line.

Syntax

ctlname.ListHighColor(linenumber%) = colorvalue&

Data Type

Long Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ListBackColor, ListForeColor


MhTree: ListLineHeight

Description

The ListLineHeight property sets or returns the height in twips or pixels (depending on the ScaleMode property) of the specified line. Unless you set this property, the line height is automatically based on the size of the font.

Syntax

ctlname.ListLineHeight(linenumber%) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScaleMode


MhTree: ListMultiLine

Description

The ListMultiLine property indicates whether the text in a cell may extend over more than one line. The valid settings for the ListMultiLine property follow:

Setting	Description

True (-1)	Alerts the control to parse the string composing the item and check for CHR(10). The only way to get a multiline item entry is to explicitly insert a CHR(10) into the string. If a string contains a CHR(10) and ListMultiLine is False, the CHR(10) appears as a black box in the string.

False (0)	(Default) The text in the cell is truncated if wider than the column width.

Syntax

ctlname.ListMultiLine(linenumber%) = boolean%

Data Type

Integer Array (Boolean)

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListPath

Description

The ListPath property returns the full path of the specified item in the list. The ListPath property can return the full path of any line in the list, regardless of whether the list is expanded or collapsed. Each item in the returned string is separated by the \ character, as in Level1\Level3\Item3.

Syntax

string$ = [form.]ctlname.ListPath(linenumber%)

Data Type

String

Availability

Run-Time Read

See Also

List


MhTree: ListPicture

Description

The ListPicture property sets or returns the picture that will be displayed when the specified line is not selected. You may assign the ListPicture picture from the LoadedPicture array. The usage is the same as the VB standard Picture property.

Syntax

ctlname.ListPicture(linenumber%) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

ListPictureSel


MhTree: ListPictureSel

Description

The ListPictureSel property sets or returns the picture that will be displayed when the specified line is selected. You can assign the ListPicture picture from the LoadedPicture array. The usage is the same as the VB standard Picture property.

Syntax

ctlname.ListPictureSel(linenumber%) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

ListPicture


MhTree: ListTagged

Description

The ListTagged property sets or returns a value that indicates whether the specified line is tagged (selected). The valid settings for the ListTagged property follow:

Setting	Description

True (-1)	The line is selected.

False (0)	(Default) The line is not selected.

Note that this property specifies a list member whether or not the item actually exists in the current list.

Syntax

ctlname.ListTagged(linenumber%) = boolean%

Data Type

Integer  Array (Boolean)

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

List


MhTree: ListVisible

Description

The ListVisible property indicates whether or not an item in the list is currently visible. The valid settings for the ListVisible property follow:

Setting	Description

True (-1)	The list item is currently visible.

False (0)	The list item is not currently visible.

Syntax

boolean% = [form.]ctlname.ListVisible(indexnumber%)

Data Type

Integer Array (Boolean)

Availability

Design-Time

Run-Time Read

See Also

List


MhTree: LoadedPicture

Description

The LoadedPicture property is an integer array containing a number of Picture properties. Images can be loaded into this array before being displayed in the control. Since images are usually repeated throughout the control, the array can be filled with pictures to minimize resource usage.

You can load this array by either using LoadPicture or placing the Picture property of a Picture Box control into the array:

MhControl.LoadedPicture(0) = LoadPicture("SomeBmp.Bmp")

MhControl.LoadedPicture(1) = Picture1.Picture

You can load the LoadedPicture array with picture handles at any time. Note that the DefaultPics property loads 14 default pictures into this array when set to True.

Syntax

ctlname.LoadedPicture(element%) = picture

Data Type

Picture Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

DefaultPics


MhTree: MDI

Description

The MDI property indicates whether the control displays a caption, has MDI properties, and can be resized by the user at run time. If the MDI property is False, the control does not display the Control Box, the Minimize Button, or the Maximize Button, even if the associated properties are True. The valid settings for the MDI property follow:

Setting	Description

True (-1)	The control has MDI characteristics.

False (0)	(Default) The control does not have MDI characteristics.

Syntax

ctlname.MDI = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTree: NoFocusRect

Description

The NoFocusRect property indicates whether a focus rectangle is drawn around an item. The valid settings for the NoFocusRect property follow:

Setting	Description

True	A focus rectangle is drawn.

False	No focus rectangle is drawn.

Syntax

ctlname.NoFocusRect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


MhTree: Pictures

Description

The Pictures property sets the total number of pictures available in the LoadedPicture array. The default value is zero. Normally, bitmaps are repeated throughout the MhTree control. To minimize the amount of memory required to display the pictures, MhTree loads all of the bitmaps into the LoadedPicture array, rather than loading multiple copies of the bitmaps. The control then refers to the pictures by their handles.

Syntax

ctlname.Pictures = setting%

Data Type

Integer

Availability

Design-Time

See Also

LoadedPicture


MhTree: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

IconHeight, IconWidth


MhTree: ScreenUpdate

Description

The ScreenUpdate property indicates whether the screen is updated when the contents of the control are changed. This property is ideal for situations where you want to fill a control with data and then display all the contents at once. Note that setting the property to True does not cause an immediate refresh; however, the Refresh method can be used to cause the display to update. The valid settings for the ScreenUpdate property follow:

Setting	Description

True (-1)	(Default) The screen is updated with every change to the contents of the control.

False (0)	Changes to the contents of the control are not visible on the screen.

Syntax

ctlname.ScreenUpdate = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


MhTree: SelectedColor

Description

The SelectedColor property sets or returns the color used to indicate selected items in the list.

Syntax

ctlname.SelectedColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HighColor, SelectedCount


MhTree: SelectedCount

Description

The SelectedCount property returns the number of items that are currently selected (the number of elements that have their ListTagged array value set to True). The range is zero to ListCount.

Syntax

value% = ctlname.SelectedCount

Data Type

Integer

Availability

Run-Time Read

See Also

ListCount, ListTagged


MhTree: ShadowColor

Description

The ShadowColor property sets or returns the color used for shadows. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.ShadowColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor


MhTree: SingleSelect

Description

The SingleSelect property indicates whether the control can be used to select multiple, non-contiguous items. Setting SingleSelect to False allows the user to select multiple items, whether or not they are contiguous. The ExtendedSelect property allows the selection of multiple contiguous items. If you set this property to True, the ExtendedSelect property is automatically set to False. The valid settings for the SingleSelect property follow:

Setting	Description

True (-1)	Restricts the user to selecting one item.

False (0)	(Default) Allows the user to select multiple, non-contiguous items.

Syntax

ctlname.SingleSelect = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ExtendedSelect


MhTree: Sizeable

Description

The Sizeable property indicates whether the control can be sized by the user at run time. This property is only only when the MDI property is True. The valid settings for the MDI property follow:

Setting	Description

True (-1)	The control can be resized at run time.

False (0)	(Default) The size of the control is determined at design time.

Syntax

ctlname.Sizeable = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MDI


MhTree: TextColor

Description

The TextColor property sets or returns the color used to draw all text displayed in the control. There are three colors used when creating the 3-D effect for the control border and text: LightColor, ShadowColor and TextColor.

Syntax

ctlname.TextColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LightColor, ShadowColor


MhTree: TextExtent

Description

The TextExtent property sets or returns the horizontal extent of the text in the control.

Syntax

ctlname.TextExtent = value&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextColor


MhTree: TitleBold

Description

The TitleBold property indicates whether the column titles of the control are displayed in bold type. The valid settings for the TitleBold property follow:

Setting	Description

True (-1)	Display the titles in bold type.

False (0)	(Default) Don't display the titles in bold type.

Syntax

ctlname.TitleBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TitleHeight


MhTree: TitleHeight

Description

The TitleHeight property sets or returns the height in twips or pixels (depending on the ScaleMode property of the title portion of the control. The default value is zero, which effectively turns off the title display. The range is zero to 32,767.

Syntax

ctlname.TitleHeight = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScaleMode, TitleBold


MhTree: TransparentColor

Description

The TransparentColor property sets or returns the color in a bitmap that is transparent when displayed.

Syntax

ctlname.TransparentColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

FillColor


MhTree: TopIndex

Description

The TopIndex property sets or returns the index number of the element that appears at the top of the selection window. When you set the value of the TopIndex property, the control redisplays the contents of the list box with the specified element at the top of the list box. The first element of the list box is number zero and the last item is ListCount - 1.

Syntax

ctlname.TopIndex = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

ListCount


MhTree: BeginLoadWait

Description

The BeginLoadWait event occurs when the control starts loading data. This event can be used to display a dialog.

Syntax

Sub ctlname_BeginLoadWait()


MhTree: Close

Description

The Close event occurs when the Close option is selected from the control box menu. This event occurs only when MDI is True and ControlBox is True.

Syntax

Sub ctlname_Close()


MhTree: DrawItem

Description

The DrawItem event occurs each time the control finishes drawing an item in the list. This event will only fire if the FireDrawItem property is set to True.

The parameters provided by the event are as follows:

Parameter	Description

itemIndex	The index number of the item in the list.

itemState	The state of the item is specified by a combination of the following values:

     0	Item not selected

     1	Item is selected

     2	Item is grayed.

     4	Item is to be drawn disabled.

     16	Item has focus.

itemhDC	The handle to the device context of the list.

ItemLeft	The left coordinate of the list item.

ItemTop	The top coordinate of the list item.

ItemRight	The right coordinate of the list item.

ItemBottom	The bottom coordinate of the list item.

Syntax

Sub ctlname_DrawItem (itemIndex As Integer, itemState As Integer, itemhDC As Integer, itemLeft As Integer, itemTop As Integer, itemRight As Integer, itemBottom As Integer)

See Also

DrawItemLeft, FireDrawItem


MhTree: EndLoadWait

Description

The EndLoadWait event occurs when the control finishes loading data.

Syntax

Sub ctlname_EndLoadWait()


MhTree: ExpandChange

Description

The ExpandChange event occurs when the user attempts to expand or collapse the list.

Cancel determines if the expand/collapse request is accepted or ignored. If you set Cancel to a non-zero value, the list is not expanded or collapsed. If Cancel is zero, the list is expanded or collapsed.

Syntax

Sub ctlname_ExpandChange(Cancel As Integer)


MhTree: Move

Description

The Move event occurs when the control is moved (by dragging it with the mouse or moving it via the control box menu). This event can occur only when MDI is True and ControlBox is True.

Syntax

Sub ctlname_Move()


MhTree: Resize

Description

The Resize event occurs when the control is resized (with the mouse or via the control box menu). This event can occur only when MDI is True and Sizeable is True.

Syntax

Sub ctlname_Resize()


MhTree: TopIndexChange

Description

The TopIndexChange event occurs when the element number that is displayed at the top of the control changes. You can use this event to trigger any processing that may be required whenever the item at the top of the control changes. One use would be to synchronize two controls that display similar information. When the TopIndexChange event occurs for one of the controls, retrieve the new TopIndex value and set the other control to the same position. Use the TopIndex property to determine the new element number that is displayed at the top of the control.

Syntax

Sub ctlname_TopIndexChange()


MhTree: Overview

The MhTree control lets you display information in a collapsible/expandable tree. The following figure shows an example of an MhTree control. The following table provides an overview of the MhTree control.

An Example of an MhTree Control.

MhTree Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhTree16.OCX MhTree32.OCX MHTR200.VBX	MhTree	See the MHTREE sample directory.		MhFileList
Development Notes

The MhTree custom control is an enhanced version of the standard VB List box control that lets you display multiple columns of hierarchical information. You can choose to maintain the contents of the control yourself or set the FileList property to True. When FileList is True, MhTree displays the names of the files and directories from the path specified by the Path property.

Note:  The FileList property must be set to True while in run mode for the list box to display directory information.

The previous figure shows an MhTree control with several of its features highlighted. These features are discussed in detail in the following paragraphs.

The LoadedPicture property array is provided as a convenience to reduce resource consumption by the control. The idea is that you place only a single copy of all the possible bitmaps used by the control into this array and then use the appropriate picture from this array wherever you need it.

Pictures can be placed into the LoadedPicture() array using the LoadPicture function or by placing the Picture property of a picture box into the array. To place a picture into an item , you can either specify one of the pictures in the LoadedPicture() array or use the Picture property of a picture box.

Once you load the pictures, you can specify different pictures for MhTree to display for columns, groups, and individual lines with the ColPicture, ColPictureSel, GroupPicture, GroupPictureSel, ListPicture and ListPictureSel properties. (The Sel suffix refers to the picture MhTree displays when you select the line. The properties without the Sel suffix specify the picture MhTree displays when the line is not selected.)

The MhTree control uses four sets of property arrays to specify the appearance of the items in the control: Groupxxx, Listxxx, FontxxxArr, and Colxxx,.

The Colxxx properties define the characteristics of items displayed in a particular column, or level. These properties override default settings. The Column property specifies the element number of the column arrays you set when you set any of the Colxxx properties. The number of columns in a control is determined by the Columns property.

The Groupxxx properties define the characteristics of items belonging to a particular group you define. These properties override the default and column settings. You group items by setting the ListGroup property for a specific item. Items with the same ListGroup setting can be thought of as being in the same group and share the same custom property values, if they are set. The group values are stored in arrays prefixed by Group. The Group property specifies the element number of the array you set when you set any of the Groupxxx properties. The number of groups in a control is determined by the Groups property.

The Listxxx properties define the characteristics of a particular line item. These properties override the default Colxxx and Groupxxx settings and  are not available at design time.

You can use the FontxxxArr properties to set fonts for columns, groups, and individual list items. The following FontxxxArr properties correspond to the normal font properties, but set the fonts in your custom font array (Note that this array is dimensioned with the Fonts property. You should DIM this array to the number of custom fonts that you require in your control):

FontNameArr	FontSizeArr	FontBoldArr

FontItalicArr	FontUnderLineArr	FontStrikeThruArr

The custom fonts work in a fashion similar to the LoadedPicture array:

1)	DIM a font array by setting the Fonts property. Then create that number of custom fonts, using the font properties set in the properties bar.

2)	You can customize this list of fonts using the FontxxxArr properties.

3)	Assign the fonts to columns, groups, or lines by assigning a value to the ColFontIndex, GroupFontIndex, or LineFontIndex property. For example, the following lines tell the control to create two custom fonts, turn on the bold attribute for the first custom font and turn on the italic attribute for the second custom font.  The code then tells the control to use custom font number one for column zero.

MhTree1.Fonts = 2

MhTree1.FontBoldArr(1) = -1

MhTree1.FontItalicArr(2) = -1

MhTree1.ColFontIndex(0) = 1

This process allows you to create as many different fonts as your control may need, while at the same time conserving resources.

The Bevelxxx properties can be used to create 3-D effects. The 3-D effect is created by contrasting the LightColor and ShadowColor against the BackColor of the control's parent. While a combination of gray and white is most common, you can use any color to obtain a similar 3-D effect, as long as the ShadowColor is a darker shade of the parent's BackColor.

The FontStyle property determines the 3-D effect of the text displayed in the control, and includes a variety of lowered and raised styles.

Caution:  Font handles are a resource and consume resource space. This is the reason that we do not create a font for each line. Therefore, you should not set the Fonts property any higher than what is required for your control.

You can modify the appearance of the line MhTree uses to draw the tree outline of the list items with the Linexxx properties.

While you can use the MhTree control to display a directory tree, you may want to place your own information into the control. To do so, you assign values to the List array property. For example, to assign a series of names to an MhTree control execute the following instructions:

MhTree1.List(0) = "Company"

MhTree1.List(1) = "Accounting"

MhTree1.List(2) = "Lucy"

MhTree1.List(3) = "Ethel"

MhTree1.List(4) = "Marketing"

MhTree1.List(5) = "Fred"

The element numbers stand for the number of the line in the control, just like in a standard VB list box.

If you want your list to display a hierarchy, set the ListColumn array property for each line to the proper level.

To assign the names above to different levels, you can execute these instructions:

MhTree1.ListColumn(0) = 0

MhTree1.ListColumn(1) = 1

MhTree1.ListColumn(2) = 2

MhTree1.ListColumn(3) = 2

MhTree1.ListColumn(4) = 1

MhTree1.ListColumn(5) = 2

To prevent the control from blinking as you update it, set the ScreenUpdate property to False. After you complete the changes to the control, set ScreenUpdate to True. Additionally, you can use the TopIndex property to specify the line you want to appear at the top of the list.

Assign a value to the Expand property at run time to set the number of levels MhTree displays. Note that in order for the Expand property to have any effect, there must be values assigned to the List property.

You can optionally allow the user to select multiple items, then use the ListTagged array property to determine which items have been selected.

Caution:  All owner draw list boxes have a problem if you use them in conjunction with SetParent. The symptom is that after the call to SetParent the control will not display any contents. You can get around this problem by setting a property that will cause the control to be recreated, such as changing the value of the SingleSelect property. This is a problem with all owner draw list boxes in VB, not just ours.


MhSubClass: hWndSubclass

Description

The hWndSubclass property sets the hWnd of the control you want to subclass (i.e. intercept messages). Set this property to the hWnd of the control that you want to subclass.

Syntax

ctlname.hWndSubclass = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhSubClass: MsgList

Description

The MsgList property sets the message numbers that fire the SubclassMsg event. The following example, catches the WM_PAINT and WM_SIZE messages:

MhCallb1.MsgList(0) = WM_PAINT

MhCallb1.MsgList(1) = WM_SIZE

Syntax

ctlname.MsgList(element) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MsgPassage


MhSubClass: MsgPassage

Description

The MsgPassage property indicates how messages are handled. You can have MhSubClass pre-process the message, post-process the message or kill the message. The valid settings for the MsgPassage property follow:

Setting	Description

-1	Preprocess the message (sends it to VBDefControlProc first)

0	Kill the message - never pass it on.

1	(Default) Pass the message on after firing the SubclassMsg event.

This example shows how you can use MsgPassage:

MhCallB1.MsgList(0) = WM_PAINT: MhCallB1.MsgPassage(0)=-1

Syntax

ctlname.MsgPassage(element) = setting%

Data Type

Integer Array

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MsgList


MhSubClass: SubclassMsg

Description

The SubClassMsg event occurs when using the subclass properties of MhSubClass. Use this event if you installed a subclass. Do your processing in this event. Note that the parameters used in this event are those returned by Windows itself. Please refer to the Windows API for further details.

Syntax

Sub ctlname_SubclassMsg (Msg As Integer, wParam As Integer, 1Param As Integer, ReturnVal As Long)


MhSubClass: Overview

The MhSubClass control provides access to subclassing services. The following table provides an overview of the MhSubClass control.

MhSubClass Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhSubC16.OCX MhSubC32.OCX	MhSubClass	See the MHSUB sample directory.		MhInvisible
Development Notes

MhSubClass provides subclassing services built into the control. To use MhSubClass, set hWndSubclass to the hWnd you wish to subclass and set the MsgList() property to the message number (see windows.h)  that you want to intercept.


MhOutBox: Arc

Description

The Arc property draws an elliptical arc within the control. The Arc property is equivalent to the GDI Arc function in the Windows SDK. The string specified with this property must contain 8 arguments separated by spaces (not commas) as follows:

Argument	Description

LeftRect	Specifies the logical x-coordinate of the upper-left corner of the bounding rectangle.

TopRect	Specifies the logical y-coordinate of the upper-left corner of the bounding rectangle.

RightRect	Specifies the logical x-coordinate of the lower-right corner of the bounding rectangle.

BottomRect	Specifies the logical y-coordinate of the lower-right corner of the bounding rectangle.

XStartArc	Specifies the logical x-coordinate of the point that defines the arc's starting point. This point need not lie exactly on the arc.

YStartArc	Specifies the logical y-coordinate of the point that defines the arc's starting point. This point need not lie exactly on the arc.

XEndArc	Specifies the logical x-coordinate of the point that defines the arc's endpoint. This point need not lie exactly on the arc.

YEndArc	Specifies the logical y-coordinate of the point that defines the arc's endpoint. This point need not lie exactly on the arc.

The color of the arc is determined by the ForeColor property. The following example demonstrates how to set the Arc property:

MhOutBox1.Arc = "2400 1200 5000 500 2400 200 5000 200"

Syntax

ctlname.Arc = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BCircle, Chord, Ellipse


MhOutBox: AutoSize

Description

The AutoSize property indicates whether the control should automatically size itself according to the size of the image loaded into the control with the PasteFromClip, Picture or LoadPicture properties. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	If the EraseForRead property is set to True, the control is resized according to the image that is loaded into the control. If EraseForRead is False, setting this property to True will stretch or shrink the image to the size of the control.

False (0)	(Default) Neither the picture not the control is resized.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhOutBox: BackColor

Description

The BackColor property sets or returns the background color used to display text or fill the control after using the Clear method or ClearBox property.

When you set the BackColor property to fill the control's background, the change does not take effect until the Clear method or ClearBox property is used. Otherwise, the BackColor is used to determine the text background color when drawing text with the TextOut and ExtTextOut properties. The default value is the current BackColor of the parent form.

Syntax

ctlname.BackColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ClearBox


MhOutBox: BackMode

Description

The BackMode property sets or returns the method used to interact with the background when painting in the control. The valid settings for the BackMode property follow:

Setting	Description

1	Transparent

2	(Default) Opaque

Syntax

ctlname.BackMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BackColor


MhOutBox: BCircle

Description

The BCircle property draws a circle within the control. The BCircle property is similar to the VB Circle method. The BCircle property uses the following three arguments separated by spaces (not commas):

Argument	Description

X	Specifies the logical x-coordinate of the center of the circle.

Y	Specifies the logical y-coordinate of the center of the circle.

Radius	Specifies the radius of the circle.

The outline color and fill color of the circle are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the BCircle property:

MhOutBox1.BCircle = "1200 1600 1000"

Syntax

ctlname.BCircle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Arc, Chord, Ellipse


MhOutBox: BezierSteps

Description

The BezierSteps property sets or returns the number of line segments that are used to draw a bezier curve using the PolyBezier property. The BezierSteps property determines the number of line segments to use in drawing Bezier curves (i.e. the number of segments per curve). The higher the number of segments, the smoother the resolution of the curve. The default is 32 segments.

Note that this is a simulation of Bezier Curves using line segments; therefore, each PolyBezier setting will actually produce BezierSteps line segments in the metafile. If you use a low number of segments, your curve will have a polygon look.

Syntax

ctlname.BezierSteps = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PolyBezier


MhOutBox: BLine

Description

The BLine property draws a line within the control. The BLine property is similar to the VB Line method. The BLine property uses the following 4 arguments separated by spaces (not commas):

Argument	Description

XStart	Specifies the logical x-coordinate of the starting point of the line.

YStart	Specifies the logical y-coordinate of the starting point of the line.

XEnd	Specifies the logical x-coordinate of the ending point of the line.

YEnd	Specifies the logical y-coordinate of the ending point of the line.

The color of the line is determined by the ForeColor property. The following example demonstrates how to set the BLine property:

MhOutBox1.BLine = "1300 300 2300 300"

Syntax

ctlname.BLine = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ForeColor, LineTo


MhOutBox: BorderStyle

Description

The BorderStyle property sets or returns the control's border style. The valid settings for the BorderStyle property follow:

Setting	Description

0	(Default) No border

1	Single Line

Syntax

ctlname.BorderStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BrushStyle


MhOutBox: BrushStyle

Description

The BrushStyle property sets or returns the style of brush to use when filling a geometric shape with color. The valid settings for the BrushStyle property follow:

Setting	Description

0	(Default) Solid

1	Hollow

2	Hatched (HatchStyle determines hatch pattern)

Syntax

ctlname.BrushStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

HatchStyle


MhOutBox: Chord

Description

The Chord property draws a chord (a closed figure bounded by the intersection of an ellipse and a line segment) within the control. The Chord property is equivalent to the GDI Chord function in the Windows SDK. The string specified with this property contains the following 8 arguments separated by spaces (not commas):

Argument	Description

LeftRect	Specifies the logical x-coordinate of the upper-left corner of the bounding rectangle.

TopRect	Specifies the logical y-coordinate of the upper-left corner of the bounding rectangle.

RightRect	Specifies the logical x-coordinate of the lower-right corner of the bounding rectangle.

BottomRect	Specifies the logical y-coordinate of the lower-right corner of the bounding rectangle.

XStartLine	Specifies the logical x-coordinate of the starting point of the line segment.

YStartLine	Specifies the logical y-coordinate of the starting point of the line segment.

XEndLine	Specifies the logical x-coordinate of the ending point of the line segment.

YEndLine	Specifies the logical y-coordinate of the ending point of the line segment.

The outline color and fill color of the chord are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the Chord property:

MhOutBox1.Chord = "200 2800 2200 4800 400 3400 2000 4400"

Syntax

ctlname.Chord = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Arc, BCircle, Ellipse


MhOutBox: ClearBox

Description

The ClearBox property clears the control. Any time you set this property, regardless of the value, the contents of the control are cleared. In addition, the foreground, background and mapping mode settings are reinitialized. Note that if you have set the background color, and you are in Anisotropic mode (set via the MapMode property), a record will be written to the working metafile that fills it with the current background color.

Syntax

ctlname.ClearBox = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BackColor, MapMode


MhOutBox: ColorPrint

Description

The ColorPrint property indicates whether the control uses standard Windows printing to print color images. The valid settings for the ColorPrint property follow:

Setting	Description

True (-1)	(Default) Standard Windows printing. Color images are printed with colors on a color printer, and are dithered to grayscale on black and white printers.

False (0)	Color images are printed in black and white. Solid colors print as black, non-solid colors are not printed. All text defaults to black, and the background color defaults to the printer's background color (usually white).

Syntax

ctlname.ColorPrint = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PrintJobName


MhOutBox: CopyToClip

Description

The CopyToClip property copies the contents of the control to the clipboard using the metafile format. Any time you set this property, regardless of the value, the contents of the control are copied to the clipboard. If you wish to paste an image from the clipboard to the control, use the PasteFromClip property. The CopyToClip property may be used regardless of the current OutContext setting.

Syntax

ctlname.CopyToClip = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PasteFromClip


MhOutBox: Ellipse

Description

The Ellipse property draws an ellipse within the control. The center of the ellipse is the center of the specified bounding rectangle. The Ellipse property is equivalent to the GDI Ellipse function in the Windows SDK. The string specified with this property contains the following 4 arguments separated by spaces (not commas):

Argument	Description

LeftRect	Logical x-coordinate of upper-left corner of the bounding rectangle.

TopRect	Logical y-coordinate of upper-left corner of the bounding rectangle.

RightRect	Logical x-coordinate of lower-right corner of the bounding rectangle.

BottomRect	Logical y-coordinate of lower-right corner of the bounding rectangle.

The outline color and fill color of the ellipse are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the Ellipse property:

MhOutBox1.Ellipse = "2400 600 3800 2600"

Syntax

ctlname.Ellipse = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Arc, BCircle, Chord


MhOutBox: EndOfDoc

Description

The EndOfDoc property is used in conjunction with EndPage and EndPageIsEndDoc to facilitate the printing of multiple pages. This property is valid when EndPageIsEndDoc is set to False. The valid settings for the EndOfDoc property follow:

Setting	Description

True (-1)	Eject page and terminate printing. EndPage means end of page and end of printing.

False (0)	(Default) Eject page but continue printing. EndPage means end of  page but not end of printing.

To print a multi-page document, set EndPageIsEndDoc to False, set the EndPage property to True for each page and then set EndOfDoc to True to print the whole document. Setting EndPageIsEndDoc back to True and setting EndPage to True will also print the whole document.

Syntax

ctlname.EndOfDoc = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EndPage, EndPageIsEndDoc


MhOutBox: EndPage

Description

The EndPage property sends the contents of the control to the printer, clipboard or metafile (as determined by the OutContext property). When the OutContext property is set to 1 (Printer), 2 (Clipboard) or 3 (Metafile), the image is not output until you set the EndPage property to a non-zero value. When OutContext is set to 4 (Preview), the image is displayed on the screen as it is drawn, and setting the EndPage property will send the image to the printer. If EndPageIsEndDoc is set to False, setting EndPage to True will output a single page of a multiple page document.

Syntax

ctlname.EndPage = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EndOfDoc, EndPageIsEndDoc


MhOutBox: EndPageIsEndDoc

Description

The EndPageIsEndDoc property is used in conjunction with EndPage and EndOfDoc to facilitate the printing of multiple pages.

Setting	Description

True (-1)	(Default) Output is entire document.

False (0)	Enables EndPage to output one or multiple pages.

To print a multi-page document, set EndPageIsEndDoc to False, set the EndPage property to True for each page and then set EndOfDoc to True to print the whole document. Setting EndPageIsEndDoc back to True and setting EndPage to True will also print the whole document.

Syntax

ctlname.EndPageIsEndDoc = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EndOfDoc, EndPage


MhOutBox: EraseForRead

Description

The EraseForRead property indicates whether the contents of the control are erased the next time an image is loaded with the LoadPicture, Picture or PasteFromClip properties. The EraseForRead property allows you to specify whether the loaded image is merged with the existing contents of the control, or replaces the contents entirely. The valid settings for the EraseForRead property follow:

Setting	Description

True (-1)	The contents of the control will be cleared the next time an image is loaded with the LoadPicture, Picture or PasteFromClip properties.

False (0)	(Default) The contents of the control are not cleared.

When EraseForRead is False, you can merge the loaded image at a specific location, using the ViewportOrgX, ViewportOrgY, WindowOrgX or WindowOrgY properties.

Syntax

ctlname.EraseForRead = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LoadPicture, Picture, PasteFromClip


MhOutBox: ExtTextOut

Description

The ExtTextOut property draws the contents of the Text property in a rectangular region within the control, using the current font (as determined by the Fontxxx properties). The ExtTextOut property is equivalent to the GDI ExtTextOut function in the Windows SDK. The rectangular region can be opaque (filled by using the current BackColor), and it can be a clipping region. The string specified with this property contains the following seven arguments separated by spaces (not commas):

Argument	Description

XStart	Specifies the logical x-coordinate at which the string begins.

YStart	Specifies the logical y-coordinate at which the string begins.

RectType	Specifies the rectangle type:

2  Opaque (Rectangle is filled with the current BackColor)

4  Clipped (Text is clipped to fit within the rectangle)

8  Wrap (Text is wrapped within the rectangle).

LeftRect	Logical x-coordinate of upper-left corner of the bounding rectangle.

TopRect	Logical y-coordinate of upper-left corner of the bounding rectangle.

RightRect	Logical x-coordinate of lower-right corner of the bounding rectangle.

BottomRect	Logical y-coordinate of lower-right corner of the bounding rectangle.

The following example demonstrates how to set the ExtTextOut property:

T$ = "This text will wrap within the rectangle."

MhOutBox1.Text = T$

MhOutbox1.ExtTextOut = "0 0 8 0 0 5000 5000"

The position of the text within the control is also affected by the TextAlignCP, TextAlignH and TextAlignV properties. If TextAlignCP is set to True, the coordinates specified in the ExtTextOut property are ignored, and the current position is used. However, you must still set the ExtTextOut property (regardless of the values) in order for the text to be drawn in the control.

Syntax

ctlname.ExtTextOut = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BackColor, TextOut


MhOutBox: FillColor

Description

The FillColor property sets or returns the color used to fill inside of a shape drawn in the control. When you set the FillColor property, the new value will apply to any later shape that is drawn, not the shapes that are already drawn in the control. The default value is the current BackColor of the control.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BackColor


MhOutBox: ForeColor

Description

The ForeColor property sets or returns the color used to draw lines, shapes, text and points within the control. When you set the ForeColor property, the new value will apply to later objects that are drawn, not the objects that are already drawn in the control. The default value is the current ForeColor of the parent form.

Syntax

ctlname.ForeColor = colorvalue&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BackColor


MhOutBox: HatchStyle

Description

The HatchStyle property sets or returns the style when BrushStyle = 2 (Hatched). The HatchStyle property determines the pattern that is used to fill in geometric shapes that are drawn into the control. This property is only used if BrushStyle = 2 (Hatched). The valid setting for the HatchStyle property follow:

Setting	Description

0	Horizontal Hatching

1	Vertical

2	FDiagonal

3	BDiagonal

4	Cross

5	Diagonal Cross

Syntax

ctlname.HatchStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BrushStyle


MhOutBox: LineTo

Description

The LineTo property draws a line within the control from the current position up to, but not including, the specified endpoint. The LineTo property is equivalent to the GDI LineTo function in the Windows SDK. The string specified with this property must contain two arguments separated by spaces (not commas):

Setting	Description

xEnd	Specifies the logical x-coordinate of the line's endpoint.

yEnd	Specifies the logical y-coordinate of the line's endpoint.

LineTo sets the current position to xEnd, yEnd.

The color of the line is determined by the ForeColor property. The following example demonstrates how to set the LineTo property:

MhOutBox1.LineTo = "1200 1600"

If you wish to move to a specific position without drawing a line from the current position, use the MoveTo property.

Syntax

ctlname.LineTo = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MoveTo


MhOutBox: LoadPicture

Description

The LoadPicture property loads a bitmap, icon or metafile into the control. When an image is loaded with the LoadPicture property, the size of the image is determined by the AutoSize and EraseForRead properties. If EraseForRead is True and AutoSize is True, the control is resized to the size of the loaded image. If EraseForRead is False and AutoSize is True, AutoSize is ignored and the control is not resized (this allows you to merge the image with the existing contents of the control). If AutoSize is False, the image is stretched or reduced to the size of the control.

Syntax

ctlname.LoadPicture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhOutBox: MapMode

Description

The MapMode property sets or returns the current mapping mode used by the control. The mapping mode defines the unit of measure used to convert logical units to device units. The mapping mode also defines the orientation of the device's x- and y-axes. The MapMode property is equivalent to the GDI SetMapMode function in the Windows SDK. The valid settings for the MapMode property follow:

Setting	Description

1	Text. Each logical unit is converted to one device pixel. Positive x is to the right; positive y is down.

2	LoMetric. Each logical unit is converted to 0.1 millimeter. Positive x is to the right; positive y is up.

3	HiMetric. Each logical unit is converted to 0.01 millimeter. Positive x is to the right; positive y is up.

4	LoEnglish. Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up.

5	HiEnglish. Each logical unit is converted to 0.001 inch. Positive x is to the right; positive y is up.

6	Twips. Each logical unit is converted to 1/20 of a point. (Because a point is 1/72 inch, a twip is 1/1440 inch). Positive x is to the right; positive y is up.

7	Isotropic. Logical units are converted to arbitrary units with equally scaled axes; that is, one unit along the x-axis is equal to one unit along the y-axis. The WindowExtX, WindowExtY, ViewportExtX and ViewportExtY properties must be used to specify the desired units and the orientation of the axes. The control makes adjustments as necessary to ensure that the x and y units remain the same size.

8	(Default) Anisotropic. Logical units are converted to arbitrary units with arbitrarily scaled axes. Setting the mapping mode to Anisotropic does not change the current window or viewport settings. To change the units, orientation, and scaling, use the WindowExtX, WindowExtY, ViewportExtX and ViewportExtY properties.

Caution:  The default setting (Anisotropic) is strongly recommended, as it is preferred by the Windows clipboard, DDE, OLE, and other Windows operations. It is also the best mode in which to rescale images.

Syntax

ctlname.MapMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MapRatioX, MapRatioY


MhOutBox: MapRatioX

Description

The MapRatioX property returns the horizontal ratio of the current mapping mode units (as determined by the MapMode property) to HiMetric units (0.01 millimeter).

Syntax

setting! = ctlname.MapRatioX

Data Type

Single Precision

Availability

Run-Time Read

See Also

MapRatioY


MhOutBox: MapRatioY

Description

The MapRatioY property returns the vertical ratio of the current mapping mode units (as determined by the MapMode property) to HiMetric units (0.01 millimeter).

Syntax

setting! = ctlname.MapRatioY

Data Type

Single Precision

Availability

Run-Time Read

See Also

MapRatioX


MhOutBox: MetaFileName

Description

The MetaFileName property sets or returns the name of the metafile written by the control. The MetaFileName property determines the name of the metafile that is written to disk when you set the SaveMetaFile property or when you set EndPage while the OutContext property is set to 3 (MetaFile).

Syntax

ctlname.MetaFileName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

SaveMetaFile


MhOutBox: MoveTo

Description

The MoveTo property moves the current drawing position to the specified coordinates within the control without drawing a line. The MoveTo property is equivalent to the GDI MoveTo function in the Windows SDK. The string specified with this property contains the following 2 arguments separated by spaces (not commas):

Argument	Description

xNew	Specifies the logical x-coordinate of the new position.

yNew	Specifies the logical y-coordinate of the new position.

The following example demonstrates how to set the MoveTo property:

MhOutBox1.MoveTo = "2000 2000"

If you wish to draw a line from the current position to a new position, use the LineTo property.

Syntax

ctlname.MoveTo = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

LineTo


MhOutBox: OutContext

Description

The OutContext property sets or returns the output location for the image contained within the control. The valid settings for the OutContext property follow:

Setting	Description

0	(Default) Screen

1	Printer

2	Clipboard

3	Metafile (specified in the MetaFileName property)

4	Preview. The image is sent to the screen at all times, and to the printer whenever the EndPage property is set to a non-zero value.

Caution: When OutContext is set to 1 (Printer), 2 (Clipboard) or 3 (Metafile), the image is not output until you set the EndPage property. If you draw an image in one context, and you switch to another context without setting EndPage first, the image is not output to the context from which you are switching.

Syntax

ctlname.OutContext = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

EndPage


MhOutBox: PasteFromClip

Description

The PasteFromClip property pastes the contents of the clipboard into the control. Any time you set this property, regardless of the value, the contents of the clipboard are pasted into the control. If you wish to copy an image from the control to the clipboard, use the CopyToClip property.

When an image is pasted from the clipboard, the size of the image is determined by the AutoSize and EraseForRead properties. If EraseForRead is True and AutoSize is True, the control is resized to the size of the pasted image. If EraseForRead is False and AutoSize is True, AutoSize is ignored and the control is not resized (this allows you to merge the image with the existing contents of the control). If AutoSize is False, the image is stretched or reduced to the size of the control.

Syntax

ctlname.PasteFromClip = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

CopyToClip


MhOutBox: PenStyle

Description

The PenStyle property sets or returns the style of pen to use when drawing lines. The valid settings for the PenStyle property follow:

Setting	Description

0	(Default) Solid

1	Dashed

2	Dotted

3	Dash - Dot

4	Dash - Dot - Dot

5	Null Pen

6	InsideFrame (See WIN SDK CreatePen function for more information)

Note: 	The PenWidth property cannot be less than 1 for this property to take effect.

Syntax

ctlname.PenStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PenWidth


MhOutBox: PenWidth

Description

The PenWidth property sets or returns the width of the pen (in logical units) when drawing lines. The default value is zero. When PenWidth is greater than 1, the PenStyle is treated as Solid. When PenWidth is set to 0 or 1, the PenStyle property determines the type of line that is drawn (Solid, Dashed, etc.)

Syntax

ctlname.PenWidth = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PenStyle


MhOutBox: Picture

Description

The Picture property sets or returns the image to display within the control. When an image is set with the Picture property, the size of the image is determined by the AutoSize and EraseForRead properties. If EraseForRead is True and AutoSize is True, the control is resized to the size of the loaded image. If EraseForRead is False and AutoSize is True, AutoSize is ignored and the control is not resized (this allows you to merge the image with the existing contents of the control). If AutoSize is False, the image is stretched or reduced to the size of the control.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Run-Time Read

Run-Time Write

See Also

AutoSize


MhOutBox: Pie

Description

The Pie property draws a pie-shaped wedge within the control by drawing an elliptical arc whose center and two endpoints are joined by lines. The Pie property is equivalent to the GDI Pie function in the Windows SDK. The string specified with this property contains the following 8 arguments separated by spaces (not commas):

Argument	Description

LeftRect	Logical x-coordinate of upper-left corner of the bounding rectangle.

TopRect	Logical y-coordinate of upper-left corner of the bounding rectangle.

RightRect	Logical x-coordinate of lower-right corner of the bounding rectangle.

BottomRect	Logical y-coordinate of lower-right corner of the bounding rectangle.

xStartArc	Logical x-coordinate of the arc's starting point. This point does not have to lie exactly on the arc.

yStartArc	Logical y-coordinate of the arc's starting point.  This point does not have to lie exactly on the arc.

xEndArc	Logical x-coordinate of the arc's endpoint.  This point does not have to lie exactly on the arc.

yEndArc	Logical y-coordinate of the arc's endpoint.  This point does not have to lie exactly on the arc.

The outline color and fill color of the pie are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the Pie property:

MhOutBox1.Pie = "2400 3100 3800 4500 2600 3300 3600 3300"

Syntax

ctlname.Pie = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Arc


MhOutBox: PlaceableDiskMeta

Description

The PlaceableDiskMeta property indicates whether the metafile is written to disk with a placeable header. Microsoft's standard metafile definition does not include information about the image's size. A placeable metafile is an extension of the standard definition, and uses an extra header to describe the image size. When a placeable metafile is placed in an application such as Microsoft Word for Windows, the application displays the image using the dimensions contained in the extra header. By contrast, a non-placeable metafile might not appear at its original size (or may not appear at all) when placed in an application. The valid settings for the PlaceableDiskMeta property follow:

Setting	Description

True (-1)	(Default) The metafile is written with a placeable header.

False (0)	The metafile is not written with a placeable header.

Syntax

ctlname.PlaceableDiskMeta = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

OutContext


MhOutBox: PolyBezier

Description

The PolyBezier property defines the points used to draw a Bezier curve. The PolyBezier property is an approximation of the Windows NT and Windows 95 PolyBezier function and is used to draw a Bezier curve as a series of straight lines. The property requires at least 8 coordinates (the starting pair + curve count * 3 pair). Note that unlike the Windows NT/Windows 95 function, setting this property does affect your current position.

The points consist of StartX, StartY, Control1X, Control1Y, Control2X, Control2Y, EndX, and EndY. This is for a single curve. For multiple curves, continue to specify Control1X, Control1Y, Control2X, Control2Y, EndX, and EndY after the single curve settings. Each successive curve uses the previous end points as its starting point. For example:

Single Curve:

MhOutbox1.PolyBezier = "200 200 2000 2000 4000 0 6000 200"

Multiple Curves:

MhOutbox1.PolyBezier = "200 200 2000 2000 4000 0 6000 200 4000 2000 8000 4000

       6000 6000"

The outline color is determined by the ForeColor property.

Syntax

ctlname.PolyBezier = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BezierSteps


MhOutBox: PolyFillMode

Description

The PolyFillMode property sets or returns the polygon-filling mode used by the control. The PolyFillMode property is equivalent to the GDI SetPolyFillMode function in the Windows SDK. The valid settings for the  PolyFillMode property follow:

Setting	Description

1	(Default) Alternate. The control fills the area between odd-numbered and even-numbered polygon sides on each scan line. In other words, the control fills the area between the first and second side, between the third and fourth side, and so on.

2	Winding. The control uses the direction in which a figure was drawn to determine whether to fill an area. Each line segment in a polygon is drawn in either a clockwise or a counterclockwise direction. Whenever an imaginary line drawn from an enclosed area to the outside of a figure passes through a clockwise line segment, a count is incremented (increased by one). When the line passes through a counterclockwise line segment, the count is decremented (decreased by one). The area is filled if the count is non-zero when the line reaches the outside of the figure.

Syntax

ctlname.PolyFillMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Polygon, PolyPolyC, PolyPolyP


MhOutBox: Polygon

Description

The Polygon property draws a polygon within the control, consisting of two or more points (vertices) connected by lines. The control closes the polygon automatically, if necessary, by drawing a line from the last vertex to the first. The Polygon property is equivalent to the GDI Polygon function in the Windows SDK. The string specified with this property may contain a variable number of arguments, which are pairs of x/y coordinates for each vertex of the polygon. You may specify from 6 to 20 arguments separated by spaces (not commas), with each pair of arguments consisting of the following:

Argument	Description

xPoint	Specifies the logical x-coordinate for a particular vertex.

yPoint	Specifies the logical y-coordinate for a particular vertex.

The outline color and fill color of the polygon are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the Polygon property:

MhOutBox1.Polygon = "200 5000 1000 6000 200 6600"

Syntax

ctlname.Polygon = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PolyPolyC, PolyPolyP


MhOutBox: Polyline

Description

The Polyline property draws a polyline within the control, consisting of two or more points (vertices) connected by lines. The Polyline property is equivalent to the GDI Polyline function in the Windows SDK. The string specified with this property may contain a variable number of arguments, which are pairs of x/y coordinates for each vertex of the polyline. You may specify from 4 to 80 arguments separated by spaces (not commas), with each pair of arguments consisting of the following:

Argument	Description

xPoint	Specifies the logical x-coordinate for a particular vertex.

yPoint	Specifies the logical y-coordinate for a particular vertex.

The color of the polyline is determined by the ForeColor property. The following example demonstrates how to set the Polyline property:

MhOutBox1.Polyline = "200 5000 1000 6000 200 6600"

Syntax

ctlname.Polyline = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

BLine


MhOutBox: PolyPolyC

Description

The PolyPolyC and PolyPolyP properties draw a series of polygons within the control. The PolyPolyC and PolyPolyP properties are equivalent to the GDI PolyPolygon function in the Windows SDK. The string specified with the PolyPolyP property may contain a variable number of arguments, which are pairs of x/y coordinates for each vertex within the polypolygon. You may specify from 16 to 80 arguments separated by spaces (not commas), with each pair of arguments consisting of the following:

Argument	Description

xPoint	Specifies the logical x-coordinate for a particular vertex.

yPoint	Specifies the logical y-coordinate for a particular vertex.

The string specified with the PolyPolyC property may contain a variable number of arguments, which each argument indicating the number of pairs in PolyPolyP that make up each polygon in the polypolygon. In other words, if the first 4 pairs (8 arguments) of the PolyPolyP property correspond to one polygon, and the next 5 pairs (10 arguments) correspond to the second polygon, the PolyPolyC property should be set to "4" + Chr$(32) + "5".

The following example demonstrates how to use these properties:

' 2 polygons, 4 pairs (8 points) each

P1$ = "4200 5000 6200 5800 5000 6000 4200 5000"

P2$ = "4200 6600 5400 6400 5200 5200 4200 6600"

MhOutBox1.PolyPolyP =  P1$ + “ ” + P2$

MhOutBox1.PolyPolyC = "4 4"

The outline color and fill color of the polygons are determined by the ForeColor and FillColor properties. Note that unlike the Polygon property, polygons drawn with these properties are not automatically closed. You must close them yourself by specifying the appropriate vertices.

Syntax

ctlname.PolyPolyC = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PolyPolyP


MhOutBox: PolyPolyP

Description

See the PolyPolyC property for a description of the PolyPolyP property.

Syntax

ctlname.PolyPolyP = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PolyPolyC


MhOutBox: PrintJobName

Description

The PrintJobName property sets or returns the name of the print job. The default value is the Name of the control.

Syntax

ctlname.PrintJobName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


MhOutBox: PrinterOrientation

Description

The PrinterOrientation property sets or returns the paper orientation of the printer. The valid settings for the PrinterOrientation property follow:

Setting	Description

0	Portrait

1	Landscape

Syntax

ctlname.PrinterOrientation= setting$

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


MhOutBox: Rectangle

Description

The Rectangle property draws a rectangle within the control. The Rectangle property is equivalent to the GDI Rectangle function in the Windows SDK. The string specified with this property contains the following four arguments separated by spaces (not commas):

Setting	Description

LeftRect	Logical x-coordinate of the upper-left corner of the rectangle.

TopRect	Logical y-coordinate of the upper-left corner of the rectangle.

RightRect	Logical x-coordinate of the lower-right corner of the rectangle.

BottomRect	Logical y-coordinate of the lower-right corner of the rectangle.

The outline color and fill color of the rectangle are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the Rectangle property:

MhOutBox1.Rectangle = "400 400 2200 600"

If you wish to draw a rectangle with rounded corners, use the RoundRect property.

Note:  Rectangles go up to, but do not include, bottom right coordinates.

Syntax

ctlname.Rectangle = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

RoundRect


MhOutBox: ROpTwo

Description

The ROpTwo property sets or returns the current drawing mode. The drawing mode specifies how the colors of the pen and the interior of filled objects are combined with the color already on the screen. The ROpTwo property is equivalent to the GDI SetROP2 function in the Windows SDK. The valid settings for the ROpTwo property follow:

Setting	Description

0	Black. Pixel is always black.

1	NotMergePen. Pixel is the inverse of the MergePen color (final pixel = ~(pen | screen pixel)).

2	MaskNotPen. Pixel is a combination of the colors common to both the screen and the inverse of the pen (final pixel = (~pen) & screen pixel).

3	NotCopyPen. Pixel is the inverse of the pen color.

4	MaskPenNot. Pixel is a combination of the colors common to both the pen and the inverse of the screen (final pixel = (~screen pixel) & pen).

5	Not. Pixel is the inverse of the screen color.

6	XorPen. Pixel is a combination of the colors that are in the pen and in the screen, but not in both (final pixel = pen ^ screen pixel).

7	NotMaskPen. Pixel is the inverse of the MaskPen color (final pixel = ~(pen & screen pixel)).

8	MaskPen. Pixel is a combination of the colors common to both the pen and the screen (final pixel = pen & screen pixel).

9	NotXorPen. Pixel is the inverse of the XorPen color (final pixel = ~(pen ^ screen pixel)).

10	NOP. Pixel remains unchanged.

11	MergeNotPen. Pixel is a combination of the screen color and the inverse of the pen color (final pixel = (~pen) | screen pixel).

12	(Default) CopyPen. Pixel is the pen color.

13	MergePenNot. Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (~screen pixel) | pen).

14	MergePen. Pixel is a combination of the pen color and the screen color (final pixel = pen | screen pixel).

15	White. Pixel is always white.

Syntax

ctlname.ROpTwo = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MapMode


MhOutBox: RoundRect

Description

The RoundRect property draws a rectangle with rounded corners within the control. This property is equivalent to the GDI RoundRect function in the Windows SDK. The string specified in this property contains the following six arguments separated by spaces (not commas):

Setting	Description

LeftRect	Logical x-coordinate of the upper-left corner of the rectangle.

TopRect	Logical y-coordinate of the upper-left corner of the rectangle.

RightRect	Logical x-coordinate of the lower-right corner of the rectangle.

BottomRect	Logical y-coordinate of the lower-right corner of the rectangle.

EllipseWidth	Width, in logical units, of ellipse used to draw the rounded corners.

EllipseHeight	Height, in logical units, of ellipse used to draw the rounded corners.

The outline color and fill color of the rectangle are determined by the ForeColor and FillColor properties. The following example demonstrates how to set the RoundRect property:

MhOutBox1.RoundRect = "4000 2800 5600 4800 300 300"

If you wish to draw a rectangle without square corners, use the Rectangle property.

Syntax

ctlname.RoundRect = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Rectangle


MhOutBox: SaveMetaFile

Description

The SaveMetaFile property saves the contents of the control to a metafile. Any time you set this property, regardless of the value, the contents of the control are saved to the metafile specified by the MetaFileName property. The SaveMetaFile property may be used regardless of the current OutContext setting.

Syntax

ctlname.SaveMetaFile = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

MetaFileName


MhOutBox: ScaleRatioX

Description

The ScaleRatioX property returns the horizontal ratio of the current window size to the viewport size. The window size is measured in logical units and is determined by the WindowExtX and WindowExtY properties. The viewport (physical display) size is measured in HiMetric units (0.01 millimeter) and is determined by the ViewPortExtX and ViewportExtY properties.

Syntax

setting! = [form.]ctlname.ScaleRatioX

Data Type

Single Precision

Availability

Run-Time Read

See Also

ScaleRatioY


MhOutBox: ScaleRatioY

Description

The ScaleRatioY property returns the vertical ratio of the current window size to the viewport size. The window size is measured in logical units and is determined by the WindowExtX and WindowExtY properties. The viewport (physical display) size is measured in HiMetric units (0.01 millimeter) and is determined by the ViewPortExtX and ViewportExtY properties.

Syntax

setting! = [form.]ctlname.ScaleRatioY

Data Type

Single Precision

Availability

Run-Time Read

See Also

ScaleRatioX


MhOutBox: SetPixel

Description

The SetPixel property draws a single pixel within the control. The SetPixel property is equivalent to the GDI SetPixel function in the Windows SDK. With the SetPixel property, the color of the pixel is determined by the current ForeColor value. The string specified with this property contains the following two arguments separated by spaces (not commas):

Setting	Description

XPos	Specifies the logical x-coordinate of the pixel to draw.

YPos	Specifies the logical y-coordinate of the pixel to draw.

The following example demonstrates how to set the SetPixel property:

MhOutBox1.SetPixel = "1200 1600"

Syntax

ctlname.SetPixel = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


MhOutBox: StretchBltMode

Description

The StretchBltMode property sets or returns the stretch mode used when the control calls the Windows StretchBlt API function. The StretchBltMode property allows you to set whichever image mode looks better after the stretch occurs. The valid settings for the StretchBltMode property follow:

Setting	Description

1	Use BlackOnWhite stretching.

2	Use WhiteOnBlack stretching.

3	(Default) Use ColorOnColor stretching.

Syntax

ctlname.StretchBltMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

AutoSize, Picture


MhOutBox: Text

Description

The Text property sets or returns the text that is drawn within the control. The maximum text length is 32,767 characters. The position of the text within the control is determined by the TextAlignCP, TextAlignH, TextAlignV, TextOut and/or ExtTextOut properties. The foreground and background color of the text is determined by the ForeColor and BackColor properties. Note that when you set the Text property, the text is not drawn within the control until you set the TextOut or ExtTextOut properties.

Also, unlike the way the Text property is used in other VB controls, the MhOutBox control creates a separate layer of text each time you set the Text and TextOut/ExtTextOut properties. This allows you to simultaneously display multiple layers of text within the control.

Syntax

ctlname.Text = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ExtTextOut, TextOut


MhOutBox: TextAlignCP

Description

The TextAlignCP property indicates whether the current position within the control is updated by the coordinates set in the TextOut and ExtTextOut properties. The valid settings for the TextAlignCP property follow:

Setting	Description

True (-1)	Updates the current position whenever the TextOut and ExtTextOut properties are set (the coordinates specified in the properties are ignored). The new position is at the right side of the bounding rectangle for the text.

False (0)	(Default) Does not update the current position whenever the TextOut or ExtTextOut properties are set.

Syntax

ctlname.TextAlignCP = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ExtTextOut, TextOut


MhOutBox: TextAlignH

Description

The TextAlignH property sets or returns the horizontal alignment of text within the control when drawn with the ExtTextOut property. The valid settings for the TextAlignH settings are:

Setting	Description

0	(Default) Left. Aligns the text with the left side of its bounding rectangle.

1	Right. Aligns the text with the right side of its bounding rectangle.

2	Center. Aligns the text with the horizontal center of its bounding rectangle.

To specify the vertical alignment, use the TextAlignV property.

Syntax

ctlname.TextAlignH = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextAlignV


MhOutBox: TextAlignV

Description

The TextAlignV property sets or returns the vertical alignment of text within the control when drawn with the ExtTextOut property. The valid settings for the TextAlignV property follow:

Setting	Description

0	(Default) Top. Aligns the text with the top of its bounding rectangle.

1	Bottom. Aligns the text with the bottom of its bounding rectangle.

2	Baseline. Aligns the text with the base line of the chosen font.

To specify the horizontal alignment, use the TextAlignH property.

Syntax

ctlname.TextAlignV = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

TextAlignH


MhOutBox: TextOut

Description

The TextOut property draws the contents of the Text property within the control at the specified position, using the current font (as determined by the Fontxxx properties). The TextOut property is equivalent to the GDI TextOut function in the Windows SDK. The string in this property must contain the following two arguments separated by spaces (not commas):

Setting	Description

XStart	Specifies the logical x-coordinate of the starting point of the string.

YStart	Specifies the logical y-coordinate of the starting point of the string.

The position of the text within the control is affected by the TextAlignCP property (but not the TextAlignH and TextAlignV properties).  If TextAlignCP is set to True, the coordinates specified in the TextOut property are ignored, and the current position is used. However, you must still set the TextOut property (regardless of the values) in order for the text to be drawn in the control.

If the text string is too long to fit within the control, the string is clipped. If you wish to wrap the text within the control's window, use the ExtTextOut property.

Syntax

ctlname.TextOut = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ExtTextOut, Text


MhOutBox: ViewportExtX

Description

The ViewportExtX property sets or return the x-extent of the viewport (physical device) of the control. The viewport, along with the window, defines how points are converted from logical coordinates to device coordinates. The ViewportExtX and ViewportExtY values are measured in HiMetric units (0.01 millimeter). To specify the logical extents of the control, use the WindowExtX and WindowExtY properties.

Syntax

ctlname.ViewportExtX = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ViewportExtY


MhOutBox: ViewportExtY

Description

The ViewportExtY property sets or return the y-extent of the viewport (physical device) of the control. The viewport, along with the window, defines how points are converted from logical coordinates to device coordinates. The ViewportExtX and ViewportExtY values are measured in HiMetric units (0.01 millimeter). To specify the logical extents of the control, use the WindowExtX and WindowExtY properties.

Syntax

ctlname.ViewportExtY = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ViewportExtX


MhOutBox: ViewportOrgX

Description

The ViewportOrgX property sets or returns the x-origin of the viewport (physical device) of the control. The viewport, along with the window, defines how points are converted from logical coordinates to device coordinates. The origins are the starting or zero positions within the viewport, typically (but not necessarily) the top/left corner of the viewport. The ViewportOrgX and ViewportOrgY values are measured in HiMetric units (0.01 millimeter). To specify the logical origins of the control, use the WindowOrgX and WindowOrgY properties.

Syntax

ctlname.ViewportOrgX = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ViewportOrgY


MhOutBox: ViewportOrgY

Description

The ViewportOrgY property sets or returns the y-origin of the viewport (physical device) of the control. The viewport, along with the window, defines how points are converted from logical coordinates to device coordinates. The origins are the starting or zero positions within the viewport, typically (but not necessarily) the top/left corner of the viewport. The ViewportOrgX and ViewportOrgY values are measured in HiMetric units (0.01 millimeter). To specify the logical origins of the control, use the WindowOrgX and WindowOrgY properties.

Syntax

ctlname.ViewportOrgY = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ViewportOrgX


MhOutBox: WindowExtX

Description

The WindowExtX property sets or returns the x-extent of the logical window of the control. The window, along with the viewport, defines how logical coordinates are converted to device coordinates. The WindowExtX and WindowExtY values are preferably measured in HiMetric units (0.01 millimeter), but may be scaled as needed. To specify the viewport (physical) extents of the control, use the ViewportExtX and ViewportExtY properties.

Note that when AutoSize is False, and the control is resized, the window extents are updated; otherwise, the window extents are not updated when the control is resized. When you write to a metafile or the clipboard when AutoSize is False, the image may be clipped or sized according to the limits of the window extents.

Syntax

ctlname.WindowExtX = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WindowExtY


MhOutBox: WindowExtY

Description

The WindowExtY property sets or returns the y-extent of the logical window of the control. The window, along with the viewport, defines how logical coordinates are converted to device coordinates. The WindowExtX and WindowExtY values are preferably measured in HiMetric units (0.01 millimeter), but may be scaled as needed. To specify the viewport (physical) extents of the control, use the ViewportExtX and ViewportExtY properties.

Note that when AutoSize is False, and the control is resized, the window extents are updated; otherwise, the window extents are not updated when the control is resized. When you write to a metafile or the clipboard when AutoSize is False, the image may be clipped or sized according to the limits of the window extents.

Syntax

ctlname.WindowExtY = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WindowExtX


MhOutBox: WindowOrgX

Description

The WindowOrgX property sets or returns the x-origin of the logical window of the control. The window, along with the viewport, defines how logical coordinates are converted to device coordinates. The origins are the starting or zero positions within the window, typically (but not necessarily) the top/left corner of the window. The WindowOrgX and WindowOrgY values are preferably measured in HiMetric units (0.01 millimeter), but may be scaled as needed with the WindowExtX and WindowExtY properties. To specify the viewport (physical) origins of the control, use the ViewportOrgX and ViewportOrgY properties.

Syntax

ctlname.WindowOrgX = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WindowOrgY


MhOutBox: WindowOrgY

Description

The WindowOrgY property sets or returns the y-origin of the logical window of the control. The window, along with the viewport, defines how logical coordinates are converted to device coordinates. The origins are the starting or zero positions within the window, typically (but not necessarily) the top/left corner of the window. The WindowOrgX and WindowOrgY values are preferably measured in HiMetric units (0.01 millimeter), but may be scaled as needed with the WindowExtX and WindowExtY properties. To specify the viewport (physical) origins of the control, use the ViewportOrgX and ViewportOrgY properties.

Syntax

ctlname.WindowOrgY = setting&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

WindowOrgX


MhOutBox: Resize

Description

The Resize event occurs when the control is resized.

Syntax

Sub ctlname_Resize()


MhOutBox: MhObArc

Description

The MhObArc function draws an elliptical arc.

Syntax

MhObArc ControlHandle, x1, y1, x2, y2, x3, y3, x4, y4

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1 	X-coordinate of upper-left corner bounding rectangle

y1	Y-coordinate upper-left corner bounding rectangle

x2	X-coordinate lower-right corner bounding rectangle

y2	Y-coordinate lower-right corner bounding rectangle

x3	X-coordinate arc starting point

y3	Y-coordinate arc starting point

x4	X-coordinate arc ending point

y4	Y-coordinate arc ending point


MhOutBox: MhObChord

Description

The MhObChord function draws a chord. A chord is a closed figure bounded by the intersection of a line segment and an ellipse.

Syntax

MhObChord ControlHandle, x1, y1, x2, y2, x3, y3, x4, y4

Parameter	Description

ControlHandle	The name of the MhOutBox control

x1	X-coordinate of upper-left corner bounding rectangle

y1 	Y-coordinate upper-left corner bounding rectangle

x2	X-coordinate lower-right corner bounding rectangle

y2 	Y-coordinate lower-right corner bounding rectangle

x3	X-coordinate line-segment starting point

y3	Y-coordinate line-segment starting point

x4	X-coordinate line-segment ending point

y4	Y-coordinate line-segment ending point


MhOutBox: MhObPie

Description

The MhObPie function draws a pie-shaped wedge consisting of an elliptical arc whose center and two endpoints are joined by lines.

Syntax

MhObPie ControlHandle, x1, y1, x2, y2, x3, y3, x4, y4

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1	X-coordinate of upper-left corner bounding rectangle

y1	Y-coordinate upper-left corner bounding rectangle

x2	X-coordinate lower-right corner bounding rectangle

y2	Y-coordinate lower-right corner bounding rectangle

x3	X-coordinate arc starting point

y3	Y-coordinate arc starting point

x4	X-coordinate arc ending point

y4 	Y-coordinate arc ending point


MhOutBox: MhObCircle

Description

The MhObCircle function draws a circle.

Syntax

MhObCircle ControlHandle, x1, y1, radius

Parameters

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1	X-coordinate of center

y1	Y-coordinate of center

radius	Radius


MhOutBox: MhObEllipse

Description

The MhObEllipse function draws an ellipse whose center is the center of the specified bounding rectangle.

Syntax

MhObEllipse ControlHandle, x1, y1, x2, y2

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1 	X-coordinate of upper-left corner bounding rectangle

y1	Y-coordinate upper-left corner bounding rectangle

x2 	X-coordinate lower-right corner bounding rectangle

y2 	Y-coordinate lower-right corner bounding rectangle


MhOutBox: MhObLine

Description

The MhObLine function draws a line from the point defined by x1, y1 to the point defined by x2, y2.

Syntax

MhObLine ControlHandle, x1, y1, x2, y2

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1 	X-coordinate of line start

y1 	Y-coordinate line start

x2	X-coordinate line endpoint

y2 	Y-coordinate line endpoint


MhOutBox: MhObLineTo

Description

The MhObLineTo function draws a line from the current point to one unit short of the point defined by x1, y1.

Syntax

MhObLineTo ControlHandle, x1, y1

Parameter	Description

ControlHandle	The name of the MhOutBox control

x1 	X-coordinate line endpoint

y1 	Y-coordinate line endpoint


MhOutBox: MhObMoveTo

Description

The MhObMoveTo function sets the current point.

Syntax

MhObMoveTo ControlHandle, x1, y1

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1	X-coordinate of new position

y1	Y-coordinate of new position


MhOutBox: MhObRectangle

Description

The MhObRectangle function draws a rectangle.

Syntax

MhObRectangle ControlHandle, x1, y1, x2, y2

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1 	X-coordinate of upper-left corner of rectangle

y1 	Y-coordinate upper-left corner of rectangle

x2 	X-coordinate lower-right corner of rectangle

y2 	Y-coordinate lower-right corner of rectangle


MhOutBox: MhObRoundRect

Description

The MhObRoundRect function draws a rounded rectangle (one in which the corners are rounded).

Syntax

MhObRoundRect ControlHandle, x1, y1, x2, y2, x3, y3

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1	X-coordinate of upper-left corner of rectangle

y1	Y-coordinate upper-left corner of rectangle

x2	X-coordinate lower-right corner of rectangle

y2 	Y-coordinate lower-right corner of rectangle

x3	Width of ellipse for rounded corners

y3	Height of ellipse for rounded corners


MhOutBox: MhObSetPixel

Description

The MhObSetPixel function sets the pixel defined by x1, y1 to the current forecolor.

Syntax

MhObSetPixel ControlHandle, x1, y1

Parameter	Description

ControlHandle 	The name of the MhOutBox control

x1 	X-coordinate of pixel to set

y1	Y-coordinate of pixel to set


MhOutBox: MhObPolygon

Description

The MhObPolygon function draws a polygon consisting of two or more points connected by lines. If necessary, the Windows GDI will close the polygon automatically by drawing a line from the last point to the first.

Syntax

MhObPolygon ControlHandle, PointArray, cPoints

Parameter	Description

ControlHandle 	The name of MhOutBox control

PointArray 	An array of POINT structures (user-defined type) that specify the different point locations. Each element in the array specifies a different vertex.

cPoints 	The number of POINT elements in PointArray.This POINT user-defined type is defined below:

Type POINT

    X As Integer	' X coordinate of vertex

    Y As Integer	' Y coordinate of vertex

End Type


MhOutBox: MhObPolyline

Description

The MhObPolyline function draws a set of line segments connecting specified points. Lines are drawn from the first points through subsequent points

Syntax

MhObPolyline ControlHandle, PointArray, cPoints

Parameter	Description

ControlHandle	The name of the MhOutBox control

PointArray	An array of POINT structures (user-defined type) that specify the different point locations. (See MhObPolygon for information about the POINT type).

Points	The number of POINT elements in PointArray.


MhOutBox: MhObPolyPolygon

Description

The MhObPolyPolygon function draws two or more polygons. Unlike MhObPolygon, this requires that each polygon be closed.

Syntax

MhObPolygon ControlHandle, PointArray, CountArray, cPolygons

Parameter	Description

ControlHandle 	The name of the MhOutBox control

PointArray	An array of POINT structures (user-defined type) that specify the different point locations for polygons that will be drawn sequentially. Each element in the array specifies a different vertex. (See MhObPolygon for information about the POINT type).

CountArray	An array of integers in which each element contains the number of points of a polygon to be drawn.

cPolygons	The number of polygons to be drawn. This number must be a minimum of two.


MhOutBox: Overview

The MhOutBox control is a powerful and unique picture control that gives you true device-independent output capabilities. With MhOutBox you can write one set of instructions that will produce output to the screen, a printer, a metafile or the clipboard. MhOutBox also provides VB programmers with convenient access to many Windows GDI functions without using C and the Windows SDK and allows you to:

-  Draw interactively on the control at design time by manipulating properties in the Properties list. The resulting image is then saved in the form file, in metafile format.

-  Combine or merge bitmaps. This can be done by pasting an image from the clipboard, loading a disk file or reading the Picture property from a picture control.

-  Create multiple streams of text within a single image.

-  Reduce or enlarge the image in one or two lines of code.

The following table provides an overview of the MhOutBox control.

MhOutBox Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhOutB16.OCX MhOutB32.OCX MHOUTBX.VBX	MhOutBox	See the MHOUTB sample directory.		MhOddPic
Development Notes

MhOutBox provides its functionality by internally building a device-independent metafile of the image as it is created. The OutContext property determines where this image is displayed or sent:

OutContext	Description

0	Screen

1	Printer

2	Clipboard

3	Disk metafile (specified in the MetaFileName property)

4	Preview. The image is sent to the screen at all times, and to the printer whenever the EndPage property is set to a non-zero value.

If you can create the image in one context, and change the OutContext property to another value, the image will be sent to the new context. You are not required to create the image a second time.

Caution:  When OutContext is set to 1 (Printer), 2 (Clipboard) or 3 (Metafile), the image is not output until you set the EndPage property. If you draw an image in one context, and you switch to another context without setting EndPage first, the image is not output to the context from which you are switching.

The following properties can be used to draw shapes, lines or points within the control and are based directly on the Windows GDI functions of the same (or similar) names: Arc, Chord, Ellipse, LineTo, MoveTo, Pie, PolyFillMode, Polygon, Polyline, PolyPolyC, PolyPolyP, Rectangle, RoundRect and SetPixel.

The BCircle and BLine properties can be used to draw circles and lines, and are similar to VB's Circle and Line methods.

The TextOut and ExtTextOut properties can be used to draw the Text string within the control and are based on the GDI functions of the same name. The position of the text within the control is affected by the TextAlignCP, TextAlignH and TextAlignV properties. Note that when you set the Text property, the text is not drawn within the control until you set the TextOut or ExtTextOut properties.

Also, unlike the way the Text property is used in other VB controls, the MhOutBox control creates a separate layer of text each time you set the Text and TextOut/ExtTextOut properties. This allows you to simultaneously display multiple layers of text within the control.

When you set the CopyToClip property to a non-zero value, the contents of the control are copied (in metafile format) to the clipboard. This can be done at any time, regardless of the current context. If you wish to paste an image from the clipboard to the control, use the PasteFromClip property.

The Picture and LoadPicture properties allow you to load an image into the control. If the EraseForRead property is true, the MhOutBox contents are cleared before the image is read. If EraseForRead is False, the image is combined with the contents of the control.

When you set the SaveMetaFile property to a non-zero value, the contents of the control are saved to the metafile specified by the MetaFileName property. This can be done at any time, regardless of the current context.

The Windowxxx properties determine the logical extents and origins of the control, and the ViewPortxxx properties do likewise for the physical extents and origins. For example, you can zoom the image by 200% in only two lines of code. For example:

MhOutBox1.ViewportExtX = MhOutBox1.ViewportExtX * 2

MhOutBox1.ViewportExtY = MhOutBox1.ViewportExtY * 2

The MapMode property determines the current mapping mode used by the control. The mapping mode defines the unit of measure used to convert logical units to device units; it also defines the orientation of the device's x- and y-axes.

Also, note that nearly all MhOutBox properties are available at design time. This means that you can interactively draw on the control at design time by manipulating the properties in the Properties list, and the image will be saved in the form file. For those boolean properties that operate like methods (SaveMetaFile, CopyToClip, PasteFromClip, EndPage, etc.), you can double click on the property to force the corresponding action at design time. The property will then revert back to False after the action is carried out.

Bitmap size within an Outbox is affected by WindowExtX, WindowExtY, AutoSize and EraseForRead properties. Final effective bitmap size is also affected by the viewport scaling. The Outbox viewport is the full physical placement and extent of the box (image). Use ViewportExtX and ViewportExtY to control size. Use ViewportOrgX and ViewportOrgY to control placement of the final box. The window is the logical view.

The AutoSize property determines whether an Outbox is fitted to the size of a picture you load. If AutoSize and EraseForRead are both True, any previous contents are discarded and the Outbox is resized to fit the loaded picture. If AutoSize is True and EraseForRead is False, the loaded picture is stretched to fill the Outbox. If AutoSize is False, neither the picture nor the Outbox is resized. Resizing an Outbox with AutoSize set to False will update the window extents (WindowExtX and WindowExtY). Resizing with AutoSize set to True will not update the window extents.

If you increase window extent properties (i.e., set WindowExtX or WindowExtY or resize with AutoSize set to False) and later decrease the values, the control will remember the largest size reached and scale accordingly. Size information is reinitialized by a ClearBox (or Clear), by loading a picture with AutoSize and EraseForRead set to True, or by a resize event. If you write to the clipboard or a metafile, most programs will clip and size to the limits of the window extent properties, which can miss showing portions of the image you see in the Outbox. Reading a metafile with EraseForRead set to False updates the Outbox window values if the origin or extent read is larger than previously seen. Remember WindowOrg and WindowExt are logical coordinates. ViewportOrg and ViewportExt are physical coordinates. WindowExtX and WindowExtY values are width and height, not right and bottom.

The preferred MapMode is Anisotropic and the preferred units are HI_METRIC. This combination fits best with clipboard and metafile conventions. Most other MapModes are not valid for the clipboard. Treatment of clearing and backcolor are different for Anisotropic than for other MapMode settings. Anisotropic Clear writes a record to the working metafile that will be adjusted later for any change in size so the backcolor from the time of the clear will always fill the Outbox. Clearing in all other MapMode settings clears the on-screen Outbox to the backcolor but doesn't write to the working metafile; a resize will lose BackColor.

Just changing BackColor does not retroactively fill in the background of the Outbox. The Outbox will be filled with the BackColor only on a clear or a read or load of a picture with EraseForRead set to True.

Only one palette in the working metafile is supported. The first bitmap with a palette that is read supplies that palette. Bitmaps read later will have their palettes ignored.

The following sequence is recommended to create an Outbox (metafile) containing several bitmaps of the same size: Set AutoSize and EraseForRead to True. Use LoadPicture for the first bitmap (if you are using palettes, the palette you want used for all should be in the first bitmap you load). If you want to see the results as you go, resize the Outbox to an area large enough to see all your bitmaps when each is the same size as the first while AutoSize is still True. Set both AutoSize and EraseForRead to False.

Repeat:

  Set .WindowOrgX and .WindowOrgY to values for where

  to put  the upper left corner of the next bitmap you

  plan to use.

  .LoadPicture for your next bitmap.

EndRepeat

Resize the Outbox to your final size. This resizing with AutoSize set to False will adjust origins and extents in a way that will allow other applications to see the whole set of bitmaps if copied through the clipboard or a disk metafile. Until this resizing, the window extents have values from the first bitmap that cause many applications to only show the first bitmap after a paste or read.

To work with bitmaps of different sizes, set AutoSize to False after the first bitmap is read and set WindowExtX and WindowExtY to the size you want each later bitmap to use just before reading the bitmap. This allows you to put a smaller bitmap on top of (in front of) a larger one. If you don't set the extents, each bitmap read will stretch to fill the window, completely hiding any previous images.

Text in a WMF created by Outbox tends to get scaled strangely in printing even if it looks OK on screen unless it is created with window extent values consistent with the TEXT MapMode. One way to force this is in the sample program code for the Text command button. Set the MapMode to text, calculate what the windows size should be based on the MapRatios in this mode, set the MapMode back to Anisotropic, then set the WindowExtents to the calculated values:

MhOutbox1.MapMode = 1

x1 = MhOutbox1.ViewportExtX * MhOutbox1.MapRatioX

y1 = MhOutbox1.ViewportExtY * MhOutbox1.MapRatioY

MhOutbox1.MapMode = 8

' we are setting the window values to text mode pixels in the box

MhOutbox1.WindowExtX = Int(x1)

MhOutbox1.WindowExtY = Int(y1)

The default HiMetric values for the window extents are better for graphics because they give you a larger range of integers to work with. If you are using much text, these scaled down window extents are safer.

Because Outbox is built on Windows metafiles, it suffers from their limitations. Text handling, especially scaling, in metafiles is very weak. It is almost unusable in most MapMode settings and only tolerable in Anisotropic and Text modes. If you will be doing much work with text, experiment extensively to determine what sizes on screen and printer you need and what you will get with various combinations of screen and printer viewports and windows. If you use ExtTextOut mode 8, what gets written to the working metafile is a set of one-line ExtTextOut calls with line breaks and text metrics appropriate to the current display at the time of the ExtTextOut call. Use this carefully.

All the shape properties (Arc, BCircle, BLine, Chord, etc.) take string arguments of sets of integers separated by at least one space (or comma).

To control the position of a bitmap or text within Outbox, the TextOut and ExtTextOut properties give the coordinates at which to place the current text. The behavior of the placement is affected by the settings of the TextAlignCP, TextAlignH and TextAlignV properties.

To change the Outbox font in code, set

Controlname.FontName = [An Installed Font Name].

You cannot scale a metafile in the Outbox. Metafiles loaded from disk or pasted from the clipboard are used whole, with all their internal scaling. See AutoSize, EraseForRead, WindowExtX and WindowExtY.

Changing WindowExt values changes the logical size of the Outbox. Changing ViewPortExt values changes the physical size of the Outbox. The physical size and the ratio of logical to physical are two different kinds of zoom.

The Outbox can print an area that is not visible. How much you see or print is controlled by the window and viewport variables and how well your image fits your window. If parts of your image extend outside your window, they will get clipped. If your printer viewport is larger than your screen viewport, more will show.

The ColorPrint property determines whether any fill or background colors are sent to the printer. When it is False, no color settings go to the printer. This eliminates all but the outlines of shapes and prevents loss of readability due to dithering on many monochrome printers. When the property ColorPrint is FALSE, CreateBrushIndirect, PatBlt, SetBkColor and SetTextColor GDI calls are all suppressed when the working metafile is being played to a printer device context. This means no

fills, even black, will be printed.

To print a multi-page Outbox, the EndPage or EndOfDoc property must be set to trigger the Outbox to write to most OutContext settings except the screen. The name EndDoc is reserved in VB and could not be used. That is why EndPage was used. The property EndPageIsEndDoc defaults to TRUE to keep older code using EndPage working correctly. To do a multi-page document, set EndPageIsEndDoc to FALSE, set the EndPage property to TRUE for each page, then set EndOfDoc to TRUE to print the whole document. Setting EndPageIsEndDoc back to TRUE and setting EndPage to TRUE will also print the whole document.

Note:  The MhOutBox controls includes nine Callable routines (beginning with the letters MhOb) that can be used in place of certain shape- and line-related properties. For Declare statements and examples on how to use these routines, please see the example project.

Note:  If you load bitmaps that contain palettes into MhOutBox, the GDI will not release the palettes correctly, taking down GDI resource by 2/10ths of 1% per run/end cycle. Microsoft has confirmed this as a known Windows bug concerning metafiles (which is the storage format used by MhOutBox) and that it will be fixed in a future version of Windows. (Note: See MSDN CDROM Article #: Q98268 for further information). Only bitmaps containing palettes cause this problem. Non-palettized bitmaps don't exhibit this behavior.


MhHistograph: AutoSize

Description

The AutoSize property sets or returns whether the control should automatically size the picture area when a bitmap is assigned to the Picture property. The valid settings for the AutoSize property follow:

Setting	Description

True (-1)	The control adjusts its height to fit the height of the bitmap and the PaperLength to fit the width of the bitmap. Note that MhHistograph never sets the value of the PaperLength property to be less than the control's width.

False (0)	(Default) The control will retain its current Height and PaperLength.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhHistograph: FillColor

Description

The FillColor property sets or returns the background color of the paper in the plotter if you don't specify a value for the Picture property.

Syntax

ctlname.FillColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhHistograph: GraphClear

Description

The GraphClear property indicates whether the graph paper is cleared when the paper rolls over.

There may be times when you want to move the graph paper without clearing it, but maintain a roll over clear when you start collecting data again. Do this by setting GraphClear to zero. Move the paper and look at the graph. Move the paper back to the original position and set GraphClear to two.  Start collecting data again. Using the 2 setting will allow the current data to remain on the graph, but allow the graph to clear data on roll over.

Caution:  Note that the PaperLength property determines the size of the graph paper. After the MhHistograph control plots data for this length of paper, the paper wraps around to the beginning of the roll. To avoid erasing part of the current screen image when you set the GraphClear property to True, you should set PaperLength to a value at least 2 times the width of the control. This gives the MhHistograph control enough off screen paper for it to clear without affecting the portions of the paper you can see.

The valid settings for the GraphClear property follow:

Setting	Description

0	(Default) Never Clear.

1	Immediately clear the graph paper and clear it each time the paper rolls over.

2	Clear only on roll-over.

Syntax

ctlname.GraphClear = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PaperLength


MhHistograph: GraphPosition

Description

The GraphPosition property sets or returns the graph paper position, expressed in the current ScaleMode. When you specify GraphPosition, you're setting the location of the paper at the right side of the control. The default value is zero. The range is zero to PaperLength. You can use the GraphPosition property to move the paper in either direction.

Caution:  Your code must allow for the paper to roll over. In other words, to continue displaying the chart data smoothly when you reach the end (PaperLength) of the paper you should reset the GraphPosition to zero and set PenMoveTo at the appropriate location so it's ready to continue drawing at the beginning of the paper. Use PenMoveTo or PenMoveToArr to reposition the pen so MhHistograph doesn't draw a line across the chart. If you set GraphPosition to a value greater than PaperLength, you'll get an error.

Syntax

ctlname.GraphPosition = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

ScaleMode


MhHistograph: GridColor

Description

The GridColor property sets or returns the color of the grid that is drawn (according to the PaperStyle property) on the paper. This value is ignored if you load a bitmap into the Picture property.

Syntax

ctlname.GridColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PaperStyle, Picture


MhHistograph: Max

Description

The Max property sets or returns the maximum value you may assign to the PenMoveTo or PenLineTo properties. The default value is 100. The range is zero to 32,767.

Syntax

ctlname.Max = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Min


MhHistograph: Min

Description

The Min property sets or returns the minimum value you may assign to the PenMoveTo or PenLineTo properties. The default is zero. The range is zero to 32,767.

Syntax

ctlname.Min = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Max


MhHistograph: PaperLength

Description

The PaperLength property sets or returns the length, expressed in the current ScaleMode, of the graph paper on which the graph is drawn. The default value is two times the width of the control. The range is Width to 32,767.

Syntax

ctlname.PaperLength = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

ScaleMode


MhHistograph: PaperStyle

Description

The PaperStyle property sets or returns the type of scale lines displayed on the graph paper if you don't specify a bitmap for the Picture property. The valid settings for the PaperStyle property follow:

Setting	Description

0	(Default) Blank paper.

1	Tick marks — small lines at the edge of the paper perpendicular to the motion of the paper.

2	Time lines — lines that extend the length of the paper perpendicular to the motion of the paper.

3	Value lines — lines that run in the same direction as the paper, used to delineate the value.

4	Display both time and value lines.

Note:  If you specify a value for the Picture property, MhHistograph ignores the PaperStyle value.

Syntax

ctlname.PaperStyle = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Picture


MhHistograph: Pen

Description

The Pen property sets or returns which pen is affected when you assign a value to the PenMoveTo, PenWidth, PenColor, or PenLineTo properties. The default value is zero. The range is zero to Pens - 1.

Syntax

ctlname.Pen = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PenColor, Pens


MhHistograph: PenColor

Description

The PenColor property sets or returns the color used by the pen specified by the Pen property.

Syntax

ctlname.PenColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Run-Time Read

Run-Time Write

See Also

Pen, PenColorArr


MhHistograph: PenColorArr

Description

The PenColorArr property sets or returns the color used by the pen specified by the array element number.

Syntax

ctlname.PenColorArr(element) = colorvalue&

Data Type

Long Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

PenColor


MhHistograph: PenLineTo

Description

The PenLineTo property draws a line on the graph from the last data position to the specified position. This property sets or returns the position of the drawing pen specified by the Pen property. The default value is Min. The range is Min through Max.

Syntax

ctlname.PenLineTo = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Pen, PenLineToArr, PenMoveTo


MhHistograph: PenLineToArr

Description

The PenLineToArr property draws a line on the graph from the last data position to this position. This property sets or returns the position of the drawing pen specified by the array element number. The default value is Min. The range is Min through Max.

Syntax

ctlname.PenLineToArr(element) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

PenLineTo, PenMoveToArr


MhHistograph: PenMoveTo

Description

The PenMoveTo property moves the pen to the specified position on the graph without drawing a line from the pen's last position. This property sets or returns the position of the drawing pen specified by the Pen property. The default value is Min. The range is Min through Max.

Syntax

ctlname.PenMoveTo = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Pen, PenLineTo


MhHistograph: PenMoveToArr

Description

The PenMoveToArr property moves the pen to this position on the graph without drawing a line from the pen's last position. This property sets or returns the position of the drawing pen specified by the array element number. The default value is Min. The range is Min through Max.

Syntax

ctlname.PenMoveToArr(element) = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

PenLineToArr


MhHistograph: Pens

Description

The Pens property sets or returns the number of drawing pens available to the control. The default value is one. The range is 1 to 100.

Syntax

ctlname.Pens = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

Pen


MhHistograph: PenWidth

Description

The PenWidth property sets or returns the drawing width, expressed in the current ScaleMode, of the pen specified by the Pen property number. The default value is one pixel. The range is one to 32,767.

Syntax

ctlname.PenWidth = setting%

Data Type

Integer

Availability

Run-Time Read

Run-Time Write

See Also

Pen, PenColor, ScaleMode


MhHistograph: PenWidthArr

Description

The PenWidthArr property sets or returns the drawing width, expressed in the current ScaleMode, of the pen specified by the array element. The default value is one pixel. The range is one to 32,767.

Syntax

ctlname.PenWidthArr(element) = setting%

Data Type

Integer Array

Availability

Run-Time Read

Run-Time Write

See Also

ScaleMode


MhHistograph: Picture

Description

The Picture property sets or returns the image displayed in the paper portion of the control. If you think of the MhHistograph control as a plotter that uses a roll of paper, then this bitmap defines the appearance of the surface of the blank roll of paper — that is, a roll of paper before you plot any lines on it. You can use the Picture property to display a custom paper design. If you don't specify a bitmap, the control uses the PaperStyle property to determine the appearance of the paper.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PaperStyle


MhHistograph: PictureMask

Description

The PictureMask property sets or returns the bitmap used (in combination with the PicturePen property) to draw the pen or indicator on the plotter. Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PictureMask property equal to the picture property of another control.  By default, there is no picture loaded. Write-only at design time. At run time, this property returns the picture's handle.

If you don't specify a bitmap, the control doesn't display any drawing pens.

Syntax

ctlname.PictureMask = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PicturePen


MhHistograph: PicturePen

Description

The PicturePen property sets or returns the bitmap used (in combination with the PictureMask property) to draw the pen or indicator on the plotter.

Usage is the same as the standard VB Picture property. You can use the LoadPicture function or set the PicturePen property equal to the picture property of another control. By default, there is no picture loaded.  Write-only at design time. At run time, this property returns the picture's handle.

Note that when no picture is loaded, the control doesn't display any drawing pens.

The pen bitmap represents the stylus or the drawing object of the graph. The mask bitmap determines which portions of the pen bitmap are visible and which portions allow the background to show through. Make sure the two bitmaps are the same size. As you design the bitmaps, picture them displayed one on top of one another.

Draw the mask using black and white only. Use black where you want to see the pen and white where you want to see the background show through. For information on creating these types of bitmaps, please refer to the MhSlide control, where we discuss the slide bitmap and the mask bitmap.

Syntax

ctlname.PicturePen = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

PictureMask


MhHistograph: ScaleMode

Description

The ScaleMode property sets or returns the scale of measurement for the control. The valid settings for the ScaleMode property follow:

Setting	Description

1	Twips

3	(Default) Pixels

Syntax

ctlname.ScaleMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

GraphPosition, PaperLength


MhHistograph: XDivisions

Description

The XDivisions property sets or returns the number of lines or marks to place on the paper in the X direction. The default value is 20. The range is zero to 32,767. Note that the entire length of the paper roll is used when MhHistograph draws these marks.

Syntax

ctlname.XDivisions = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

YDivisions


MhHistograph: YDivisions

Description

The YDivisions property sets or returns the number of lines or marks to place on the paper in the Y direction.

Syntax

ctlname.YDivisions = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write

See Also

XDivisions


MhHistograph: Overview

The MhHistograph control is a specialized picture box control that lets you display information as if it were being drawn on a plotter. The MhHistograph control lets you create charts by simulating a plotter.  You can plot data along a time line and move the paper forward and backward in the plotter to view or draw on different sections of the paper. The following figure shows an example MhHistograph control. The following table provides an overview of the MhHistograph control.

MhHistograph Control Example.

MhHistograph Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhHist16.OCX MhHist32.OCX MHHI200.VBX	MhHistograph	See the  MHHIST sample directory.	N/A	N/A

Development Notes

Before and during the plotting of data on the control, you must assign a value to the GraphPosition property to set the X-Axis position for the graph paper. Think of the graph paper as a loop whose ends have been taped together. As the paper feeds through the control, MhHistograph draws the chart on it.  When you reach the end of the paper (defined by the PaperLength property), you must reset the GraphPosition property to a value between zero and PaperLength.

Use the GraphClear property to determine if the paper is cleared each time it loops through the control or if MhHistograph continues to display new data on top of the old data.

Data can be plotted on an MhHistograph control in two ways, both of which involve the Penxxx properties. In the first method, you first set the Pen property to the number of the pen whose characteristics you wish to set. Once you set Pen, you can then use the PenColor, PenLineTo, PenMoveTo, and PenWidth properties to direct the operations of the MhHistograph control. The PenColor property determines the color of the line drawn. PenWidth sets the width of the line. When you assign a value (representing the new location of the pen) to the PenLineTo property, MhHistograph will draw a line from the current value to the new value. If you want to move the pen to a new location without drawing a line, assign a new value to the PenMoveTo property.

The PenColorArr, PenLineToArr, PenMoveToArr, and PenWidthArr properties provide a second method you can use to draw on MhHistograph controls. These properties are arrays that allow you to address individual pens by element number.

The following instructions initialize an MhHistograph control and plot four lines on it, using both types of Penxxxx properties:

'Set MhHisto to clear paper each time it rolls over

MhHisto1.GraphClear = 1

'Initialize the graph paper position

MhHisto1.GraphPosition = 0

'Use the .Penxxxx properties for the .Pen 0

MhHisto1.Pen = 0           	'Pick pen to set values

MhHisto1.PenColor = &HFF&     	'Set color of pen 0

MhHisto1.PenWidth = 2         	'Set pen width to 2

MhHisto1.PenMoveTo = 50       	'Set initial position to 50

'Now use the .Penxxxx array properties to draw the graph lines for pen 0.

MhHisto1.GraphPosition = 10   	'Move graph paper to 10

MhHisto1.PenLineToArr(0) = 60 	'Draw line from 50 to 60

MhHisto1.GraphPosition = 20   	'Move graph paper to 20

MhHisto1.PenLineToArr(0) = 70 	'Draw line from 60 to 70

MhHisto1.GraphPosition = 30   	'Move graph paper to 30

MhHisto1.PenLineToArr(0) = 40 	'Draw line from 70 to 40

There are two ways to specify an image for the paper on which MhHistograph draws: you can specify a custom bitmap with the Picture property, or you can set the PaperStyle property to display one of the built-in designs. If you specify a custom bitmap, MhHistograph ignores the PaperStyle property.

You can display custom pens on an MhHistograph control by setting the PictureMask and PicturePen properties to bitmaps.

If you specify picture files for the Picture, PictureMask, or PicturePen properties during design mode, VB includes those files in your .EXE file when you compile your program. However, if you want to specify the bitmaps at run time, be sure to make the files accessible when you run your program. If you don't, you'll receive a File not found error when you try to load the files.

Note:  MhHistograph combines the PicturePen and the PictureMask bitmaps so that the background or the graph shows through certain portions of the pen. For information on creating these types of bitmaps, please refer to the MhSlide control.

The MhHistograph control can also display a grid of horizontal and vertical lines automatically. You specify the number of grid lines with the XDivisions and YDivisions properties.


MhInvisible: Overview
MhInvisible_Overview

The MhInvisible control lets you create a control that can be used to generate events for portions of a form or another control.

The MhInvisible custom control is an invisible control that you can place on top of forms or other controls to intercept and react to the standard set of events. The control is useful when you want a control or form to react to events based on the location on the control or form where the event occurred. The following table provides an overview of the MhInvisible control.

MhInvisible Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhInvi16.OCX MhInvi32.OCX MHIV200.VBX	MhInvisible	See the MHINVI sample directory.	N/A	MhCallBack MhDragDrop MhStretch
Development Notes

Even though the MhInvisible control is invisible when you run your applications, it displays sizing handles at design-time so you can identify and manipulate it. Don't worry about losing track of it at design time. It obscures the control that you place it on (making it easier to find) and you can <Tab> to it.

In the sample project, we placed MhInvisible controls over selected continents of a picture of the Earth. When you click on a continent (where an MhInvisible control is strategically placed), the program displays information about the continent.


MhTimer: Overview

The MhTimer control is a replacement for the Timer control included with Visual Basic. The following table provides an overview of the MhTimer control.

MhTimer Control Overview.

Control Icon	File Name	Class Name	Example(s)	At a Glance...	See Also
	MhTime16.OCX MhTime32.OCX MHTM200.VBX	MhTimer	See the MHTIME sample directory.	N/A	MhAlarm, MhClock
Development Notes

You'll want to use an MhTimer control whenever you need a timer control since all instances of MhTimer work from one Windows Timer resource. This means you aren't restricted to the 15 timers you're limited to with the standard Visual Basic Timer control (in Windows 3.0). In addition, if you need a large number of timers, our control produces Timer events much more consistently than Visual Basic's Timer control.

Because we have named the MhTimer properties and events the same as the standard VB Timer control, it is easy to update existing applications with MhTimer controls. The steps to replace a Timer control follow:

-..Load the project containing the Timer control(s) you want to replace.

-..Add the appropriate Timer file to the project.

-..Display the form containing the Timer control.

-..Add an MhTimer to the form.

-..Set the new control's properties the same as the control you are replacing.

-  Delete the Timer control. When you do this, Visual Basic will place all of the Timer's event procedure code into the general area of the form.

-  Rename the MhTimer control to the Name of the original Timer control. VB will reattach the code that belonged to the original Timer control to the new MhTimer control.


Standard: Alignment
Alignment

Description

The Alignment property determines the alignment of a check box, option button, or text in a control. The Alignment property settings for the option button and check box follow:

Setting	Description

0	(Default) Control aligns to the left with text on the right.

1	Control aligns to the right with text on the left.

The Alignment property settings for a label and text box follow:

Setting	Description

0	(Default) Text aligns to the left.

1	Text aligns to the right.

2	Text aligns to the center (in Microsoft Windows version 3.0, aligns to the left).

If the MultiLine property of a text box is False, the Alignment property is ignored.

Syntax

ctlname.Alignment = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read


Standard: Archive
Archive

Description

The Archive property determine whether a file list box contains files with Archive attributes. The settings for the Archive property follow:

Setting	Description

True	Displays files with the archive attribute in the file list box.

False	Does not display files with the archive attribute in the file list box.

Syntax

ctlname.Archive = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: AutoSize
AutoSize

Description

Returns or sets a value that determines whether a control is automatically resized to display its entire contents. The settings for the AutoSize property follow:

Setting	Description

True	Automatically resizes the control to display its entire contents.

False	(Default) Keeps the size of the control constant.

Syntax

ctlname.AutoSize = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: BackColor
BackColor

Description

The BackColor property determines the background color of an object. Visual Basic uses the Microsoft Windows environment RGB scheme for colors.

Syntax

ctlname.BackColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: BorderStyle
BorderStyle

Description

Returns or sets the border style for a control.

Setting	Description

0	None.

1	Fixed single.

Syntax

ctlname.BorderStyle = value%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Caption
Caption

Description

The Caption property determines the text displayed in the form's title bar. When the form is minimized, this text is displayed below the form's icon. The Caption property also determines the text displayed in or next to a control.

Syntax

ctlname.Caption = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: ControlBox
ControlBox

Description

Returns or sets a value indicating whether a Control-menu box is displayed on a form at run time.

Syntax

ctlname.ControlBox = boolean%

Setting	Description

True	(Default) Displays the Control-menu box.

False	Removes the Control-menu box.

Data Type

Boolean

Availability

Design-Time

Run-Time Read


Standard: DataChanged
DataChanged

Description

The DataChanged property indicates that the data in the control has been changed by some process other than getting data from the current record. The settings for the DataChanged property follow:

Setting	Description

True	The data currently in the control is not the same as in the current record.

False	(Default) The data currently in the control, if any, is the same as the data in the current record.

Syntax

ctlname.DataChanged = boolean%

Data Type

Boolean

Availability

Run-Time Read

Run-Time Write


Standard: DataField
DataField

Description

The DataField property binds a control to a field. Bound controls provide access to specific data in a database. Each bound control typically displays the value of a different field in the current record. The DataSource property of a bound control specifies a valid data control name.

Syntax

ctlname.DataField = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: DataSource
DataSource

Description

The DataSource property determines the data control through which the current control is bound to a database. To bind a control to a field in a database at run time, you must specify a data control in this property at design time.

Syntax

ctlname.DataSource = string

Data Type

String

Availability

Design-Time


Standard: DragIcon
DragIcon

Description

The DragIcon property determines the icon to be displayed as the pointer in a drag-and-drop operation. The settings for the DragIcon property follow:

Setting	Description

(none)	(Default) An arrow pointer inside a rectangle.

Icon	A custom mouse pointer.

Syntax

ctlname.DragIcon = icon

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: DragMode
DragMode

Description

The DragMode property determines the dragging mode for a drag-and-drop operation. The settings for the DragMode property follow:

Setting	Description

0	(Default) Manual. Requires using the Drag method to initiate dragging on the source control.

1	Automatic. Clicking the source control automatically initiates dragging.

Syntax

ctlname.DragMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Drive
Drive

Description

The Drive property determines the selected drive at run time.

Syntax

ctlname.Drive = string$

Data Type

String

Availability

Run-Time Read

Run-Time Write


Standard: Enabled
Enabled

Description

The Enabled property determines whether the form or control can respond to user-generated events. The settings for the Enabled property follow:

Setting	Description

True	(Default) Allows the object to respond to events.

False	Prevents the object from responding to events.

Syntax

ctlname.Enabled = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FileName
FileName

Description

Returns or sets the path and filename of a selected file.

Syntax

ctlname.FileName = String$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Font
Font

Description

Returns a Font object.

Use the Font property of an object to identify a specific Font object whose properties you want to use.  For example, the following code changes the Bold property setting of a Font object identified by the Font property of a TextBox object:

txtFirstName.Font.Bold = True

Syntax

ctlname.Font.property = value

Data Type

Object

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontBold
FontBold

Description

The FontBold property determines whether the font used in the control includes the bold style. The settings for the FontBold property follow:

Setting	Description

True	The font includes the bold style.

False	The font does not include the bold style.

Syntax

ctlname.FontBold = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontItalic
FontItalic

Description

The FontItalic property determines whether the font used in the control includes the italic style. The settings for the FontItalic property follow:

Setting	Description

True	The font includes the italic style.

False	The font does not include the italic style.

Syntax

ctlname.FontItalic = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontName
FontName

Description

The FontName property specifies the font used to display text in a control or in a run-time drawing or printing operation.

Syntax

ctlname.FontName = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontSize
FontSize

Description

The FontSize property specifies the size of the font to be used for text displayed in a control or in a run-time drawing or printing operation.

Syntax

ctlname.FontSize = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontStrikeThru
FontStrikeThru

Description

The FontStrikeThru property determines whether the font used in the control includes the strikethrough style. The settings for the FontStrikeThru property follow:

Setting	Description

True	The font includes the strikethrough style.

False	The font does not include the strikethrough style.

Syntax

ctlname.FontStrikeThru = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontTransparent
FontTransparent

Description

The FontTransparent property determines whether background text or graphics are included with the characters in a particular font.

Setting	Description

True	The font includes background text and graphics.

False	The font does not include background text and graphics.

Syntax

ctlname.FontTransparent = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: FontUnderline
FontUnderline

Description

The FontUnderline property determines whether the font used in the control includes the underline style. The settings for the FontUnderline property follow:

Setting	Description

True	The font includes the underline style.

False	The font does not include the underline style.

Syntax

ctlname.FontUnderline = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: ForeColor
ForeColor

Description

The ForeColor determines the foreground color used to display text and graphics in an object. Visual Basic uses the Microsoft Windows environment RGB scheme for colors.

Syntax

ctlname.ForeColor = colorvalue&

Data Type

Long Integer, OLE_COLOR

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Height
Height

Description

The Height property determine the height of an object. The height is determined as follows:

Object	Description

Form	The external height of the form, including the borders and title bar.

Control	Measured from the center of the control's border so that controls with different border widths align correctly. Height uses the scale units of a control's container.

Printer object	The physical dimensions of the paper set up for the printing device.

Screen object	The height of the screen.

Syntax

ctlname.Height = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: HelpContextID
HelpContextID

Description

The HelpContextID property defines an associated context number for an object. This property is used to provide context-sensitive Help for your application.

Syntax

ctlname.HelpContextID = contextID&

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Hidden
Hidden

Description

The Hidden property determine whether a file list box contains files with Hidden attributes. The settings for the Hidden property follow:

Setting	Description

True	Displays files with the hidden attribute in the file list box.

False	Does not display files with the hidden attribute in the file list box.

Syntax

ctlname.Hidden = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: hWnd
hWnd

Description

The hWnd property specifies a handle to a form or control.

Syntax

ctlname.hWnd = handle%

Data Type

Integer

Availability

Run-Time Read


Standard: Icon
Icon

Description

The Icon property determines the icon displayed for a form at run time when the form is minimized.

Syntax

ctlname.Icon = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Index
Index

Description

The Index property specifies a number that uniquely identifies a control in a control array. This property is only available when the control is part of a control array.

Syntax

ctlname.Index = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Interval
Interval

Description

The Interval property determines the number of milliseconds between calls to a timer control's Timer event. The default value of 0 disables the timer.

Syntax

ctlname.Interval = setting%

Data Type

Long Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: ItemData
ItemData

Description

Returns or sets a specific number for each item in a control.

Syntax

ctlname.ItemData(index) = number&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write


Standard: Left
Left

Description

The Left property determines the distance between the internal left edge of an object and the left edge of its container. For a form, the Left property is always expressed in twips. For a control, they are measured in units according to the coordinate system of its container.

Syntax

ctlname.Left = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: LinkItem
LinkItem

Description

The LinkItem property defines the data passed to a destination control in a DDE conversation. This property corresponds to the item argument in the standard DDE syntax, with application, topic, and item as arguments.

Syntax

ctlname.LinkItem = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: LinkMode
LinkMode

Description

The LinkMode property determines the type of link used for a DDE conversation and activates the connection.

Syntax

ctlname.LinkMode = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: LinkTimeOut
LinkTimeOut

Description

The LinkTimeOut property determines the amount of time (in tenths of a second) a control waits for a response to a DDE message. The default is value is 50, which is 5 seconds

Syntax

ctlname.LinkTimeOut = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: LinkTopic
LinkTopic

Description

The LinkTopic property differs for destination controls and source forms. For a destination control, LinkTopic determines the source application and the topic. Use LinkTopic with the LinkItem property to specify the complete data link. For a source form, LinkTopic determines the topic to respond to in a DDE conversation.

Syntax

ctlname.LinkTopic = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: List
List

Description

The List property determines the items contained in a control's list portion. The list is a string array in which each element is a list item.

Syntax

ctlname.List (element) = string$

Data Type

String Array

Availability

Run-Time Read


Standard: ListCount
ListCount

Description

The ListCount property specifies the number of items in the list portion of a control.

Syntax

ctlname.ListCount = setting%

Data Type

Integer

Availability

Run-Time Read


Standard: ListIndex
ListIndex

Description

The ListIndex property specifies the index of the currently selected item in the control.

Syntax

ctlname.ListIndex = setting%

Data Type

Integer

Availability

Run-Time Read


Standard: MaxButton
MaxButton

Description

The MaxButton property indicates whether a form has a Maximize button. The settings for the MaxButton property follow:

Setting	Description

True	(Default) The form has a Maximize button.

False	The form does not have a Maximize button.

Syntax

ctlname.MaxButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read


Standard: MinButton
MinButton

Description

The MinButton property indicates whether a form has a Minimize button. The settings for the MinButton property follow:

Setting	Description

True	(Default) The form has a Minimize button.

False	The form does not have a Minimize button.

Syntax

ctlname.MinButton = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read


Standard: MouseIcon
MouseIcon

Description

Sets a custom mouse icon.

The MouseIcon property provides a custom icon that is used when the MousePointer property is set to 99.

Syntax

ctlname.MouseIcon = LoadPicture(pathname)

ctlname.MouseIcon = picture

Data Type

Picture

Availability

Design-Time

Run-Time Write


Standard: MousePointer
MousePointer

Description

The MousePointer property specifies the type of mouse pointer displayed when the mouse is over a particular part of a form or control at run time. The settings for the MousePointer property follow:

Setting	Description

0	(Default) Shape determined by the control

1	Arrow

2	Cross (cross-hair pointer)

3	I-Beam

4	Icon (small square within a square)

5	Size (four-pointed arrow pointing north, south, east, west)

6	Size NE SW (double arrow pointing northeast and southwest)

7	Size N S (double arrow pointing north and south)

8	Size NW SE (double arrow pointing northwest and southeast)

9	Size W E (double arrow pointing west and east)

10	Up Arrow

11	Hourglass (wait)

12	No Drop

Syntax

ctlname.MousePointer = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Name
Name

Description

The Name property specifies the name used in code to identify a form, control, or data access object.

Syntax

ctlname.Name = string%

Data Type

String

Availability

Design-Time


Standard: Normal
Normal

Description

The Normal property determine whether a file list box contains files with Normal attributes. The settings for the Normal property follow:

Setting	Description

True	Displays files with the normal attribute in the file list box.

False	Does not display files with the normal attribute in the file list box.

Syntax

ctlname.Normal = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Parent
Parent

Description

The Parent property specifies the form on which a control is located.

Syntax

ctlname.Parent = form

Data Type

Form

Availability

Run-Time Read


Standard: Path
Path

Description

The Path property determines the current absolute path, including the drive name.

Syntax

ctlname.Path = string$

Data Type

String

Availability

Run-Time Read

Run-Time Write


Standard: Pattern
Pattern

Description

The Pattern property determines which file names (*.*, *.TXT, etc) are displayed in a file list box at run time.

Syntax

ctlname.Pattern = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Picture
Picture

Description

The Picture property specifies the graphic to be displayed in a control.

Syntax

ctlname.Picture = picture

Data Type

Picture

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: ReadOnly
ReadOnly

Description

The ReadOnly property varies for data control and file list boxes. For data controls, ReadOnly determines whether the control's database is opened for read-only access. For file list boxes, ReadOnly determines whether a file list box contains files with ReadOnly attributes.

Syntax

ctlname.ReadOnly = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: ScrollBars
ScrollBars

Description

The ScrollBars property indicates whether an object has horizontal or vertical scroll bars. The settings for the ScrollBars property follow:

Setting	Description

True	The form has a horizontal or vertical scroll bar, or both.

False	The form has no scroll bars.

Syntax

ctlname.ScrollBars = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read


Standard: SelLength
SelLength

Description

The SelLength property determines the number of characters selected in a combo or text box.

Syntax

ctlname.SelLength = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write


Standard: SelStart
SelStart

Description

The SelStart property determines the starting point of selected text and indicates the position of the insertion point if no text is selected.

Syntax

ctlname.SelStart = setting&

Data Type

Long Integer

Availability

Run-Time Read

Run-Time Write


Standard: SelText
SelText

Description

The SelText property determines the string containing the currently selected text. SelText is an empty string ("") if no characters are selected.

Syntax

ctlname.SelText = string$

Data Type

String

Availability

Run-Time Read

Run-Time Write


Standard: Sorted
Sorted

Description

The Sorted property indicates whether the elements of a combo box or list box are automatically sorted alphabetically. The settings for the Sorted property follow:

Setting	Description

True	List items are sorted alphabetically (case-insensitive).

False	(Default) List items are not sorted alphabetically.

Syntax

ctlname.Sorted = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read


Standard: Style
Style

Description

The Style property specifies the type of combo box and the behavior of its list box portion. The settings for the Style property follow:

Setting	Description

0	Dropdown Combo. Includes a drop-down list and an edit area. The user can select from the list or type in the edit area.

1	Simple Combo. Includes an edit area and a list that is always displayed. The user can select from the list or type in the edit area.

2	Dropdown List. This style only allows selection from the drop-down list.

Syntax

ctlname.Style = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read


Standard: System
System

Description

The System property determine whether a file list box contains files with System attributes. The settings for the System property follow:

Setting	Description

True	Displays files with the system attribute in the file list box.

False	Does not display files with the system attribute in the file list box.

Syntax

ctlname.System = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: TabIndex
TabIndex

Description

The TabIndex property determines the tab order of a control within its parent form.

Syntax

ctlname.TabIndex = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: TabStop
TabStop

Description

The TabStop property indicates whether a user can use the Tab key to set the focus to a control.

Setting	Description

True	Designates the control as a tab stop.

False	Bypasses the control when the user is tabbing, although the control still holds its place in the actual tab order, as determined by the TabIndex property.

Syntax

ctlname.TabStop = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Tag
Tag

Description

The Tag property stores any extra data needed for your program. You can use this property to identify objects. By default, the Tag property is set to an empty string ("").

Syntax

ctlname.Tag = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Text
Text

Description

The Text property varies for different combo box, list box, and text box settings. For combo boxes with the Style property set to 0 (Dropdown Combo) or to 1 (Simple Combo) and for text boxes, Text determines the text contained in the edit area.

For combo boxes with the Style property set to 2 (Dropdown List) and list boxes, Text determines the selected item in the list box. The return value is equivalent to the value returned by the expression List(index).

Syntax

ctlname.Text = string$

Data Type

String

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Top
Top

Description

The Top property determines the distance between the internal top edge of an object and the top edge of its container. For a form, the Top property is always expressed in twips. For a control, they are measured in units according to the coordinate system of its container.

Syntax

ctlname.Top = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Value
Value

Description

The Value property sets or returns the state of the control. The Value property has different meanings depending on the type of control. The settings for the Value property for each type of control follow:

Check Box

Setting	Description

0	(Default) Unchecked

1	Checked

2	Grayed

Option Button

Setting	Description

True	Indicates the button is selected.

False	(Default) Indicates the button is not selected.

Syntax

ctlname.Value = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Visible
Visible

Description

The Visible property indicates whether an object is visible or hidden. The settings for the Visible property follow:

Setting	Description

True	(Default) Object is visible.

False	Object is hidden.

Syntax

ctlname.Visible = boolean%

Data Type

Boolean

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Width
Width

Description

The Width property determine the width of an object. The width is determined as follows:

Object	Description

Form	The external width of the form, including the borders and title bar.

Control	Measured from the center of the control's border so that controls with different border widths align correctly. Width uses the scale units of a control's container.

Printer object	The physical dimensions of the paper set up for the printing device.

Screen object	The width of the screen.

Syntax

ctlname.Width = setting!

Data Type

Single Precision

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: WindowState
WindowState

Description

The WindowState property specifies the visual state of a form window at run time. The settings for the WindowState property follow:

Setting	Description

0	(Default) Normal

1	Minimized (shrunk to an icon)

2	Maximized (enlarged to maximum size)

Syntax

ctlname.WindowState = setting%

Data Type

Integer

Availability

Design-Time

Run-Time Read

Run-Time Write


Standard: Change
Change

Description

The Change event indicates that the contents of a control have changed. The following described how and when the Change event occurs with each control:

Control	Description

Combo box	Changes have been made to the text in the text box portion of the control. Occurs only if Style is 0 (Dropdown Combo) or 1 (Simple Combo) and the user changes the text. Also occurs when Text is changed from code.

Directory list box	Changes have been made to the selected directory. Occurs when the user double-clicks a new directory. Also occurs when Path is changed from code.

Drive list box	Changes have been made to the selected drive. Occurs when the user selects a new drive. Also occurs when Drive is changed from code.

Scroll bars	Moves the scroll box portion of the scroll bar. Occurs when the user scrolls. Also occurs when the Value property is changed from code.

Label	Changes have been made to the contents of the label. Occurs when a DDE link updates data. Also occurs when Caption is changed from code.

Picture box	Changes have been made to the contents of the picture box. Occurs when a DDE link updates data. Also occurs when Picture is changed from code.

Text box	Occurs when the user changes the text. Also occurs when Text is changed from code.

Syntax

Sub ctlname_Change (Index As Integer)


Standard: Click
Click

Description

The Click event occurs when the user presses and then releases a mouse button over an object. For a form, Click occurs when the user clicks either a blank area or a disabled control. For a control, this event occurs when the user:

Clicks a control with the left or right mouse button.

Selects an item in a combo box or list box, either by pressing the arrow keys or by clicking the mouse button.

Presses the Spacebar when a command button, option button, or check box has the focus.

Presses Enter when a form has a command button with its Default property set to True.

Presses Esc when a form has a Cancel button or a command button with its Cancel property set to True.

Presses an access key combination for a control.

The Click event can also be triggered in code by:

Setting a command button's Value property to True.

Setting an option button's Value property to True.

Changing a check box's Value property setting.

Syntax

Sub ctlname_Click (Index As Integer)


Standard: DblClick
DblClick

Description

The DblClick event occurs when the user presses and releases a mouse button two time quickly. For a form, DblClick occurs when the user double-clicks a disabled control or a blank area of a form. For a control, DblClick occurs when the user:

Double-clicks a control with the left mouse button.

Double-clicks an item in a combo box (with Style set to 1), in a file list box, or in a list box.

Syntax

Sub ctlname_DblClick (Index As Integer)


Standard: DragDrop
DragDrop

Description

The DragDrop event occurs when a drag-and-drop operation is completed or when the Drag method is used with its Action argument set to 2.

Syntax

Sub ctlname_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)


Standard: DragOver
DragOver

Description

The DragOver event occurs when a drag-and-drop operation is in progress. The event can be used to monitor when the mouse pointer enters, leaves, or is directly over a valid drop target. The mouse pointer position determines which target object receives the DragOver event.

Syntax

Sub ctlname_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)


Standard: DropDown
DropDown

Description

The DropDown event occurs when the list portion of a combo box is about to drop down. The DropDown event does not occur if a combo box's Style property is set to 1 (Simple Combo).

Syntax

Sub ctlname_DropDown (Index As Integer)


Standard: GotFocus
GotFocus

Description

The GotFocus event occurs when an object receives the focus. An object can receive the focus either by user action such as tabbing or clicking the object. This event can also occur when changing the focus in code using the SetFocus method. A form receives the focus only when all visible controls are disabled.

Syntax

Sub ctlname_GotFocus (Index As Integer)


Standard: KeyDown
KeyDown

Description

The KeyDown event occurs when the user presses a key while an object has the focus.

Syntax

Sub ctlname_KeyDown (Index As Integer, KeyCode As Integer, Shift As Integer)


Standard: KeyPress
KeyPress

Description

The KeyPress event occurs when the user presses and releases an ANSI key.

Syntax

Sub control_KeyPress (Index As Integer, KeyAscii As Integer)


Standard: KeyUp
KeyUp

Description

The KeyUp event occurs when the user presses releases a key while an object has the focus.

Syntax

Sub ctlname_KeyUp (Index As Integer, KeyCode As Integer, Shift As Integer)


Standard: LinkClose
LinkClose

Description

The LinkClose event occurs when a DDE conversation terminates. Either application in a DDE conversation may terminate a conversation at any time.

Syntax

Sub ctlname_LinkClose (Index As Integer)


Standard: LinkError
LinkError

Description

The LinkError event occurs when there is an error during a DDE conversation. The error number is passed as an argument.

Syntax

Sub ctlname_LinkError (Index As Integer, LinkErr As Integer)


Standard: LinkNotify
LinkNotify

Description

The LinkNotify event occurs when the source has changed the data defined by the DDE link and the LinkMode property of the destination control is set to 3 (Notify).

Syntax

Sub ctlname_LinkNotify (Index As Integer)


Standard: LinkOpen
LinkOpen

Description

The LinkOpen event occurs when a DDE conversation is being initiated.

Syntax

Sub ctlname_LinkOpen (Index As Integer, Cancel As Integer)


Standard: LostFocus
LostFocus

Description

The LostFocus event occurs when an object loses the focus by user input or through the SetFocus method.

Syntax

Sub ctlname_LostFocus (Index As Integer)


Standard: MouseDown
MouseDown

Description

The MouseDown event occurs when the user presses a mouse button.

Syntax

Sub ctlname_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)


Standard: MouseMove
MouseMove

Description

The MouseMove event occurs when the user moves the mouse.

Syntax

Sub ctlname_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)


Standard: MouseUp
MouseUp

Description

The MouseUp event occurs when the user releases a mouse button.

Syntax

Sub ctlname_MouseUp (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)


Standard: Resize
Resize

Description

The Resize event occurs when a form first appears or the size of an object changes.

Syntax

Sub ctlname_Resize ( )


Standard: AddItem
AddItem

Description

The AddItem method adds a new item to a list box or combo box at run time.

Syntax

control.AddItem item , index

Parameter 	Description

item	String expression to add to the control.

index	Integer representing the position within the control where the new item or row is placed.


Standard: Clear
Clear

Description

The Clear method clears the contents of a list box or combo box.

Syntax

control.Clear


Standard: Drag
Drag

Description

The Drag method begins, ends, or cancels dragging controls.

Syntax

control. Drag action

Parameter	Description

action	0 for cancel dragging, 1 to begin dragging, 2 to end dragging.


Standard: LinkExecute
LinkExecute

Description

The LinkExecute method sends a command string to the other application in a dynamic data exchange (DDE) conversation.

Syntax

control.LinkExecute cmdstring

Parameter	Description

cmdstring	String expression containing a command recognized by the other application. This varies depending on the source application.


Standard: LinkPoke
LinkPoke

Description

The LinkPoke method transfers the contents of a control to the source application in a dynamic data exchange (DDE) conversation.

Syntax

control.LinkPoke


Standard: LinkRequest
LinkRequest

Description

The LinkRequest method requests that the source in a dynamic data exchange (DDE) conversation update the contents of a control.

Syntax

control.LinkRequest


Standard: LinkSend
LinkSend

Description

The LinkSend method transfers the contents of a picture control to the destination application in a dynamic data exchange (DDE) conversation.

Syntax

control.LinkSend


Standard: Move
Move

Description

The Move method moves a form or control.

Syntax

control.Move left, top, width, height

Parameter	Description

left	The horizontal coordinate for the left edge of object.

top	The vertical coordinate for the top edge of object.

width	The new width of object.

height	The new height of object.


Standard: Refresh
Refresh

Description

The Refresh method forces an immediate repaint or update of a form, control, or object.

Syntax

control.Refresh


Standard: RemoveItem
RemoveItem

Description

The RemoveItem method removes an item from a list box or combo box.

Syntax

control.RemoveItem index

Parameter	Description

index	Specifies the position within the control of the item to remove.


Standard: SetFocus
SetFocus

Description

The SetFocus method sets the focus to a form or control.

Syntax

object.SetFocus


Standard: ZOrder
ZOrder

Description

The ZOrder method places a specified form or control at the front or back of the z-order within its graphical level.

Syntax

object.ZOrder position

Parameter	Description

position	Specifies the position of the control relative to other controls. If set to 0, the control is positioned at the front of the z-order. If set to 1, the control appears at the back of the z-order.