property Grid.HTMLPicture(Key as String) as Variant
Adds or replaces a picture in HTML captions.

TypeDescription
Key as String A String expression that indicates the key of the picture being added or replaced. If the Key property is Empty string, the entire collection of pictures is cleared.
Variant The HTMLPicture specifies the picture being associated to a key. It can be one of the followings: 
  • a string expression that indicates the path to the picture file, being loaded. 
  • a string expression that indicates the base64 encoded string that holds a picture object, Use the eximages tool to save your picture as base64 encoded format. 
  • A Picture object that indicates the picture being added or replaced. ( A Picture object implements IPicture interface ), 

If empty, the picture being associated to a key is removed. If the key already exists the new picture is replaced. If the key is not empty, and it doesn't not exist a new picture is added.

The HTMLPicture property handles a collection of custom size picture being displayed in the HTML captions, using the <img> tags. By default, the HTMLPicture collection is empty. Use the HTMLPicture property to add new pictures to be used in HTML captions. For instance, the HTMLPicture("pic1") = "c:\winnt\zapotec.bmp", loads the zapotec picture and associates the pic1 key to it. Any "<img>pic1</img>" sequence in HTML captions, displays the pic1 picture. On return, the HTMLPicture property retrieves a Picture object ( this implements the IPictureDisp interface ).

The following sample shows how to put a custom size picture in the column's header:

<CONTROL>.HTMLPicture("pic1") = "c:/temp/editors.gif"
<CONTROL>.HTMLPicture("pic2") = "c:/temp/editpaste.gif"

<COLUMN1>.HTMLCaption = "A <img>pic1</img>"
<COLUMN2>.HTMLCaption = "B <img>pic2</img>"
<COLUMN3>.HTMLCaption = "A <img>pic1</img> + B <img>pic2</img>"

The screen shot was generated using the following x-script:

BeginUpdate

HTMLPicture("pic1") = "c:/temp/editors.gif"
HTMLPicture("pic2") = "c:/temp/editpaste.gif"

MarkSearchColumn = False
ShowFocusRect = False
LinesAtRoot = -1
HeaderHeight = 38
BackColorHeader = RGB(255,255,255)
HeaderAppearance = 5
BackColor = RGB(255,255,255)

ConditionalFormats
{
	Add("%2 > 15")
	{
		Bold = True
		ForeColor = RGB(0,128,0)
		ApplyTo = 2
	}
	Add("%2 > 10 and %2 < 18")
	{
		Bold = True
		ForeColor = RGB(255,128,0)
		ApplyTo = 2
	}

}
Columns
{
	Add("A")
	{
		Editor.EditType = 4
		HTMLCaption="A pic1"
	}
	Add("B")
	{
		Editor.EditType = 4
		HTMLCaption="B pic2"
	}
	Add("A+B")
	{
		ComputedField = "%0 + %1"
		HTMLCaption = "A pic1 + B pic2"
		HeaderBold = True
		HeaderAlignment = 2
		Alignment = 2
	}
}
Items
{
	Dim h, h1
	h = InsertItem(,,"Group 1")
	CellEditorVisible(h,0) = False
	CellEditorVisible(h,1) = False
	CellValueFormat(h,2) = 1
	h1 = InsertItem(h,,16)
	CellValue(h1,1) = 17
	h1 = InsertItem(h,,2)
	CellValue(h1,1) = 11
	h1 = InsertItem(h,,2)
	CellValue(h1,1) = 9
	ExpandItem(h) = True
	h = InsertItem(,,"Group 2")
	CellEditorVisible(h,0) = False
	CellEditorVisible(h,1) = False
	CellValueFormat(h,2) = 1
	h1 = InsertItem(h,,16)
	CellValue(h1,1) = 9
	h1 = InsertItem(h,,12)
	CellValue(h1,1) = 11
	h1 = InsertItem(h,,2)
	CellValue(h1,1) = 2
	ExpandItem(h) = True
	SelectItem(h) = True
}
EndUpdate