From d97d896ac54b0e7bb3e9f72bf40e2215ca3ee017 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 4 Sep 2018 19:39:22 +1000 Subject: [PATCH] WPF - Tooltip Wrap Wrap the tooltip content in a text block, so that it gets wrapped (was previously going off screen) Related to #2488 --- CefSharp.Example/Resources/TooltipTest.html | 19 ++++++++++++++++--- CefSharp.Wpf/ChromiumWebBrowser.cs | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CefSharp.Example/Resources/TooltipTest.html b/CefSharp.Example/Resources/TooltipTest.html index a6dccac61..3e81a702c 100644 --- a/CefSharp.Example/Resources/TooltipTest.html +++ b/CefSharp.Example/Resources/TooltipTest.html @@ -3,8 +3,8 @@ Tooltip Test - -
+ +

@@ -21,6 +21,19 @@
-
+ + +
+
+ Hover on the link to see a very long tooltip. +
+ Demo https://github.com/cefsharp/CefSharp/issues/2488 +
+
+ Hover HERE +
+
+
+ \ No newline at end of file diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index a19fb1e92..20368e157 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -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;