首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

这个程序输出如何和想的不一样

2012-09-23 
这个程序输出怎么和想的不一样程序是C#入门经典上的例子程序.创建一个winform程序代码是C# codeusing Syst

这个程序输出怎么和想的不一样
程序是C#入门经典上的例子程序.创建一个winform程序代码是

C# code
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 Ch08Ex01{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            ((Button)sender).Text = "Clicked!";            Button newButton = new Button();            newButton.Text = "New Button!";            newButton.Click += new EventHandler(newButton_Click);            Controls.Add(newButton);        }        private void newButton_Click(object sender, System.EventArgs e)        {            ((Button)sender).Text = "Clicked!!";        }    }}

为什么最后输出的时候,右上角本应该显示New Button后来只显示了一个New呢?


[解决办法]
哈哈,宽度太窄挡住了吧。。。C#的帖子怎么跑C++来了

热点排行