ToolBar.ToolBarButtonCollection.RemoveAt(Int32) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Removes a given button from the toolbar button collection.
public:
virtual void RemoveAt(int index);
public void RemoveAt(int index);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)
- index
- Int32
The indexed location of the ToolBarButton in the collection.
The index
value is less than 0, or it is greater than the number of buttons in the collection.
The following code example removes the last ToolBarButton on a ToolBar. The index value of the toolbar button being removed is set equal to the Count property, minus one, since the ToolBarButton collection is a zero-based index.
public:
void RemoveMyButton()
{
int btns;
btns = toolBar1->Buttons->Count;
// Remove the last toolbar button.
toolBar1->Buttons->RemoveAt( btns - 1 );
}
public void RemoveMyButton()
{
int btns;
btns = toolBar1.Buttons.Count;
// Remove the last toolbar button.
toolBar1.Buttons.RemoveAt(btns - 1);
}
Public Sub RemoveMyButton()
Dim btns As Integer
btns = toolBar1.Buttons.Count
' Remove the last toolbar button.
toolBar1.Buttons.RemoveAt(btns - 1)
End Sub
The Remove method removes the ToolBarButton at the specified location in the ToolBar.ToolBarButtonCollection. If you want to remove all ToolBarButton controls from the collection, use the Clear method.
Продукт | Версии |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 10 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: