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. CentOS 7 防火墙和端口配置

    centos 7 防火墙和端口配置--解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load # 第一步,关闭firewal ...

  2. jquery判断id是否存在

    1.判断标签是否存在 ){ 存在 } 2.判断(id="id名"的标签)是否存在,下面的不可以!!!因为 $("#id") 不管对象是否存在都会返回 objec ...

  3. len字符串的长度

    #!/usr/bin/env python def fun4(x) : if len(x) > 2 : return print(x[0],x[1]) else: return 0 d = (' ...

  4. Java类实例化时候的加载顺序

    面试试题中经常考到此问题,现在做进一步的总结: public class Student { public Student(String name){ System.out.println(name) ...

  5. 【leetcode❤python】 414. Third Maximum Number

    #-*- coding: UTF-8 -*- #l1 = ['1','3','2','3','2','1','1']#l2 = sorted(sorted(set(l1),key=l1.index,r ...

  6. linux文件上传,给文件或目录添加apache权限

    系统环境:ubuntu11.10/apache2/php5.3.6 在LAMP环境中,测试一个简单的php文件上传功能时,发现/var/log/apache2/error.log中出现如下php警告: ...

  7. abort终止正在进行中的的ajax请求

    核心:调用XMLHttpRequest对象上的abort方法 jQuery的ajax方法有自己的超时时间设置参数:   $.ajax({type:'POST', url:'b.php', data:' ...

  8. 使用VB6制作RTD函数

    以前模仿大神在vs里使用c#实现RTD函数功能.(真是很生僻的东东啊)C#制作RTD参考:大神博客跳转.最近想VB里能不能做?就试着做了做,好像基本成了,整套代码有些毛病,勉强能算个样子,暂时不打算再 ...

  9. centos7上consul的集群安装

    centos7上consul的安装 ###一 下载 下载文件 wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_a ...

  10. iOS - Project 项目

    1.项目流程 1.1 分析项目的架构 iOS 常见的几种架构 标签式 Tab Menu 列表式 List Menu 抽屉式 Drawer 瀑布式 Waterfall 跳板式 Springborad 陈 ...