Sdílet prostřednictvím


ListBox Class

Definition

Represents a Windows Forms ListBox that can be added to a Microsoft Office Word document.

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

Remarks

The Microsoft.Office.Tools.Word.Controls.ListBox is different from a System.Windows.Forms.ListBox. The Microsoft.Office.Tools.Word.Controls.ListBox has additional members that enable it to be added to a Word document and that give it additional methods and properties.

Do not use the constructor to create a new ListBox. Use the AddListBox method to add a new ListBox to a document.

Properties

AltHTML
Automation
Bottom

Gets the distance, in points, between the bottom edge of the ListBox and the top edge of the document.

Height

Gets or sets the height of the ListBox.

InlineShape

Gets the underlying InlineShape of the ListBox.

Left

Gets or sets the distance, in points, between the left edge of the ListBox and the left edge of the document.

Right

Gets the distance, in points, between the right edge of the ListBox and the left edge of the document.

Shape

Gets the underlying Shape of the ListBox.

Top

Gets or sets the distance, in points, between the top edge of the ListBox and the top edge of the document.

Width

Gets or sets the width of the ListBox in points.

Methods

Activate()

Activates the ListBox.

Delete()

Deletes a dynamically created ListBox from the document and removes it from the ControlCollection.

Select()

Selects the ListBox.

SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
SetVisibleCore(Boolean)

Applies to