0

How can I disable the visual style only for the tooltip, not for all the application, because if I do so it will change my toolstrip visual style and it will look ugly?

What I have:

stupid tooltip

What I want:

better tooltip

For some reason it just won't work. Thanks everybody.

3
  • Are you create a webpage or a application? Commented Jun 25, 2012 at 2:18
  • Have you viewed this documentation? msdn.microsoft.com/en-us/library/… Commented Jun 25, 2012 at 2:21
  • I saw it already but I can't find any clue on disabling the visual style on the tooltip. I'm using WinForms. Commented Jun 25, 2012 at 2:26

2 Answers 2

2

I believe you are going to want to look into using the Tooltip.OwnerDraw Property. The example program in the MSDN Link has a style like what you are wanting.

Sign up to request clarification or add additional context in comments.

Comments

0

If you're looking for a WPF solution you'll want to override the default template for the ToolTip. Mark Hall's answer is correct if you're looking for a WinForms solution.

Update: Posted this before the comment was added and the question was re-tagged as WinForms. I leave it here for anyone looking for a WPF solution.

XAML:

<ToolTip>
    <ToolTip.Style>
        <Style TargetType="{x:Type ToolTip}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border Background="LightGoldenrodYellow" BorderBrush="DimGray" BorderThickness=".5" Padding="5">
                            <TextBlock Text="This is text"/>
                        </Border>
                    </ControlTemplate>                                  
                </Setter.Value>
            </Setter>
        </Style>
    </ToolTip.Style>
</ToolTip>

Comments

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.