English 中文(简体)
利用网络浏览器控制与电线7和基调有关的问题
原标题:Problems using webbrowser control with ie7 and anchors

我会看到一些非常奇怪的行为,使用一只网络浏览器控制,并与网络连接。 Oh和这种行为似乎只在ie7中发生,8 fine!

我在网上浏览器控制下创建了一个简单的表格。

我在浏览器装满第一页后,在大约html处添加了一个新的网络BrowserNavigatedEventHandler。 与谷歌的直线链接是细微的,但与一个维基百科页和基点的链接是没有的。

然而,如果Iavigate to a page with solids in it(或链接到另一个网页,链接到该网页上做的是罚款)!

因此,问题可能是第1页,第一次装上Im。

这里是我撰写的法典,欢迎任何建议。

Edit:

我刚刚注意到,如果我改变这一行文,我就会看到:

this.webBrowser1.Document.Write(html);

:

this.webBrowser1.DocumentText = html;

it!

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.webBrowser1.Navigated += new WebBrowserNavigatedEventHandler(webBrowser1_NavigatedLoaddefaultpage);
        this.webBrowser1.Navigated += new WebBrowserNavigatedEventHandler(webBrowser1_NavigatedUpdateTextbox);

        this.webBrowser1.Navigate("about:blank");
    }

    private void button1_Click(object sender, EventArgs e)
    {
        this.webBrowser1.Navigate(this.textBox1.Text);
    }


    void webBrowser1_NavigatedLoaddefaultpage(object sender, WebBrowserNavigatedEventArgs e)
    {
        this.webBrowser1.Navigated -= new WebBrowserNavigatedEventHandler(webBrowser1_NavigatedLoaddefaultpage);

        string html = "<html>";
        html += "<body>";

        html += "<h1>My First Heading</h1>";

        html += "<p>My first paragraph.</p>";

        html += "<a href= http://en.wikipedia.org/wiki/Star_Trek#Production_history >Star Trek Production history</a>";
        html += "Go to <a href= http://www.google.com >Google Search</a><br />";
        html += "</body>";
        html += "</html>";
        this.webBrowser1.Document.Write(html);
    }

    void webBrowser1_NavigatedUpdateTextbox(object sender, WebBrowserNavigatedEventArgs e)
    {
        this.textBox1.Text = this.webBrowser1.Url.ToString();
    }
}
问题回答

这甚至可能与你的法典无关。 这可能是国际E7组织的 anchor。 我先问的是,有人没有在IE7工作。 显然有时会发生这种情况,有时甚至没有。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签