PictureBox Class

Definition

Represents a Windows Forms PictureBox that can be added to a Microsoft Office Excel worksheet.

public ref class PictureBox : System::Windows::Forms::PictureBox
[System.ComponentModel.DefaultEvent("Click")]
[System.ComponentModel.DefaultProperty("Image")]
[System.ComponentModel.ToolboxItem(false)]
public class PictureBox : System.Windows.Forms.PictureBox
[<System.ComponentModel.DefaultEvent("Click")>]
[<System.ComponentModel.DefaultProperty("Image")>]
[<System.ComponentModel.ToolboxItem(false)>]
type PictureBox = class
    inherit PictureBox
Public Class PictureBox
Inherits PictureBox
Inheritance
PictureBox
Attributes

Remarks

The Microsoft.Office.Tools.Excel.Controls.PictureBox is different from a System.Windows.Forms.PictureBox. The Microsoft.Office.Tools.Excel.Controls.PictureBox has additional members that enable it to be added to an Excel worksheet and that give it additional methods and properties.

Do not use the New constructor to create a new PictureBox. Use the AddPictureBox method to add a new PictureBox to a worksheet.

Properties

AltHTML
Application

Gets an Application object that represents the creator of the PictureBox.

Border

Gets a Border that represents the border of the PictureBox.

Bottom

Gets the distance, in points, between the bottom edge of the PictureBox and the top edge of the worksheet.

BottomRightCell

Gets a Range object that represents the cell that lies under the lower-right corner of the PictureBox.

Creator

Gets a value that indicates the application in which the PictureBox was created.

Height

Gets or sets the height of the PictureBox.

Index

Gets the index number of the PictureBox within the collection of OLEObjects on the sheet.

Interior

Gets an Interior object that represents the interior of the PictureBox.

Left

Gets or sets the distance, in points, between the left edge of the PictureBox and the left edge of the worksheet.

Locked

Gets or sets a value that indicates whether the PictureBox can be modified at design time when the sheet is protected.

OLEType

Gets a value that represents the OLE object type.

OnAction
Parent

Gets the parent object for the PictureBox.

Placement

Gets or sets an object that indicates the way the PictureBox is attached to the cells below it.

PrintObject

Gets or sets a value that indicates whether the PictureBox is printed when the worksheet is printed.

Right

Gets the distance, in points, between the right edge of the PictureBox and the left edge of the worksheet.

ShapeRange

Gets a ShapeRange object that represents the PictureBox.

SourceName

Gets or sets the link source name of the PictureBox.

Top

Gets or sets the distance, in points, between the top edge of the PictureBox and the top edge of the worksheet.

TopLeftCell

Gets a Range object that represents the cell that lies under the upper-left corner of the PictureBox.

Visible

Gets or sets a value that represents whether the PictureBox is visible.

Width

Gets or sets the width of the PictureBox in points.

ZOrder

Gets the z-order position of the PictureBox.

Methods

Activate()

Activates the PictureBox.

BringToFront()

Brings the PictureBox to the front of the z-order.

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Copies the PictureBox to the Clipboard as a picture.

Delete()

Deletes a dynamically created PictureBox from the worksheet and removes it from the ControlCollection.

Select(Object)

Selects the PictureBox.

SendToBack()

Sends the PictureBox to the back of the z-order.

SetVisibleCore(Boolean)

Sets the PictureBox to the specified visible state.

Update()

Applies to