[XAML]
<TextBlock x:Name="myTextBlock" Width="100" Height="40">
<Button>Test</Button>
</TextBlock>
[C#]
Button btn = new Button();
btn.Content = "Test";
this.myTextBlock.Inlines.Add(btn);
转载:https://www.syncfusion.com/faq/860/how-do-i-embed-a-button-into-a-textbox