繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> Mono问题之一——中文支持

Mono问题之一——中文支持

2007-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:我写了一些代码如下: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace Sample { public class FormX...

我写了一些代码如下:

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace Sample

{

public class FormX : System.Windows.Forms.Form

{

private System.ComponentModel.Container components = null;

private System.Windows.Forms.Button btn = null;

public FormX()

{

InitializeComponent();

}

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}

private void InitializeComponent()

{

this.components = new System.ComponentModel.Container();

this.Size = new System.Drawing.Size(300,300);

this.Text = "路亦平";

this.btn = new System.Windows.Forms.Button();

this.btn.Location = new System.Drawing.Point(100, 100);

this.btn.Name = "btn";

this.btn.Size = new System.Drawing.Size(56, 24);

this.btn.TabIndex = 6;

this.btn.Text = "确定";

this.Controls.Add(this.btn);

this.btn.Click += new System.EventHandler(this.btn_Click);

}

private void btn_Click(object sender, System.EventArgs e)

{

MessageBox.Show("中文");

this.Close();

}

[STAThread]

static void Main()

{

Application.Run(new FormX());

}

}

}

用mcs -r:System.Windows.Forms -r:System.Drawing -r:System.Data hello.cs对这个文件进行编译后产生一个可执行文件,执行它,可以看到如下界面:

责任编辑:admin
相关文章