WPF更改c#代码中的工具提示背景
我知道如何更改xaml方面的工具提示,但是有人知道在C#中实现这一点的好方法吗?假设您有这样一个按钮:WPF更改c#代码中的工具提示背景,c#,wpf,tooltip,C#,Wpf,Tooltip,我知道如何更改xaml方面的工具提示,但是有人知道在C#中实现这一点的好方法吗?假设您有这样一个按钮: <Button x:Name="btnOne" Content="How to grow big and strong?"> <Button.ToolTip> <ToolTip> Eat your veggies </ToolTip>
<Button x:Name="btnOne" Content="How to grow big and strong?">
<Button.ToolTip>
<ToolTip>
Eat your veggies
</ToolTip>
</Button.ToolTip>
</Button>
var tip = ToolTipService.GetToolTip(this.btnOne) as ToolTip;
tip.Background = new SolidColorBrush(Colors.Magenta);
我不知道ToolTipService.GetToolTip。谢谢