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. xib中的view对iPhone和iPad自适应

    1 This worked for me: Make a copy of the .xib in the Finder.    Open the copied file in a text edito ...

  2. php中rsa加密解密验证

    RSA非对称加密,对敏感的数据传输进行数据加密.验证等.测试环境:wamp.aliyun虚拟主机(lamp)一.加密解密的第一步是生成公钥.私钥对,私钥加密的内容能通过公钥解密(反过来亦可以).下载生 ...

  3. wex5 教程 之 图文讲解 后台管理界面设计与技巧

    视频教程地址:http://v.youku.com/v_show/id_XMTgwOTAyMTkyMA==.html?from=s1.8-1-1.2&spm=a2h0k.8191407.0.0 ...

  4. eclipse编辑struts.xml 代码提示

    先确定xml文件 window-preferences-查询catalog 点击add 关于这个Location 先找到你下载的struts压缩包 然后找到 解压这个jar包 你会得到一些dtd文件 ...

  5. WIFI驱动的移植 realtek 8188

    一般我们拿到的android源代码中wifi应用层部分是好的, 主要是wifi芯片的驱动要移植并添加进去. wifi驱动的移植, 以realtek的8188etv为例到官网下载相应的驱动, 解压后可以 ...

  6. [课程设计]Scrum 2.0 多鱼点餐系统开发进度(第二阶段项目构思与任务规划)

    [课程设计]Scrum 2.0 多鱼点餐系统开发进度 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统WEB ...

  7. \boot 空间不足解决方法

    ubuntu系统总是更新,有时是内核,有时是软件,最近的一次更新download中,提示\boot目录空间不足,我是将\boot单独划分在一个分区中的,当该目录空间不足时,可以利用命令删除没有用的镜像 ...

  8. Nginx模块之————RTMP模块在Ubuntu上以串流直播HLS视频

    Nginx的安装在Ubuntu上以串流直播HLS视频 https://www.vultr.com/docs/setup-nginx-on-ubuntu-to-stream-live-hls-video

  9. io流操作大全

    JAVA 中的IO流 一.流的概念        流(stream)的概念源于UNIX中管道(pipe)的概念.在UNIX中,管道是一条不间断的字节流,用来实现程序或进程间的通信,或读写外围设备.外部 ...

  10. Android 四大组件之二(Service)

    service可以在和多场合的应用中使用,比如播放多媒体的时候用户启动了其他Activity这个时候程序要在后台继续播放,比如检测SD卡上文件的变化,再或者在后台记录你地理信息位置的改变等等,总之服务 ...