WPF点击用户控件中的按钮,从StackPanel中移除这个用户控件
<UserControlx:Class="Demo.List"********d:DesignHeight="25"d:DesignWidth="250"><StackP...
<UserControl x:Class="Demo.List"
********
d:DesignHeight="25" d:DesignWidth="250">
<StackPanel Orientation="Horizontal">
<TextBox Name="TextBox" Height="25" Width="225"/>
<Button Content="X" Height="25" Width="25" Name="Close"/>
</StackPanel>
</UserControl>
private void Window_Loaded(object sender, RoutedEventArgs e)
{
for (int i = 0; i < 5; i++)
{
List list = new List();
ListPanel.Children.Add(list);
}
}
点击按钮,从StackPanel中移除这个用户控件
private void Close_Click(object sender, RoutedEventArgs e)
{
} 展开
********
d:DesignHeight="25" d:DesignWidth="250">
<StackPanel Orientation="Horizontal">
<TextBox Name="TextBox" Height="25" Width="225"/>
<Button Content="X" Height="25" Width="25" Name="Close"/>
</StackPanel>
</UserControl>
private void Window_Loaded(object sender, RoutedEventArgs e)
{
for (int i = 0; i < 5; i++)
{
List list = new List();
ListPanel.Children.Add(list);
}
}
点击按钮,从StackPanel中移除这个用户控件
private void Close_Click(object sender, RoutedEventArgs e)
{
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询