有什么方法可以动态设置 WP7 Webbrowser 控件高度并锁定滚动? [英] Any way to set the WP7 Webbrowser control height Dynamically and lock scrolling?

查看:22
本文介绍了有什么方法可以动态设置 WP7 Webbrowser 控件高度并锁定滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 WebBrowser 控件中显示一个 html 字符串,但它可以是可变长度的,并且不是屏幕上唯一的内容.所以,我需要能够设置与消息的实际内容相对应的宽度.

I need to display a html string in a WebBrowser control, but it can be of variable length, and isn't the only thing on the screen. So, I need to be able to set the width corresponding to the actual content of the message.

WebBrowser 具有 ActualHeight 属性,但这不会产生任何结果.此外,一旦正确显示,我不希望它滚动,因为用户可以将其完全滚动到屏幕外.

WebBrowser has the property ActualHeight, but that does not produce any results. Additionally, Once it's displayed properly, I don't want it to scroll, as the user can scroll it completely off the screen.

有什么想法吗?

推荐答案

我不是 100% 确定您需要什么.

I'm not 100% sure what you need.

但是你可以使用:- 普通 XAML 来设置浏览器的外部高度和宽度- 一些标题标签来实现对 web 浏览器客户端高度和宽度的一些修复 - 参见 http://blogs.msdn.com/b/mikeormond/archive/2010/12/16/displaying-html-content-in-windows-phone-7.aspx 包括底部的评论

But you can use: - normal XAML to set the external height and width of the webbrowser - some header tags to achieve some fixing of the web-browser's client height and width - see http://blogs.msdn.com/b/mikeormond/archive/2010/12/16/displaying-html-content-in-windows-phone-7.aspx including the comments at the bottom

我在 Iron7 的编辑器中做了一些 tis - 这修复了客户端比例并禁用缩放 - 但它仍然有一些不需要的副作用.

I've done some of tis in the editor for iron7 - this fixes the client scale and disables zooming - but it's still got some unwanted side effects.

希望即将发布的 WP7 版本 - 包括很快"的 IE9 - 将使网络浏览器控制更好.

Hopefully the upcoming WP7 releases - including IE9 "soon" - will make the web browser control much better.

这篇关于有什么方法可以动态设置 WP7 Webbrowser 控件高度并锁定滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆