体验Windows Forms
来源:互联网 发布:编c语言用什么软件 编辑:程序博客网 时间:2024/06/02 23:28
在窗体中创建一个新窗体
新建一个框体,将IsMdiContainer属性设置为True
MainMenuStrip属性与ContextmenuStrip控件相关联
private void newToolStripMenuItem1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.MdiParent = this;
frm.Show();
}
层叠排列
private void cToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.Cascade);
}
水平排列
private void hToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}
MessageBox.Show("Help!","Help",MessageBoxButtons.OK,MessageBoxIcon.Information);
内容,标题,按钮样式,图标样式
按钮相互加载事件
private void button1_Click(object sender, EventArgs e)
{
this.button2.Click+=new EventHandler(button2_Click);
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("You Click button2");
this.button1.Click+=new EventHandler(btn1_Click2);
}
private void btn1_Click2(object sender, EventArgs e)
{
MessageBox.Show("You Click button1");
}
继承
public static int Add(int a, int b)
{
return a + b;
}
[WebMethod]
public int Add(int a, int b) {
return a + b;
}
#region Add
private void button1_Click(object sender, EventArgs e)
{
int a = ClassLibrary1.Class1.Add(int.Parse(this.textBox1.Text), int.Parse(this.textBox2.Text));
MessageBox.Show(a.ToString(), "Result", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
localhost.Service srv = new WindowsApplication3.localhost.Service();
int a = srv.Add(int.Parse (this.textBox1.Text),int.Parse (this.textBox2.Text));
MessageBox.Show(a.ToString());
}
#endregion
- 体验Windows Forms
- Windows Forms简介
- Windows Forms简介
- Windows Forms RichTextBox
- System.Windows.Forms.Cursor
- Windows Forms简介
- Windows Forms in Action
- Windows Forms是什么?
- C Sharp Windows Forms
- windows + forms 混合 Authentication
- Windows.Forms.ImageLayout
- Windows Forms 数据绑定
- Windows Forms 多线程用户界面
- Windows Forms 多线程用户界面
- Windows Forms 多线程用户界面
- Windows Forms 键盘事件
- Windows Forms 键盘事件
- cobainsoft.windows.forms.barcodecontrol
- flash与服务端的交互方法
- 教你几招如何看透一个人
- 第二章笔记——《c++ programming language》Bjarne Strousrup著,裘宗燕译本
- 什么是爱情?
- 一个好的网站
- 体验Windows Forms
- 通过Mysql 的语句生成后门木马的方法
- 测试执行中非常有效的策略
- C++问题收藏,学习
- SpringJdbc的一个简单示例
- 20个VC开发小技巧
- 迅雷真的比flashget好吗?
- 神秘的类和对象初始化过程——由一个大多数程序员都可能犯的、却又很难定位的问题谈起。
- 《sip揭秘》读书笔记2