【发布时间】:2011-12-30 00:33:51
【问题描述】:
我目前正在使用控件 System.Windows.Forms.WebBrowser 在 Windows 应用程序中创建所见即所得的编辑器。 基本上我需要的是文本不超过控件的宽度,即我不想使用水平滚动条。
有可能吗?
[更新]
这是我正在运行的那一刻的代码:
Reconocimiento.Navigate("about:blank"); //this is my object System.Windows.Forms.WebBrowser
Reconocimiento.Document.OpenNew(false);
string html = "<html><head><style type=\"text/css\">body {width: 400px;}</style></head><body></body></html>";
Reconocimiento.Document.Write(html);
recon = (Reconocimiento.Document.DomDocument) as IHTMLDocument2;
recon.designMode = "On"; //What we just did was make our web browser editable!
【问题讨论】:
-
你用它来输入这个问题。你看到水平滚动条了吗?
-
你有没有看表单设计器看看有什么尺寸然后修改它。
-
Hans: touche,他们在 Stackoverflow 的表现如何。现在冷:我在想我应该激活垂直而不是水平,并改变不会发生的控件的宽度
-
也许我可以使用这个question,但无法使用方法
createStyleSheet -
盛:如你所见,上面是我使用的代码,我没有使用iframe
标签: c# winforms webbrowser-control