C#第一个hello程序,就出错了
来源:百度知道 编辑:UC知道 时间:2024/05/29 12:35:50
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox "hello";
}
}
}
我的目的只要显示点击按钮时,“hello”,但是报错,怎么办?
谢谢先!
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox "hello";
}
}
}
我的目的只要显示点击按钮时,“hello”,但是报错,怎么办?
谢谢先!
MessageBox.Show("hello");
什么编译器??这个用不着写那么复杂...
楼主之前不会不是学VB的吧?
第2楼的是对的,你的写法看得象vb,语言不同,语法也不一样哈.你还是从基础开始吧