webBrowser1.Font = button1.Font; NOT working :(
-
Hello, I'm wondering why the following code is accepted by the compiler but there's no effect in run-time. Set browser url to about:blank at design time & make button1 font a little big then... private void button1_Click(object sender, EventArgs e) { webBrowser1.Document.Body.InnerHtml = "Test only"; } private void button2_Click(object sender, EventArgs e) { webBrowser1.Font = button1.Font; } Why it's not working? Your help would be greatly appreciated. THANKS.
-
Hello, I'm wondering why the following code is accepted by the compiler but there's no effect in run-time. Set browser url to about:blank at design time & make button1 font a little big then... private void button1_Click(object sender, EventArgs e) { webBrowser1.Document.Body.InnerHtml = "Test only"; } private void button2_Click(object sender, EventArgs e) { webBrowser1.Font = button1.Font; } Why it's not working? Your help would be greatly appreciated. THANKS.
The Font property is documented to "not have any meaning on this control". In other words, you're setting the Font on a WebBrowser object, when it doesn't do anything. Documentation[^] on WebBrowser.Font.
Dave Kreskowiak Microsoft MVP - Visual Basic