Change scrollbar appearance in WPF control

930 views
Skip to first unread message

Liwen Guo

unread,
Mar 22, 2013, 12:25:13 PM3/22/13
to cefs...@googlegroups.com
Hi there,

I'm looking for a way to re-template the WPF WebView control, specifically I want to change how the scrollbar looks. However, when I use the WPF Tree Visualizer the whole browser content, including the scrollbar, shows up as an Image element, which makes me believe that this isn't possible here. Am I overlooking something or is there some other way to do this?

anthony taranto

unread,
Mar 22, 2013, 2:50:01 PM3/22/13
to cefs...@googlegroups.com
This is possible. The Github windows desktop app uses a CefSharp web view with custom scrollbars.

The WPF WebView control is in fact just an image. Chromium itself is drawing the native windows scrollbar as part of the image. You'll have to place the WebView image within your scroll view (the one with the scroll bar that you want), and force the WebView itself to have a height that is tall enough to prevent chromium from thinking it needs to draw the scrollbar.

--Anthony

On Fri, Mar 22, 2013 at 9:25 AM, Liwen Guo <l...@livven.me> wrote:
Hi there,

I'm looking for a way to re-template the WPF WebView control, specifically I want to change how the scrollbar looks. However, when I use the WPF Tree Visualizer the whole browser content, including the scrollbar, shows up as an Image element, which makes me believe that this isn't possible here. Am I overlooking something or is there some other way to do this?

--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Israel Rodriguez

unread,
Jul 21, 2014, 7:37:36 PM7/21/14
to cefs...@googlegroups.com
But this is not good when a website has fixed header - my case..

Michael Bodekaer

unread,
Aug 2, 2014, 6:19:40 AM8/2/14
to cefs...@googlegroups.com
Hey Anthony,

Is there an easy way to have the height of the WPF WebControl adjust according to the content height automatically?
In the past, I've had to use Javascript to detect the body.clientHeight, and then resize the WebControl but that is just very unreliable due to the many ways HTML content can be rendered and positioned.
Reply all
Reply to author
Forward
0 new messages