乐乐

乐乐的博客园
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

编写一个窗体

Posted on 2007-08-03 13:36  带你去月球  阅读(133)  评论(0编辑  收藏  举报
using System;
using System.Windows.Forms;

namespace test
{
    
static class program
    
{
        [STAThread]
        
public static void Main()
        
{
            Console.Write(
"HI");
            Application.Run(
new form());
        }

     }


     
class form:Form
    
{    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
        
public form()
        
{
            init();
        }


        
private void init()
        
{
            button1.Text
="hi";
            
this.Controls.Add(this.button1);

             
this.button1.Click += new System.EventHandler(this.qq);
        }


        
private void qq(object sender, EventArgs e)
        
{
            MessageBox.Show(
"HI");
        }


    }

}

在命令行编译运行
C:/>csc.exe  --.cs )
C:/>--
无觅相关文章插件,快速提升流量