Hey guys I've been trying to get my web browser to load on a web page on enter but nothing seems to work here's what I'm trying to do:
Try 1
VS2008 Compiler error: Cannot implicitly convert type 'System.Windows.Forms.Keys' to 'char'. An explicit conversion exists (are you missing a cast?)Code:private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar = Keys.Enter) { webBrowser1.Navigate(comboBox1.Text); } }
Try 2
VS2008 Compiler error: Cannot implicitly convert type 'System.Windows.Forms.Keys' to 'char'. An explicit conversion exists (are you missing a cast?)Code:private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar) { case Keys.Enter: webBrowser1.Navigate(comboBox1.Text); break; } }
Try 3
VS2008 Compiler error: error CS0029: Cannot implicitly convert type 'string' to 'char'Code:private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar) { case Keys.Enter.ToString(); webBrowser1.Navigate(comboBox1.Text); break; } }
Can anyone please please help I've been trying to find a solution for 3 hours now but nothing works![]()




Reply With Quote