1
I have in my wpf code a listbox with the name "lstBox" (I left it invisible), and inside it a listBoxItem with a label and a textbox . Outside the listbox , in the same window I have a button " add item " (when clicking would be visible the listbox). I would like every click on this button to create a new listboxItem with the same face as I already created in wpf code inside lstBox and this just invisible. Can someone help me ?
<Grid>
<ListBox
Name="lstBox"
Margin="0,191,51,46">
<ListBoxItem
Name="lstboxitem"
HorizontalAlignment="Left"
Height="78"
VerticalAlignment="Top"
Width="167"
Background="#FFE8B0B0"/>
</ListBox>
<Button Margin="664,206,76,396" Click="Button_Click_1"
/>
</Grid>
Could post an excerpt of the code used for a larger view of the problem?
– Pilati
I edited the question by also posting the shamanic code that I have made. Need that when clicking the button with the click event, my listbox has more a listboxitem exactly like the one I have already created in the shampoo
– Mateus Rocha