Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple line tool tip in wpf using c#

Tags:

wpf

c#-4.0

I want to use multiple line tool tip in wpf but thie is look like

line 1 
    line2

but i want to display this miltiple line tool tip in the given format

line 1
line 2
like image 356
abhi294074 Avatar asked Dec 02 '22 00:12

abhi294074


2 Answers

I personally prefer to embed 
(new line) into the strings I'll be using as tooltips.

ex. Tooltip="line 1 
line 2"

I can then load the strings from resource files and conveniently apply them if I wish without having to go through any additional formatting.

like image 130
dk123 Avatar answered Dec 20 '22 17:12

dk123


Here is a way to do it with a Label as an example:

<Label>
    <Label.ToolTip>
        <StackPanel>
             <TextBlock>Line 1</TextBlock>
             <TextBlock>Line 2</TextBlock>
        </StackPanel>
    </Label.ToolTip>
</Label>
like image 41
RQDQ Avatar answered Dec 20 '22 19:12

RQDQ