SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the picture object as a color sample.
object
SampleColor
Defines the color sample. For information about color properties, please visit the applicable section "Using SftBox/OCX with ...".
FrameColor
Defines the border color. For information about color properties, please visit the applicable section "Using SftBox/OCX with ...".
The SetColorSample method defines the picture object as a color sample.
The SftPictureObject.Type property is set to sftTypeColorSample.
The SftPictureObject.Height and SftPictureObject.Width properties should be used to define the requested image size.
The color sample can also be defined using the SftPictureObject.SampleColor and SftPictureObject.FrameColor properties.
oneCell = box.get_Cell(addColor, 0) ' get the first cell oneCell.Image.Height = 13 If box Is SftBox2 Then oneCell.Image.Width = 26 Else oneCell.Image.Width = 13 End If oneCell.Image.SetColorSample(OLECvt.ToOleColor(color), OLECvt.ToOleColor(color.Black)) ' set the cell's color sample ' We'll save the color value in the cell's Data property so ' we can use the Items.FindCellData method if needed oneCell.Data = ColorTranslator.ToWin32(color) End Sub Private Sub AddColors(ByVal box As AxSftBoxLib50.AxSftBox) AddColor(box, "Black", Color.Black)
Set OneCell = Box.Cell(AddColor, 0) ' get the first cell OneCell.Image.Height = 13 If Box Is SftBox2 Then OneCell.Image.Width = 26 Else OneCell.Image.Width = 13 End If OneCell.Image.SetColorSample color, vbBlack ' set the cell's color sample ' We'll save the color value in the cell's Data property so ' we can use the Items.FindCellData method if needed OneCell.Data = color End Function
int addColor = box.Items.Add(Text); // add a new item oneCell = box.get_Cell(addColor, 0); // get the first cell oneCell.Image.Height = 13; oneCell.Image.Width = 13; if (box == SftBox2) oneCell.Image.Width = 26; else oneCell.Image.Width = 13; oneCell.Image.SetColorSample(OLECvt.ToOleColor(color), OLECvt.ToOleColor(Color.Black)); // set the cell's color sample // We'll save the color value in the cell's Data property so // we can use the Items.FindCellData method if needed oneCell.Data = ColorTranslator.ToWin32(color); } private void AddColors(AxSftBoxLib50.AxSftBox box) {
if (fSmallSample) { OneCell->Image->Height = 13; OneCell->Image->Width = 26; } else { OneCell->Image->Height = 13; OneCell->Image->Width = 13; } OneCell->Image->SetColorSample(color, RGB(0,0,0)); // set the cell's color sample // We'll save the color value in the cell's Data property so // we can use the Items.FindCellData method if needed OneCell->Data = color; } void CColorsDlg::AddColors(ISftBoxPtr vCombo, BOOL fSmallSample) { AddColor(vCombo, fSmallSample, "Black", RGB(0,0,0));
See Also SftPictureObject Object | Object Hierarchy