UIElementCollection.Insert(Int32, UIElement) Method
Definition
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.
Inserts an element into a UIElementCollection at the specified index position.
public:
virtual void Insert(int index, System::Windows::UIElement ^ element);
public virtual void Insert (int index, System.Windows.UIElement element);
abstract member Insert : int * System.Windows.UIElement -> unit
override this.Insert : int * System.Windows.UIElement -> unit
Public Overridable Sub Insert (index As Integer, element As UIElement)
Parameters
- index
- Int32
The index position where you want to insert the element.
- element
- UIElement
The element to insert into the UIElementCollection.
Examples
The following example uses the Insert method to insert child content at a specified index position.
void InsertControls(object sender, RoutedEventArgs e)
{
btn2 = new Button();
btn2.Content = "Inserted Button";
sp1.Children.Insert(1, btn2);
}
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET