Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxCell.SetColorSample Method

Defines a color sample as the cell's picture component.

Deprecated - Provided for compatibility with earlier versions only - Use Cell.Image.SampleColor instead

Syntax

VB.NETobject.SetColorSample(ByVal WidthPix As Integer, ByVal HeightPix As Integer, ByVal Sample As UInt32, ByVal Border As UInt32)
VBobject.SetColorSample(ByVal WidthPix As Integer, ByVal HeightPix As Integer, ByVal Sample As OLE_COLOR, ByVal Border As OLE_COLOR)
C#.NETvoid object.SetColorSample(int WidthPix, int HeightPix, uint Sample, uint Border);
VC++HRESULT object->SetColorSample(int WidthPix, int HeightPix, OLE_COLOR Sample, OLE_COLOR Border);
CHRESULT object->raw_SetColorSample(int WidthPix, int HeightPix, OLE_COLOR Sample, OLE_COLOR Border);

object

A SftBoxCell object.

WidthPix

Defines the width of the color sample, in pixels.

HeightPix

Defines the height of the color sample, in pixels.

Sample

Defines the color used to fill the color sample. Based on the number of available colors of the display device used, a dithered color sample may be shown instead of the exact color.

Border

Returns the color used to frame the color sample with a border 1 pixel wide. If -1 is used, the color sample has no border. The HeightPix and WidthPix parameters define the overall size of the color sample, including the border (if used).

Comments

Deprecated - Provided for compatibility with earlier versions only - Use Cell.Image.SampleColor instead

The SetColorSample method defines a color sample as the cell's picture component.

A cell picture component can be used to display a color sample, a small framed box filled with the specified color.

When defining a color sample using the SetColorSample method, the Cell.Image property is cleared.

In a fixed height combo box control, all cell picture graphics (i.e. all color samples and pictures) must be the same size (height and width). The dimensions of the graphics are used to calculate the minimum required height for all items, so graphics and text are never clipped vertically. To change the size of all colors samples and cell graphics used, they must be removed first using the Items.ClearCellImages method.

In a variable height combo box control, the graphics can be of varying sizes. The item height is automatically adjusted so graphics are never clipped vertically.

The Items.ClearCellImages method can be used to remove all cell graphics. To remove an individual cell picture, set the property to Nothing (0, null, NULL).

The position of the cell graphics is determined by the Cell.ImageHAlign and Cell.ImageVAlign properties.

See Also SftBoxCell Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.