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. WMI资料汇总

    简介 http://technet.microsoft.com/zh-cn/library/ee692772.aspx#E5IAC 主页 http://msdn.microsoft.com/zh-cn ...

  2. LINQ查询操作符之First、FirstOrDefault、Last、LastOrDefault、ElementAt、ElementAtOrDefault、Contains、Any、All、Coun

    ·First - 返回集合中的第一个元素:不延迟 ·FirstOrDefault - 返回集合中的第一个元素(如果没有则返回默认值):不延迟 ·Last - 返回集合中的最后一个元素:不延迟 ·Las ...

  3. 升级到Xcode8.2.1(Swift 2.3升级到3.0)

    最近呢把我的几个混编项目,和swift项目做了一个升级.那么今天就给大家分享一下遇到的问题和解决的办法. 首先那肯定的升级Xcode啦,我2015年的时候用的一直是Xcode7.1,电脑系统是OSX ...

  4. Swift高级语法学习总结

    Swift基础语法学习总结Swift高级语法学习总结Swift语法总结补充(一) 1.函数 1.1 func funcNmae()->(){} 这样就定义了一个函数,它的参数为空,返回值为空,如 ...

  5. Mysql新知识点150928

    1.select distinct(DATE_FORMAT(updatetime,'%Y-%m')) as updatetime from barcode where pid!=0 order by ...

  6. 细话 - 如何在web应用中使用百度地图

    初步接触了高德地图嵌入到网站应用中的知识后,对高德地图提供的文档,源码以及使用快捷,方便非常满意. 由此,利用周末时间研究了下如何使用 百度地图 . 总的来说,方式方法都差不多,都提供了源码和文档实例 ...

  7. Oracle的多表查询

    多表查询概念: 所谓多表查询,又称表联合查询,即一条语句涉及到的表有多张,数据通过特定的连接进行联合显示. 基本语法: select column_name,.... from table1,tabl ...

  8. CentOS的网络配置(终端环境)

    在虚拟机中安装了Server版的CentOS,用于做Hadoop相关的实验.Server版的CentOS默认是没有桌面环境的,eth0的网络默认也没有开启,需要我们手动启动网络. 关键配置说明 网络和 ...

  9. Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED

    Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED 问题描述 使用pip按照virtualenv报错,如下: pip install virtua ...

  10. runtime运行机制方法学习

    runtime这玩意第一次听说时都不知道是什么,经过了解后才知道它就是oc动态语言的机制,没有它那oc就不能称为动态语言.在之前可能大家对runtime了解都不深,随着编程技能的日益加深和需要,大家开 ...