I am using a picture box in my C# application, I want it to cover a certain portion of the web browser (the username part on youtube).
I have a 21.5" monitor and this is what it looks like to me:
But then this is what it looks like to one of my users with a 24" monitor:
As you can see the position of the picture box has moved up due to that persons screen size (I believe)
Is there a way to make sure that it will always be over that section of the web browser or moving it to that section of the web browser?
Thanks.
I am convinced your approach is wrong and would break anytime either for screen resolution or size changes, or for using the mouse-wheel to zoom in/out the page or whatever. it is just unreliable and patching this by overlapping another UI control like a picture box or a panel on top of what you want to hide is simply insecure and unreliable.
I think the tow real options you have are these:
You try to interpret the page content and remove from the page's DOM the information you do not want to show to the user (eventually HTML Agility Pack could help for this DOM parsing and manipulation but I am not sure if you can read what the WebBrowser control is showing and inject changes into it);
use the YouTube APIs and Tools - .NET APIs to load the videos and details you want to load and show but rendering this information with your specific UI elements in your windows forms application, without using a browser to show the normal YouTube site.
Probably the second option takes more work but is more secure, I am not sure 100%, as I said, if the first option is viable at all. You could search for HTML Agility Pack and web browser control to see if anybody has done this before already :)
Related
I tried WebBrowser but any solution related to WebBrowser I find uses the exact same codes, WebBrowser.DrawToBitmap
Problem with that is, it gives out inaccurate results depending on URL, to what page actually would look like, sometimes even blank pages.
So I am looking for any alternate solution to WebBrowser if there is any.
It needs to run in background, as in not open any browser on screen, render it in background with all scripts and get an image.
If I understand what you're trying to do, you might be interested in a framework called PhantomJS, which is a WebKit "browser" engine which runs the pages without visually rendering them. It can be used to capture screens.
Now this technique requires JavaScript, but there is something called Selenium WebDriver to help you wrapping that. Users here at SO posted a simple example and this comment looks useful as it contains the list of required Packages.
There are many applications out there that are displaying html content using XAML controls rather than displaying a web browser. Does anyone know if there is control used for this? If no control is available, what's the best way to do this?
I found this article but that seems to be overkill... Or is it?
http://thewp7dev.wordpress.com/2012/03/05/html-textblock/
I would like to keep the exact format of a web page (i.e. text, images, formatting, etc...) but I'd like if possible at all not use the web browser.
I have a pivot that requires 4 websites to be displayed but it would seem very heavy to create 4 web browser, not to mention I'd like to add different touch functionality that I'm struggling to do using the web browser.
I'd appreciate any feedback.
Thanks
There is no XAML controls for windows phone, except WebBrowser Control (WebView in WP8.1), which can display HTML as it is.
Your article describes exactly what you have to do, to display HTML in some other XAML controls (RichTextBox for example).
You have to parse HTML to XAML format. You can use thrid party components for this (HTML agility Pack http://htmlagilitypack.codeplex.com/) or implement your own parsing.
Also, I don't think, that combining WebBrowser control with Pivot (or Panorama) is a good idea, because it just consumes to much memory and there could be problems with scrolling and touch interaction.
The simple path I think is to reconsider your navigation model and use webbrowser control to display HTML. Maybe you can provide one WebBrowser and 4 links on top to switch between souces.
I haven't looked into it very much but am struggling to find relevant information on the topic. I basically want to create a browser that applies a filter to a webpage by changing colors in a webpage. My guess is that I will have to change the html once loaded or something, would this work? Do I have other options?
PS. I don't just want to make every color darker, I would more like to invert the colors.
Edit:
If any you were wondering, I am talking about the XAML browser component that can be used in a Windows Phone application.
I think the simplest way to do that is to inject some Javascript into your page once it has loaded.
To do that, you need to set the IsScriptEnabled to true on your WebBrowser control and then subscribe to the Navigated event.
When that event occurs you can inject some JS codeby using the WebBrowser.InvokeScript method.
Here is an example of JS code that darken the page : JavaScript: Invert color on all elements of a page
If you are talking about in a PC internet browser, you can find an add-on to execute Javascript automatically, such as Greasemonkey for Firefox. If you are talking about Windows Phone's Internet Explorer, I don't really know what you could do there, as I don't think they allow add-ons.
I am currently playing a little bit around with the development environment. At the moment I am writing a small app, which adresses a Webbrowser-Control.
Therefore I was looking for an opportunity, to show the URL-bar and maybe manipulating the URL via input of the user. Is this anyway possible, or not implemented for the webbrowser control?
Thanks in advance!
The WebBrowser control itself doesn't have a URL bar. It is simply a control that has the ability to display HTML and run Javascript. The easiest way way to simulate one would be to create a textbox. You can then use its Navigate method to load the webpage:
myWebBrowserControl.Navigate(myTextboxUrl.Text);
Alternatively, you can use the WebBrowserTask, but your app loses all control of the user's activities within this task.
I think it'd be easier to just launch the web browser task directly. Customizing the URL bar would probably require rolling your own.
Here's a related question about opening the browser: Open webbrowser with specific url in WP7
I am developing asp.net with c#web application.
I want to have a control in ASP.net that has text formatting controls as well as a ruler to edit the text which i enter in text area. It would be great if i can open Msword in a web browser without Save buttons at the client side.The data must be saved into the database.
The control should be similar to the one which i get while writing this question.and also e.g gmail compose mail.
My main aim is to provide right and left indentation to the text that is being entered and i want to preview on A4 size paper.
Please guide me someone the way to proceed.I got Htmleditor ajax control but it doesnot have a ruler.
You may take a look at WMD (this is what you are using for typing this question). You could also take a look at the many other alternative editors and pick one that suits your needs.