Mono问题之一——中文支持

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

我写了一些代码如下:

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对这个文件进行编译后产生一个可执行文件,执行它,可以看到如下界面:

这是我没有设置好呢,还是mono对中文的支持不好?

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航