UIElementCollection.Insert(Int32, UIElement) Yöntem
Tanım
Belirtilen dizin konumundaki öğesine bir öğesi ekler UIElementCollection .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)
Parametreler
- index
- Int32
Öğeyi eklemek istediğiniz dizin konumu.The index position where you want to insert the element.
- element
- UIElement
İçine eklenecek öğe UIElementCollection .The element to insert into the UIElementCollection.
Örnekler
Aşağıdaki örnek, Insert belirtilen dizin konumunda alt içerik eklemek için yöntemini kullanır.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);
}