Enter function not doing anything

so i wrote a simple web broswer and every time the user presses the enter key it is supposed to trigger the search button however it is not working can somebody tell me what i did wrong

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

namespace nick_app_9000 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

 private void Form1_Load(object sender, EventArgs e) { } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("Nick browser 0.1 please no stealy my codie k"); } private void search_Click(object sender, EventArgs e) { webBrowser1.Navigate(textBox1.Text); } private void search_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)ConsoleKey.Enter) { search_Click(null, null); } } } 


by nissnpig5 via /r/csharp

Leave a Reply