博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c# windows编程控件学习-2
阅读量:7028 次
发布时间:2019-06-28

本文共 3250 字,大约阅读时间需要 10 分钟。

1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms;10 11 namespace proj_9212 {13     public partial class Form1 : Form14     {15         public Form1()16         {17             InitializeComponent();18         }19 20         private void Form1_Load(object sender, EventArgs e)21         {22             checkedListBox1.Items.Add("中国"); checkedListBox1.Items.Add("美国");23             checkedListBox1.Items.Add("俄罗斯"); checkedListBox1.Items.Add("英国");24             checkedListBox1.Items.Add("法国"); checkedListBox1.CheckOnClick = true;25             textBox1.Text = DateTime.Now.ToString("h:mm:ss");26             timer1.Enabled = true;27             timer1.Interval = 2000;28 29             hScrollBar1.Maximum = 100; hScrollBar1.Minimum = 0;30             hScrollBar1.SmallChange = 2; hScrollBar1.LargeChange = 5;31             vScrollBar1.Maximum = 100; vScrollBar1.Minimum = 0;32             vScrollBar1.SmallChange = 2; vScrollBar1.LargeChange = 5;33             hScrollBar1.Value = 0; vScrollBar1.Value = 0;34 35             dateTimePicker1.Format = DateTimePickerFormat.Long;36             dateTimePicker1.ShowCheckBox = true;37             dateTimePicker1.ShowUpDown = false;38             textBox3.Text = "";39 40             linkLabel1.LinkColor = Color.Blue;41             linkLabel1.ActiveLinkColor = Color.Green;42 43 44         }45 46         private void button1_Click(object sender, EventArgs e)47         {48             foreach (object  item in checkedListBox1 .CheckedItems )49             {50                 listBox1.Items.Add(item);51             }52         }53 54         private void timer1_Tick(object sender, EventArgs e)55         {56             textBox1.Text = DateTime.Now.ToString("h:mm:ss");57 58         }59 60         private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)61         {62             textBox2.Text = hScrollBar1.Value.ToString("d");63             vScrollBar1.Value = hScrollBar1.Value;64         }65 66         private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)67         {68             textBox2.Text = vScrollBar1.Value.ToString("d");69             hScrollBar1.Value = vScrollBar1.Value;70         }71 72         private void button2_Click(object sender, EventArgs e)73         {74             if (Convert .ToInt16 (textBox2 .Text )>=0 && Convert .ToInt16 (textBox2 .Text )<=100 )75             {76                 hScrollBar1.Value = Convert.ToInt16(textBox2.Text);77                 vScrollBar1.Value = Convert.ToInt16(textBox2.Text);78             }79         }80 81         private void dateTimePicker1_ValueChanged(object sender, EventArgs e)82         {83             textBox3.Text = dateTimePicker1.Value.ToString("yyyy.MM.dd hh:mm:ss");84         }85 86         private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)87         {88             System.Diagnostics.Process.Start("http://blog.sina.com.cn/s/articlelist_2379298071_0_1.html");89         }90     }91 }

带复选框的列表控件,定时器控件,滚动条控件,月历控件,日期时间控件,超链接控件

 

转载于:https://www.cnblogs.com/zhubinglong/p/5904578.html

你可能感兴趣的文章
php 双重检查,java_Java中的双重检查(Double-Check)详解,在 Effecitve Java 一书的第 48 条 - phpStudy...
查看>>
java log4jppt,Java EE企业级应用开发第10章 Mybatis与Spring的整合.ppt
查看>>
matlab gui 暂停按钮,MATLAB GUI drawow渲染按钮’向下推’而不是’禁用’
查看>>
php sqlite3菜鸟,SQLite Autoincrement
查看>>
php fatalerrorexception,laravel5异常错误-FatalErrorException in Handler.php line 38
查看>>
oracle12c监控数据,Oracle 12C R2-新特性-监控PDB资源使用情况
查看>>
oracle 监听 sid_name,配置静态监听sid_name大小写造成无法登录
查看>>
sqlyog怎么导入oracle数据库,《如何文件复制到excel表格数据库中》 如何将EXCEL表导入ORACLE数据库中?...
查看>>
oracle12 se1和se2,小屏党的最终执念,12Mini和SE2,到底谁更值得入手?
查看>>
include top.php,Php 安全错误 Top 7
查看>>
oracle itl槽,事务槽(ITL)
查看>>
oracle电子商务套件无法弹窗,Oracle电子商务套件(EBS)升级过程中的定制代码问题...
查看>>
php的拼接.开头能去掉,重新梳理——php进阶篇2
查看>>
oracle查询植入,万智牌规则问答——颅内植入:阅读多明纳里亚Oracle
查看>>
linux中按第一列合并文件夹,Linux下paste命令,按列合并文件,很实用
查看>>
linux获取文件的md5,linux shell 获取文件md5的命令linux操作系统 -电脑资料
查看>>
linux xmanager端口,Xmanager远程连接Linux系统图形界面详解-Go语言中文社区
查看>>
linux终端输出c语言程序,Linux终端程序用c语言实现改变输出的字的颜色
查看>>
linux mint 20安装教程,Linux Mint 20中安装最快的终端模拟器Alacritty
查看>>
linux 内存 thp,操作系统内存大页(THP)对redis性能的影响
查看>>