我究竟做错了什么?这是我得到的错误代码:
“System.EventArgs”不包含“KeyCode”的定义,并且找不到接受“System.EventArgs”类型的第一个参数的扩展方法“KeyCode”(您是否缺少 using 指令或程序集引用?)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BroZer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Reload_Click(object sender, EventArgs e)
{
webBrowser1.Refresh();
}
private void Go_Click(object sender, EventArgs e)
{
webBrowser1.Navigate(textBox1.Text);
}
private void Back_Click(object sender, EventArgs e)
{
webBrowser1.GoBack();
}
private void Forward_Click(object sender, EventArgs e)
{
webBrowser1.GoForward();
}
private void textBox1_KeyDown(object sender, EventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
webBrowser1.Navigate("https://www.google.com/search?&ie=UTF-8&q=" + textBox1.Text);
}
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void Save_Click(object sender, EventArgs e)
{
webBrowser1.ShowSaveAsDialog();
}
private void Print_Click(object sender, EventArgs e)
{
webBrowser1.ShowPrintPreviewDialog();
}
}
}