共用方式為


ComboBox Class

Definition

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

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

Remarks

The Microsoft.Office.Tools.Excel.Controls.ComboBox is different from a System.Windows.Forms.ComboBox. The Microsoft.Office.Tools.Excel.Controls.ComboBox 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 ComboBox. Use the AddComboBox method to add a new ComboBox to a worksheet.

Properties

AltHTML
Application

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

Border

Gets a Border that represents the border of the ComboBox.

Bottom

Gets the distance, in points, between the bottom edge of the ComboBox 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 ComboBox.

Creator

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

Height

Gets or sets the height of the ComboBox.

Index

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

Interior

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

Left

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

Locked

Gets or sets a value that indicates whether the ComboBox 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 ComboBox.

Placement

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

PrintObject

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

Right

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

ShapeRange

Gets a ShapeRange object that represents the ComboBox.

SourceName

Gets or sets the link source name of the ComboBox.

Top

Gets or sets the distance, in points, between the top edge of the ComboBox 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 ComboBox.

Visible

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

Width

Gets or sets the width of the ComboBox in points.

ZOrder

Gets the z-order position of the ComboBox.

Methods

Activate()

Activates the ComboBox.

BringToFront()

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

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Copies the ComboBox to the Clipboard as a picture.

Delete()

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

Select(Object)

Selects the ComboBox.

SendToBack()

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

SetVisibleCore(Boolean)

Sets the ComboBox to the specified visible state.

Update()

Applies to