tags:

views:

250

answers:

1

I know how to change the tooltip in the xaml side of things, but does anybody know a great solution to do this in C#?

+3  A: 

Say you have a button like this:

    <Button x:Name="btnOne" Content="How to grow big and strong?">
        <Button.ToolTip>
            <ToolTip>
                Eat your veggies
            </ToolTip>
        </Button.ToolTip>
    </Button>

you can change it like this:

    var tip = ToolTipService.GetToolTip(this.btnOne) as ToolTip;
    tip.Background = new SolidColorBrush(Colors.Magenta);
Software.Developer
I didnt know of the ToolTipService.GetToolTip . Thanks!
Redburn