我在做什麼錯?以下是錯誤代碼,我得到:爲什麼我無法訪問System.EventArgs的KeyCode成員?
「System.EventArgs」不包含「邀請碼」,並沒有擴展方法「邀請碼」接受一個類型的第一個參數定義「System.EventArgs」可尋(是否缺少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();
}
}
}