using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace proj9_1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form myform = new Form1_1();
myform.ShowDialog(); } private void Form1_Load(object sender, EventArgs e)
{
//MessageBox.Show("3个按钮", "信息提示", MessageBoxButtons.AbortRetryIgnore);
listBox1.Items.Add("清华大学"); listBox1.Items.Add("北京大学");
listBox1.Items.Add("北京航空航天大学"); listBox1.Items.Add("人民大学");
listBox1.Items.Add("南京大学"); listBox1.Items.Add("武汉大学");
listBox1.Items.Add("山东大学"); listBox1.Items.Add("复旦大学");
enbutton();
} private void enbutton()
{
if (listBox1.Items.Count == )
{
button7.Enabled = false; button8.Enabled = false;
}
else
{
button7.Enabled = true; button8.Enabled = true;
}
if (listBox2.Items.Count == )
{
button9.Enabled = false; button10.Enabled = false;
}
else
{
button9.Enabled = true; button10.Enabled = true;
}
} private void button2_Click(object sender, EventArgs e)
{
Form myform = new Form1_2();
myform.Show();
} private void richTextBox1_TextChanged(object sender, EventArgs e)
{ } private void groupBox1_Enter(object sender, EventArgs e)
{ } private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
MessageBox.Show("3个按钮", "信息提示", MessageBoxButtons.AbortRetryIgnore);
} private void button3_Click(object sender, EventArgs e)
{
if (checkBox1.Checked && checkBox3.Checked && !checkBox2.Checked && !checkBox4.Checked)
{
MessageBox.Show("您答对了,真的很棒!!!", "信息提示", MessageBoxButtons.OK);
}
else
MessageBox.Show("您答错了,继续努力。", "信息提示", MessageBoxButtons.OK);
} private void button4_Click(object sender, EventArgs e)
{
if (radioButton3.Checked)
{
MessageBox.Show("您选对了", "提示", MessageBoxButtons.OK);
}
else if (radioButton1.Checked || radioButton4.Checked)
{
MessageBox.Show("您选错了", "提示", MessageBoxButtons.OKCancel);
}
else
{
MessageBox.Show("您选错了,这是数据库系统", "提示", MessageBoxButtons.OKCancel);
}
} private void button5_Click(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("E:\\flac3d.jpg"); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ } private void button6_Click(object sender, EventArgs e)
{
if (textBox1.Text != "")
if (!comboBox1.Items.Contains(textBox1.Text))
comboBox1.Items.Add(textBox1);
} private void button7_Click(object sender, EventArgs e)
{
if (listBox1.SelectedIndex >= )
{
listBox2.Items.Add(listBox1.SelectedItem);
listBox1.Items.RemoveAt(listBox1.SelectedIndex);
}
enbutton();
}
private void button8_Click(object sender, EventArgs e)
{
foreach (var item in listBox1.Items)
{
listBox2.Items.Add(item);
}
enbutton();
listBox1.Items.Clear();
} }
}

c# windows编程控件学习-1的更多相关文章

  1. c# windows编程控件学习-2

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  2. [转]Windows平台下Makefile学习笔记

    Windows平台下Makefile学习笔记(一) 作者:朱金灿 来源:http://blog.csdn.net/clever101 决心学习Makefile,一方面是为了解决编译开源代码时需要跨编译 ...

  3. DevExpress控件学习总结(转)

    DevExpress控件学习总结   1.Navigation & Layout 1.1 Bar Manager 如果想在窗体或用户控件(user control)上添加工具条(bars)或弹 ...

  4. Windows标准控件

    学习目的 学习创建, 使用Windows标准控件(按钮, 滚动条, 静态控件, 列表框, 编辑框, 组合框); 学习使用子窗口控件操作函数(EnableWindow, MoveWindow, SetW ...

  5. 如何:对 Windows 窗体控件进行线程安全调用

    http://msdn.microsoft.com/zh-cn/library/ms171728(VS.90).aspx http://msdn.microsoft.com/zh-cn/library ...

  6. C#可扩展编程之MEF学习笔记(五):MEF高级进阶

    好久没有写博客了,今天抽空继续写MEF系列的文章.有园友提出这种系列的文章要做个目录,看起来方便,所以就抽空做了一个,放到每篇文章的最后. 前面四篇讲了MEF的基础知识,学完了前四篇,MEF中比较常用 ...

  7. C#可扩展编程之MEF学习笔记(四):见证奇迹的时刻

    前面三篇讲了MEF的基础和基本到导入导出方法,下面就是见证MEF真正魅力所在的时刻.如果没有看过前面的文章,请到我的博客首页查看. 前面我们都是在一个项目中写了一个类来测试的,但实际开发中,我们往往要 ...

  8. C#可扩展编程之MEF学习笔记(三):导出类的方法和属性

    前面说完了导入和导出的几种方法,如果大家细心的话会注意到前面我们导出的都是类,那么方法和属性能不能导出呢???答案是肯定的,下面就来说下MEF是如何导出方法和属性的. 还是前面的代码,第二篇中已经提供 ...

  9. C#可扩展编程之MEF学习笔记(二):MEF的导出(Export)和导入(Import)

    上一篇学习完了MEF的基础知识,编写了一个简单的DEMO,接下来接着上篇的内容继续学习,如果没有看过上一篇的内容, 请阅读:http://www.cnblogs.com/yunfeifei/p/392 ...

随机推荐

  1. V​S​2​0​1​2​快​捷​键

    VS2012变化的快捷键: 注释::VS2010是(Ctrl+E,C),VS2012是(Ctrl+K, Ctrl+C),实际操作,按住Ctrl键不放,先按K键,再按C键.相当于Ctrl+K加 Ctrl ...

  2. spring IOC 容器中 Bean 的生命周期

    IOC 容器中 Bean 的生命周期: 1.通过构造器或工厂方法创建 Bean 实例 2.为 Bean 的属性设置值和对其他 Bean 的引用 3.调用 Bean 后置处理器接口(BeanPostPr ...

  3. jquery中没有innerHTML

    本人正在学习使用jQuery. 发现如果我在div或者其他非表单的标签中赋值,原本用普通的js就直接document.getElementById("id").innerHtml( ...

  4. Web网页的了解内容

    一.因特网(互联网) 1.发展阶段: A 实验科研阶段 B社会化应用启动阶段 C社会化应用阶段 2.基本特征:资源共享 二.万维网 1.全称全球信息网(World Wide web),简称Web 2. ...

  5. Smallest Bounding Rectangle - uva10173

    Smallest Bounding Rectangle Given the Cartesian coordinates of n(>0)2-dimensional points, write a ...

  6. Duilib实现类似电脑管家扫描目录效果

    实现原理: 1.后台开线程遍历目录,遍历出一个文件路径在界面上更新显示(通过发消息通知主界面) 2.需要扩展一下Duilib控件,在此我扩展了CLabelUI,重写了PaintText函数 扩展控件的 ...

  7. didFinishLaunchingWithOptions

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launc ...

  8. Bootstrap_标签

    一.标签 在一些Web页面中常常会添加一个标签用来告诉用户一些额外的信息,比如说在导航上添加了一个新导航项,可能就会加一个“new”标签,来告诉用户. 那么在Bootstrap框架中特意将这样的效果提 ...

  9. centos 服务开机启动设置

    建立服务文件以nginx 为例 vim /lib/systemd/system/nginx.service 在nginx.service 中插入一下内容 [Unit] Description=ngin ...

  10. struts的hello world小试

    struts的hello world小试 前面jdk的安装和配置,tomcat的安装和配置以及java ide的安装和配置就不写了. 在项目中使用流程 创建一个Web项目 导如struts 2.0.1 ...