2

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#?

1 Answer 1

5

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);
Sign up to request clarification or add additional context in comments.

1 Comment

I didnt know of the ToolTipService.GetToolTip . Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.