登录
首页 » C#源码 » C# SelectionStart SelectionEnd时间段选择日历范例

C# SelectionStart SelectionEnd时间段选择日历范例

于 2022-08-15 发布 文件大小:13.20 kB
0 175
下载积分: 2 下载次数: 1

代码说明:

C# Calendar 时间段选择日历范例,可选择时间区间,调用 了C#中的SelectionStart SelectionEnd日期函数实现的功能,这个程序演示了两种功能:   1、获取控件当前的日期和时间   textBox1.Text = monthCalendar1.TodayDate.ToString();   2、时间起始段的选择:   通过SelectionStart属性获取用户选择的起始日期   textBox2.Text = monthCalendar1.SelectionStart.ToString();   通过SelectionEnd属性获取用户选择的结束日期   textBox3.Text = monthCalendar1.SelectionEnd.ToString();

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C# 制作一个顶层显示的窗口-不被其它窗口遮挡
    C#设置顶层显示的窗口,让窗口显示在其它窗口的最上面,不被遮挡,这种窗口形式或许大家平时都见到过,特别是一些视频播放器,在播放视频的时候,都可以设置是否顶层显示,本示例就是模拟了这个功能,通过“允许以最顶层方式显示窗口”和“禁止以最顶层方式显示窗口”来模拟启用和关闭顶层窗口的功能,代码貌似简单:   private void button1_Click(object sender, RoutedEventArgs e)   {//允许以最顶层方式显示窗口    this.Topmost = true;   }   private void button2_Click(object sender, RoutedEventArgs e)   {//禁止以最顶层方式显示窗口    this.Topmost = false;   }
    2023-05-27 13:10:03下载
    积分:1
  • C# 最经典 简单的progressBar进度条用法示例
    这是一个大家都熟悉的实用技巧,用C#制作进度条功能,本代码演示了最简单,且实现方法简单的progressBar进度条用法示例,   单击按钮后,开始演示进度条效果,这部分代码写在按钮事件中:   progressBar1.Value = 0;//设置进度条的初始值   progressBar1.Minimum = 0;//设置progressBar1控件的Minimum值为0   progressBar1.Maximum = 500;//设置progressBar1的Maximum值为500   progressBar1.Step = 1;//设置progressBar1的增值为1   for (int i = 0; i < 500; i++)//调用for语句循环递增   {    progressBar1.PerformStep();//使用PerformStep方法按Step值递增    textBox1.Text = "进度值:" + progressBar1.Value.ToString();   }
    2022-08-18 01:25:55下载
    积分:1
  • Visual C#创建两个基本的线程(多线程)实例
    Visual C#创建两个基本的线程(多线程)实例,为了演示方便,这里把本实例 写成了一个控制台程序,创建两个线程后,通过控制台输出线程信息,演示了两个线程同时工作,下面来看具体代码:   创建两个基本的线程:   Thread thread1 = new Thread(new ThreadStart(Thread1)); //使用自定义方法Thread1声明线程   thread1.Priority = ThreadPriority.Lowest;//设置线程的调度优先级   Thread thread2 = new Thread(new ThreadStart(Thread2)); //使用自定义方法Thread2声明线程   thread1.Start();//开启线程一   thread2.Start();//开启线程二   定义函数向控制台输出线程:   static void Thread1()   {    Console.WriteLine("线程一");   }   输出线程二则可按照上面再创建一个函数,不再列举源码了。
    2022-03-18 18:55:49下载
    积分:1
  • C# WPF把彩色图片转换为灰度图
    C# 把彩色图片转换为灰度图,这是一个基于WPF的C#图像处理程序,图像彩色转换黑白,支持的图像文件格式为:JPeg,Gif,Bmp,etc。   程序主要实现两个功能,一是将彩色转换为索引像素格式、二是将彩色转换为黑白像素格式,对应于窗口中的按钮,可查看对应功能的演示:   将彩色转换为黑白像素格式,核心代码如下:   TransformedBitmap MyRotatedBitmapSource = new TransformedBitmap();   MyRotatedBitmapSource.BeginInit();   MyRotatedBitmapSource.Source = (System.Windows.Media.Imaging.BitmapSource)this.image1.Source;   MyRotatedBitmapSource.Transform = new RotateTransform(270);   MyRotatedBitmapSource.EndInit();   FormatConvertedBitmap MyFormatedBitmap = new FormatConvertedBitmap();   MyFormatedBitmap.BeginInit();   MyFormatedBitmap.Source = MyRotatedBitmapSource;   MyFormatedBitmap.DestinationFormat = PixelFormats.BlackWhite;   MyFormatedBitmap.EndInit();   this.image1.Source = MyFormatedBitmap;   完整源码例子请在本页下载,运行效果截图如下图示。
    2022-02-01 21:42:57下载
    积分:1
  • C#在listView自定义imageList图标列表
    C#在listView自定义imageList图标列表,实际上是创建了一个图像列表的Listview列表,我们可以将一些菜单条目做成此类型,以图标的风格展现操作选项,本实例中你可以熟悉imageList、listView1列表项的添加与删除。   下面是关键的代码:   listView1.LargeImageList = imageList1;   imageList1.ImageSize = new Size(37,36);   imageList1.Images.Add(Image.FromFile("01.png"));调用图标显示的图像资源   imageList1.Images.Add(Image.FromFile("02.png"));   listView1.SmallImageList = imageList1;   listView1.Items.Add("明日科技");图标下边显示的文字   listView1.Items.Add("C#编程词典");   listView1.Items[0].ImageIndex = 0;   listView1.Items[1].ImageIndex = 1;
    2023-03-09 08:05:03下载
    积分:1
  • C# 折线图实例 国外
    一个来源于国外网站的C# 折线图实例,里面的注释也是比较多的,只可惜全是英文,运行的界面效果如图所示。   此源码看上去像是一个生成正弦、余弦曲线的一个源码例子,源码可在VS2015下顺利编译运行,为你学习C#提供一个参考。
    2022-01-29 00:30:47下载
    积分:1
  • C# 键盘Ctrl+g控制蜂鸣器播放声音
    Visual C#播放声音,运行程序后,操作键盘上的Ctrl+g组合键发出蜂鸣声...这里的拖放声音是蜂鸣声,从音箱里发出,并不是从机箱的蜂鸣器发声。实现的过程和细节代码如下:   //导入 Windows Beep() API 函数   [DllImport("kernel32.dll")]   private static extern bool Beep(int freq, int dur);   // 定义PlaySound()要使用的常数   public const int SND_FILENAME = 0x00020000;   public const int SND_ASYNC = 0x0001;   // 导入 Windows PlaySound() 函数   [DllImport("winmm.dll")]   public static extern bool PlaySound(string pszSound,    int hmod,    int fdwSound);   [STAThread]   static void Main(string[] args)   {    // 使用Ctrl+g发出蜂鸣声    Console.Write("a");    Console.WriteLine("使用Ctrl+g发出蜂鸣声...");    Console.ReadLine();    // 使用 Windows API 发出蜂鸣声    Beep(800, 200);    Console.WriteLine("使用 Windows API 发出蜂鸣声...");    Console.ReadLine();    // 播放bells.wav文件    PlaySound("bells.wav",    0,    SND_FILENAME | SND_ASYNC);    Console.WriteLine("播放bells.wav文件...");    Console.ReadLine();   }
    2022-05-23 17:14:52下载
    积分:1
  • 录音程序
    自己做的小程序,在VC++6.0下编译通过
    2022-02-28 14:04:03下载
    积分:1
  • C# 把listView数据排列成图标缩略图风格
    C#控制ListView的显示方式,把listView数据排列成图标缩略图风格,这种风格在Windows中十常见,图标的排列就是这种风格的,实现的相关代码:   private void Form1_Load(object sender, EventArgs e)   {    listView1.Items.Add("开源爱好者");//使用Add方法向控件中添加项目    listView1.Items.Add("www.codesc.net");//使用Add方法向控件中添加项目    listView1.Items.Add("C#从基础到项目实战");//使用Add方法向控件中添加项目    listView1.Items[2].Selected = true;//使用Selected方法选中第3项   }
    2023-06-24 02:00:03下载
    积分:1
  • C# 演示如何使用DataGridView更新数据
    C#更新修改DataGridView数据,请直接在DataGridView表格中修改数据,C# 更新DataGridView数据的实现代码如下:   private void button1_Click(object sender, EventArgs e)   {//更新数据    var MyCount = this.sqlDataAdapter1.Update(this.dataSet1, "Customers");    var MyInfo = "成功更新" + MyCount.ToString() + "条记录!";    MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK);   }   private void Form1_Load(object sender, EventArgs e)   {//读取Customers数据表记录    var MySQL = "Select * From Customers ";    this.sqlConnection1.ConnectionString = "Data Source=.SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";    this.sqlCommand1 = new System.Data.SqlClient.SqlCommand("Select * From Employees", this.sqlConnection1);    this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(this.sqlCommand1);    this.sqlCommandBuilder1 = new System.Data.SqlClient.SqlCommandBuilder(this.sqlDataAdapter1);    this.sqlDataAdapter1.Fill(this.dataSet1, "Customers");    this.dataGridView1.DataSource = this.dataSet1.Tables[0];
    2022-03-24 05:10:10下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载