I'm using a WebBrowser control to show some dynamic content from a web service. I've noticed that the WebBrowser in the app doesn't have scroll bars so the user doesn't know how much they have scrolled relative to the length of the page. My xaml for this control is very basic, I'm not doing anything to it. I've noticed that IE on the phone does show scroll bars. Does this control not support scroll bars?
<browser:WebBrowser x:Name="webBrowser" />
Unfortunately, the WP7 WebBrowser control does not provide scrollbars. I can see that there are good reasons why this might be useful, so you should probably raise a feature request/bug report on the App Hub.
Related
I am using web browser control in wpf c#.
I have render html in web browser control which width have more than windows width.
then It's displaying scroll bar.
so I need scroll width,or width of html body.
if any one have solution please help me.
The control can be windows web browser control or WPF web browser control.
ScrollRectangle will get the dimensions of the scrollable region
IEWb.Document.Body.ScrollRectangle.Height;
IEWb.Document.Body.ScrollRectangle.Width;
I'm using the datarepeater that comes with the visual basic power pack in a winforms application. The problem I'm having is that the control doesn't allow swiping inside the container to scroll up and down. You can still use the scroll bar itself, but the width of the scroll bar is too skinny and is hard to get a hold of sometimes. This baffles me, because swipe scrolling on all the other winforms controls seems to work fine. This is probably a longshot, but can anybody help me?
My task is to show HTML content with half-transparent elements in WPF app. Transparency should go through Webbrowser and window. Webbrowser should not be half-transparent itself.
So i need a HTML content, and i need to see desktop through it.
Is there any way to do something like that?
Thank you.
P.S.: Sorry for my English.
Awesomium and Awesomium.NET is an HTML UI Engine that supports just that.
Check the WPF WebControl. You can set WebControl.IsTransparent to true, and load some content with say body { background-color: transparent; } (you can even specify a custom CSS to be applied to all loaded pages, using WebSession).
This isn't currently possible; this is due to the way that the Web Browser control is rendered. It isn't really a true WPF control but a WPF wrapper around a COM component. This limits the functionality available and also causes other problems, such as the lack of ability to float WPF controls over the top of it.
I believe there is a new WebView control coming for Windows 8.1 apps (demoed at Build 2013). This may provide more flexibility, although I'm not sure if this is a Windows 8.1 app thing or whether it will also be available to WPF apps as part of .NET 4.5.1.
The WPF Web Browser control is technically a wrapped WinForms WebBrowser Control, so it is rendered in the WinForms layer, which is always above the WPF layer.you can use Awesomium.NET Browser instead IE Browser or convert your Html code to Xmal code and show in Flow Document control.WPF Flow Document For Beginners
Is there any way to prevent the scroll out of page of the WebBrowser in windows phone 8?
I don't know if my question is clear so i give you an example
If i navigate to StackOverflow inside a webbrowser, even if I'm on top of the page I'm able to scroll up.
This make the topmost menu go down revealing a white block in the part over the menu.
I'm scrolling outside the page.
When I release the scroll the page return to the right position
Is there any way to prevent scrolling outside the page?
Take note that I want to still be able to scroll but i want the scroll to stop when I'm on top
Hope my english is clear
there is not very much code I can share, that's the standard way for WebBrowser to handle the scroll and I can't find a way to override that
<phone:WebBrowser Source="http://stackoverflow.com/questions/ask"/>
start application, scroll up
you will see that the top menu scroll down.
Is there any way to prevent the scroll outside of bound?
Ok for other people reference, I respond my question
There's no easy way to do that since the manipulation events are swallowed by the webbrowser.
I found this link http://www.scottlogic.co.uk/blog/colin/2011/12/a-simple-multi-page-windows-phone-7-phonegap-example/
which provide some library to get the manipulation event from the WebBrowser
To resolve the problem you (and I) still need to create an algorithm for the manipulationDelta event which I'm not sure is even feasible...
I am developing an application where I need to drag and drop a browser in my wp7 screen.So
can any body tel me how can we drag and drop a web browser control in a wp7 screen
Code Examples will do good to me
Thank You
Just declare a web browser control in XAML. Designer drag-drop functionality is not the best approach if you are arranging controls on any container, other then Canvas.
Usage would be like this;
<StackPanel>
<WebBrowser .../>
</StackPanel>
If you are talking about allowing the user to be able to drag the control within the running app then you can't do this with the control directly and still allow touch manipulation of the content. You could do this by putting a transparent control over the top of the WebBrowser and making that draggable and duplicating the movements of this transparent control to update the WebBrowser's position.
Such behaviour in an app would likely be very unusual and I'd recommend testing such interaction with users thoroughly and also exploring other ways of achieving the same result.
The easiest way to handle drag and drop in the Web Browser control is to handle the Navigate event. You can also capture drop operations inside of the the actual HTML document using window.ondrop but if you need to capture full filenames the Navigate event on the control in the .NET host application is your best bet.
For more detail on how this work take a look at this blog post:
https://weblog.west-wind.com/posts/2017/Mar/10/Dragging-and-Dropping-Images-and-Files-into-the-Web-Browser-Control