Share via


CellPicture Property (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns or sets an image to be displayed in the current cell or range of cells. This property is not available at design time.

Syntax

object.CellPicture [=picture]

The CellPicture property syntax has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
picture A bitmap, icon, or metafile graphic. This can be assigned to another control's Picture property.

Remarks

You can set this property at run time using the LoadPicture function on a bitmap, icon, or metafile or by assigning to it another control's Picture property.

Changing this property affects the current cell or the current selection, depending on the setting of the FillStyle property.

Each cell might contain text and a picture. The relative position of the text and picture is determined by the CellAlignment and CellPictureAlignment properties.

Example

The following example loads icons from the Microsoft® Visual Basic® icon library into two cells within a ModHFGrid. You can use any two icons. Paste the code into the Declarations section of a form that contains the ModHFGrid. Press F5 to run the program, and then click the form.

Private Sub Form_Click ()
   ' Load the icons.
   ModHFGrid1.Row =1
   ModHFGrid1.Col =1
   Set ModHFGrid1.CellPicture =_
   LoadPicture("Icons\Computer\Trash02a.ico")
   ModHFGrid1.Row =1
   ModHFGrid1.Col =2
   Set ModHFGrid1.CellPicture =_
   LoadPicture("Icons\Computer\Trash02b.ico")
End Sub

See Also

CellAlignment Property (ModHFGrid) | CellPictureAlignment Property (ModHFGrid) | FillStyle Property (ModHFGrid) | ModHFGrid Control