[英]Nothing happens when clicking a button (VS c#)
單擊按鈕時,我試圖得到響應。 但是當我單擊按鈕時,什么都沒有發生...
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void button1_Click(Object sender, EventArgs e)
{
button1.Text = "hi";
MessageBox.Show("hi");
}
}
}
當我添加按鈕VS時,並未將方法添加到腳本中,因此無法確定button1_Click是否是正確的語法,但是它不會給出任何錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.