How to create a text collecor in wpf?

Sarah 186 Reputation points

I would like to recreate the following image in WPF. A text is added via a TextBox and an Add button. The special thing about this is that each added text should have a cross to delete this text again and a frame with a colored background.


I have no idea how to do this. Maybe someone has an approach or example?

Any help is appreciated

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,686 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Hui Liu-MSFT 40,866 Reputation points Microsoft Vendor

    The solution of Viorel-1 is great. I made the sample code below. You could try to refer to it.



    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.