WinForm能不能把HTML页面作为程序的控件,和其他控件进行交互操作,类似VC的HtmlDialog??

suzhan 2003-02-26 10:56:30
一些程序使用HTML页作为程序的一部分,但在C#的WinForm里,怎么与HTML页面交互?比如我点击页面的一个链接,弹出新窗口。或点击一个窗体按钮,在HTML里插入文字等。谢谢
...全文
26 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bwx 2003-02-27
  • 打赏
  • 举报
回复
你说的功能,用Javascracp能基本实现.
但不易做成VC的HtmlDialog
suzhan 2003-02-26
  • 打赏
  • 举报
回复
谢谢班兄,那么如果我想往web browser control里写入一些html的内容呢??比如我点击“打开”菜单,把读入的字符串写入html页面里的文本框(<TextArea>same text...</TextArea>)
TheAres 2003-02-26
  • 打赏
  • 举报
回复
suzhan (八角) :

Please try this, I can't use VS.Net now, just some hint.

1. Add a web browser control.
2. On the event "OnBeforeNavigate", check the url will naviage to. If the uri is the special uri you set in the html file, the canel it and call some functions.

Soem thing like this:
protected void OnBeforeNavigate(object sender, BeforeNavigateEventArgs e)
{
MessageBox.Show("User tried to go to: " + e.Url);
e.Cancel = true; // Prevents the control to load the new page
}
yinwu2003 2003-02-26
  • 打赏
  • 举报
回复
那么看具体情况的

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧