欢迎光临
我们一直在努力

Mono问题之一——中文支持-.NET教程,评论及其它

建站超值云服务器,限时71元/月

我写了一些代码如下:

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Mono问题之一——中文支持-.NET教程,评论及其它
分享到: 更多 (0)

相关推荐

  • 暂无文章