在gnome下用C#开发一个简单的窗口
2005-12-06 21:03
465 查看
终于发现ATI的显卡驱动可以用了,于是可以不再忍受800*600的分辨率了
做为一个.net爱好者怎么可以不尝试一下mono呢?
于是apt安装mono,顺便赞一把debian using System;
using Gtk;
public class MyWindow : Window
{
public MyWindow () : base ("MyWindow")
{
this.SetDefaultSize (400, 300);
this.DeleteEvent += new DeleteEventHandler (OnMyWindowDelete);
Button mybtn = new Button("Click me");
mybtn.Clicked+=new EventHandler (mybtn_click);
this.Add(mybtn);
this.ShowAll ();
}
void OnMyWindowDelete (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
void mybtn_click(object sender,EventArgs args)
{
MessageDialog md = new MessageDialog((Window)this,
DialogFlags.DestroyWithParent,
MessageType.Question,
ButtonsType.YesNo,
"Do you really want to exit?");
ResponseType result = (ResponseType)md.Run();
md.Destroy();
if(result==ResponseType.Yes)
this.Destroy();
}
}
做为一个.net爱好者怎么可以不尝试一下mono呢?
于是apt安装mono,顺便赞一把debian using System;
using Gtk;
public class MyWindow : Window
{
public MyWindow () : base ("MyWindow")
{
this.SetDefaultSize (400, 300);
this.DeleteEvent += new DeleteEventHandler (OnMyWindowDelete);
Button mybtn = new Button("Click me");
mybtn.Clicked+=new EventHandler (mybtn_click);
this.Add(mybtn);
this.ShowAll ();
}
void OnMyWindowDelete (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
void mybtn_click(object sender,EventArgs args)
{
MessageDialog md = new MessageDialog((Window)this,
DialogFlags.DestroyWithParent,
MessageType.Question,
ButtonsType.YesNo,
"Do you really want to exit?");
ResponseType result = (ResponseType)md.Run();
md.Destroy();
if(result==ResponseType.Yes)
this.Destroy();
}
}
相关文章推荐
- C# 开发一个简单的HTTP服务器及命令行解释器
- C#使用TcpListener及TcpClient开发一个简单的Chat工具实例
- 如何用C#写一个简单的Login窗口
- C#开发一个简单的P2P应用
- 使用C#开发一个简单的P2P应用
- 使用C#开发一个简单的P2P应用
- 如何用C#写一个简单的Login窗口
- 如何用C#写一个简单的Login窗口
- 如何用C#写一个简单的Login窗口
- 使用C#开发一个简单的P2P应用
- 使用C#开发一个简单的P2P应用
- 简介 WatiN是一个开源的用于Web测试自动化的类库,从watir中获得的灵感,使用C#开发。WatiN通过与浏览器的交互来实现自动化,使用起来具有轻便,简单的特点。目前最新版本为2.0,加入了对
- 使用C#开发一个简单的P2P应用
- 如何用C#写一个简单的Login窗口
- 在 .NET 中开发基于 Chrome 内核的浏览器-创建一个简单浏览器 分类: C# 2014-10-27 16:27 594人阅读 评论(0) 收藏
- 使用C#开发一个简单的P2P应用
- 如何用C#写一个简单的Login窗口
- c#开发一个简单的BHO
- 如何用C#写一个简单的Login窗口
- 在 .NET 中开发基于 Chrome 内核的浏览器-创建一个简单浏览器 分类: C# 2014-10-27 16:27 593人阅读 评论(0) 收藏