自定义控件DataGridView并更改所选月份日期日历的颜色 [英] Customize Controls the DataGridView and Change color of Selected Date of Month Calendar

查看:106
本文介绍了自定义控件DataGridView并更改所选月份日期日历的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有两个与Winforms控件相关的查询,以下说明:

1).我想在DataGridViewColoumn中添加DateTimePicker(我已经阅读了文章 http://msdn.microsoft.com/zh-cn/library/7tas5c80.aspx [ ^ ],请告诉另一个.)

2).我已经在Winforms中放置了月日历控件.我想更改数据库中可用的日期的底色.

问候!
Aman

Hi All,

I have two queries related Winforms controls, which are following explained:

1). I want to add DateTimePicker in DataGridViewColoumn (I have already read the article http://msdn.microsoft.com/en-us/library/7tas5c80.aspx[^] please tell another one.).

2). I have placed the Month Calendar Control in my Winforms. I want to change the back color of date which are available in database.

Regards!
Aman

推荐答案

gridview中有关日期时间选择器的其他参考,请查看此链接;

Windows DataGridColumns用户控件 []

对于第二个问题,这是一个很好的起点;

更改背景颜色日历控件 [
Another reference for datetime picker in gridview review this link;

Windows DataGridColumns User Controls[

title="New Window">^
]

for the second question this is a good link to start with;

changing the background color of the calendar control[^]

you should take a look at Calendar.SelectedDates and Calendar.SelectedDayStyle properties

colorMyCalendar.SelectedDates.Add({DateTime object}); 
colorMyCalendar.SelectedDayStyle.BackColor = System.Drawing.Color.Yellow; 



如果您要为月份中的特定日期设置颜色,则应查看 Calendar.DayRender事件.



If you want to color specific dates in the month, then you should take a look at Calendar.DayRender Event.


这篇关于自定义控件DataGridView并更改所选月份日期日历的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆