WPF - Tooltip Wrap

Wrap the tooltip content in a text block, so that it gets wrapped (was previously going off screen)

Related to #2488
This commit is contained in:
amaitland
2018-09-04 19:39:22 +10:00
parent 8327adb18c
commit d97d896ac5
2 changed files with 17 additions and 4 deletions
+16 -3
View File
@@ -3,8 +3,8 @@
<head>
<title>Tooltip Test</title>
</head>
<body style="width:500px;">
<form>
<body>
<div style="width:500px;">
<input type="text" size=25 title="This is the first tooltip">
<br />
<input type="text" size=25 title="This is the second tooltip">
@@ -21,6 +21,19 @@
<option>four</option>
</select>
</div>
</form>
</div>
<div>
<div style="float:left;width:60%;">
Hover on the link to see a very long tooltip.
<br />
Demo https://github.com/cefsharp/CefSharp/issues/2488
</div>
<div style="float:left;width:39%;" title="Credit check failed: Settlement risk overflow (PosFlows), group AllDeals ( LLOYDS TSB ), Counterparty VSMPOTIRUS, pillar Inf, 16/08/2018: over bound. by 70,787.Credit check failed: Settlement risk overflow (PosFlows), group AllDeals ( LLOYDS TSB ), Counterparty VSMPOTIRUS, pillar Inf, 16/08/2018: over bound. by 70,787.Credit check failed: Settlement risk overflow (PosFlows), group AllDeals ( LLOYDS TSB ), Counterparty VSMPOTIRUS, pillar Inf, 16/08/2018: over bound. by 70,787.Credit check failed: Settlement risk overflow (PosFlows), group AllDeals ( LLOYDS TSB ), Counterparty VSMPOTIRUS, pillar Inf, 16/08/2018: over bound. by 70,787.Credit check failed: Settlement risk overflow (PosFlows), group AllDeals ( LLOYDS TSB ), Counterparty VSMPOTIRUS, pillar Inf, 16/08/2018: over bound. by 70,787.1234567890">
Hover HERE
</div>
<div style="clear:both;"></div>
</div>
</body>
</html>
+1 -1
View File
@@ -1985,7 +1985,7 @@ namespace CefSharp.Wpf
toolTip.IsOpen = false;
}
toolTip.Content = text;
toolTip.Content = new TextBlock { Text = text, TextWrapping = TextWrapping.Wrap };
toolTip.Placement = PlacementMode.Mouse;
toolTip.Visibility = Visibility.Visible;
toolTip.IsOpen = true;