主婦と.NETと犬のぶろぐ

奥様 と プログラム と お犬様 の 楽しい日常

目次

Blog 利用状況

ニュース

書庫

日記カテゴリ

DateTimePicker(System.Windows.Forms.DateTimePicker)

DateTimePicker については、わんくま内でおぎわらさんやえムナウさんも既に興味深い記事を書かれています。

私が今まで使った事がなかったのが、DropDownAlign プロパティと、CalendarFont とか CalendarForeColor とか。
なので、それで遊んでみました。

ShowCheckBox にしておいて、Checked を False にしても Check が外れない。
ここでも話題になっていたようですが、
DateTimePicker の Checked プロパティの説明をよくよく読んでみると、
[引用]
プロパティ値
Value プロパティに有効な DateTime 値が設定され、その表示された値を更新できる場合は true。それ以外の場合は false。既定値は true です。
[/引用]
と書いてあります。つまり、更新するしないの機能と Value の値が妥当であるかの検証を同じプロパティで実現しているってことなんでしょうか。
Value を先にセットして、それが妥当かどうかのチェックを終らせた後に Checked = False とやるといけるようです。

■参考文献
[Tips][WinForm]DateTimePickerで時間を表示させる方法(おぎわらさん)
DateTimePickerで和暦を表示させる(えムナウさん)
日付と時刻の書式指定文字列
DateTimePicker コントロール (Windows フォーム)
DateTimePicker クラス
DateTimePickerFormat 列挙体
.NET TimePicker

■実行画像
DropDownAlign = LeftRightAlignment.Right
DateTimePicker LeftRightAlignment.Right
色やフォントを変えたカレンダ
DateTimePicker 色やフォントを変えたカレンダ

Public Class DateTimePickerTest

Private Sub DateTimePickerTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '' DateTimePickerFormat で表示形式を変える ' コントロールパネル→地域と言語のオプション→長い形式 に依存 Me.Label1.Text = "Long" Me.DateTimePicker1.Format = DateTimePickerFormat.Long ' コントロールパネル→地域と言語のオプション→短い形式 に依存 Me.Label2.Text = "Short" Me.DateTimePicker2.Format = DateTimePickerFormat.Short ' コントロールパネル→地域と言語のオプション→時刻 に依存 Me.Label3.Text = "Time" Me.DateTimePicker3.Format = DateTimePickerFormat.Time ' カスタム書式 Me.Label4.Text = "Custom" Me.DateTimePicker4.Format = DateTimePickerFormat.Custom Me.DateTimePicker4.CustomFormat = "yyyy-MM-dd(dddd) hh:mm:ss"
'' ShowUpDown プロパティ(規定値は False) Me.Label5.Text = "ShowUpDown" Me.DateTimePicker5.ShowUpDown = True
'' DropDownAlign プロパティ(規定値は LeftRightAlignment.Left) Me.Label6.Text = "DropDownAlign.Right" Me.DateTimePicker6.DropDownAlign = LeftRightAlignment.Right
'' ShowCheckBox プロパティ Me.Label7.Text = "ShowCheckBox" Me.DateTimePicker7.ShowCheckBox = True ' 選択する日付を翌日にする Me.DateTimePicker7.Value = DateTime.Today.AddDays(1.0) Me.DateTimePicker7.Checked = False ' 下限と上限を設定 Me.DateTimePicker7.MinDate = New DateTime(2006, 1, 1) Me.DateTimePicker7.MaxDate = New DateTime(2007, 1, 1)
'' 予定表の部分の色を変える Me.Label8.Text = "CalendarColor" Me.DateTimePicker8.CalendarFont = New Font("Goudy Stout", 20.0F, GraphicsUnit.Pixel) Me.DateTimePicker8.CalendarForeColor = Color.Navy Me.DateTimePicker8.CalendarMonthBackground = Color.LightBlue Me.DateTimePicker8.CalendarTitleBackColor = Color.Navy Me.DateTimePicker8.CalendarTitleForeColor = Color.LightBlue Me.DateTimePicker8.CalendarTrailingForeColor = Color.White End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Console.WriteLine("====DateTimePicker1(長い形式)====") Console.WriteLine(Me.DateTimePicker1.Value.ToString()) Console.WriteLine(Me.DateTimePicker1.Text) Console.WriteLine("====DateTimePicker2(短い形式)====") Console.WriteLine(Me.DateTimePicker2.Value.ToString()) Console.WriteLine(Me.DateTimePicker2.Text) Console.WriteLine("====DateTimePicker3(時刻)====") Console.WriteLine(Me.DateTimePicker3.Value.ToString()) Console.WriteLine(Me.DateTimePicker3.Text) Console.WriteLine("====DateTimePicker4(カスタム書式)====") Console.WriteLine(Me.DateTimePicker4.Value.ToString()) Console.WriteLine(Me.DateTimePicker4.Text) Console.WriteLine("====DateTimePicker5(ShowUpDown)====") Console.WriteLine(Me.DateTimePicker5.Value.ToString()) Console.WriteLine(Me.DateTimePicker5.Text) Console.WriteLine("====DateTimePicker6(DropDownAlign)====") Console.WriteLine(Me.DateTimePicker6.Value.ToString()) Console.WriteLine(Me.DateTimePicker6.Text) Console.WriteLine("====DateTimePicker7(ShowCheckBox)====") Console.WriteLine(Me.DateTimePicker7.Value.ToString()) Console.WriteLine(Me.DateTimePicker7.Text) Console.WriteLine("====DateTimePicker8(予定表の色)====") Console.WriteLine(Me.DateTimePicker8.Value.ToString()) Console.WriteLine(Me.DateTimePicker8.Text)
' DateTimePicker1.Value ~ DateTimePicker7.Value の間隔を求める Dim span As TimeSpan = Me.DateTimePicker7.Value.Subtract(Me.DateTimePicker1.Value) Console.WriteLine("====DateTimePicker1.Value ~ DateTimePicker7.Value の間隔====") Console.WriteLine(span.TotalDays.ToString() & "日間") Console.WriteLine(span.TotalHours.ToString() & "時間") Console.WriteLine(span.TotalMinutes.ToString() & "分") Console.WriteLine(span.TotalSeconds.ToString() & "秒") Console.WriteLine(span.TotalMilliseconds.ToString() & "ミリ秒") End Sub End Class

投稿日時 : 2006年12月15日 12:35

Feedback

# ContextMenuStrip クラス(System.Windows.Forms.ContextMenuStrip)と ContextMenu クラス(System.Windows.Forms.ContextMenu) 2006/12/18 14:13 主婦と.NETと犬のぶろぐ

ContextMenuStrip クラス(System.Windows.Forms.ContextMenuStrip)と ContextMenu クラス(System.Windows.Forms.ContextMenu)

# uRYdohRNQQDwKxqLGNw 2014/08/04 3:34 http://crorkz.com/

2D1GHO Fantastic blog post. Really Great.

# cartier love bracelet inside replica 2015/07/29 15:31 refkcafq@aol.com

残りの55%は、50ドルの生産コストとシェールオイルで、同社のより最近の投資で覆われています。これは、あなたが長いrun,?電動自転車用バ&#12
cartier love bracelet inside replica http://www.rosegoldlovejewelry.com/the-cartier-love-jewellery/

# cartier love bracelet price uk replica 2015/07/30 16:55 lyywiyjoh@aol.com

私は喘息の吸入器の二種類があることを学びました,MELMO メルモ。彼らは、コントローラおよび救助者です,RABOKIGOSHI works ワークス。私の医師によると、&#
cartier love bracelet price uk replica http://www.global-military.com/tag/cartier-love-jewellery-stainless-steel-price

# replique sac chanel prix 2.55 2015/08/28 1:06 etasbrg@aol.com

Интересный сайтик и дизайн не навязчивый
replique sac chanel prix 2.55 http://www.replicasbag.net/fr/-c87_88/

# shIuOfYLIzRJzPsCVv 2019/04/15 23:23 https://www.suba.me/

gjt5PJ Really appreciate you sharing this blog article.Thanks Again. Awesome.

# amrhYGkdoP 2019/04/19 14:58 https://www.suba.me/

qzsxTD Wow, marvelous blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is fantastic, let alone the content!

# ZgGbULQvgsuaLPvlSrj 2019/04/27 19:37 https://devpost.com/ducupelfe

Informative and precise Its difficult to find informative and accurate information but here I noted

# DpdhiCzQJia 2019/04/30 16:47 https://www.dumpstermarket.com

Perfect work you have done, this site is really cool with good information.

# pbcFMLoZWScqXpkD 2019/04/30 19:49 https://cyber-hub.net/

Thanks for the blog.Really looking forward to read more. Fantastic.

# pfgcUebaSiTDxMIQm 2019/04/30 23:25 http://www.tunes-interiors.com/UserProfile/tabid/8

It is best to participate in a contest for probably the greatest blogs on the web. I will suggest this website!

# FlCHqiwkeoykalW 2019/05/01 21:58 http://freetexthost.com/xkoor5l4s2

Loving the weblog.. thanks! So pleased to possess located this submit.. Truly appreciate the posting you made available.. Take pleasure in the admission you delivered..

# WRTOPJxAHoRCJigIct 2019/05/02 22:26 https://www.ljwelding.com/hubfs/tank-growing-line-

Subsequently, after spending many hours on the internet at last We ave uncovered an individual that definitely does know what they are discussing many thanks a great deal wonderful post

# fPDLAehUssgDjdWd 2019/05/03 12:29 https://mveit.com/escorts/united-states/san-diego-

I think this is a real great blog.Really looking forward to read more. Fantastic.

# dMsYPfbRDumhfLEYQww 2019/05/03 15:20 https://www.youtube.com/watch?v=xX4yuCZ0gg4

Wow! This could be one particular of the most beneficial blogs We ave ever arrive across on this subject. Basically Magnificent. I am also an expert in this topic so I can understand your effort.

# zSiysJRpNHLfJzxe 2019/05/03 15:57 https://mveit.com/escorts/netherlands/amsterdam

Utterly composed written content, regards for entropy. Life is God as novel. Let him write it. by Isaac Bashevis Singer.

# QboXPcbaJMBRlTqaF 2019/05/03 18:21 https://mveit.com/escorts/australia/sydney

located that it is truly informative. I'm gonna be

# DqpbAEwpaWqoISZo 2019/05/03 20:26 https://mveit.com/escorts/united-states/houston-tx

Thanks again for the article.Really looking forward to read more. Want more.

# cBKptskrfBiocW 2019/05/03 22:12 https://mveit.com/escorts/united-states/los-angele

Very excellent info can be found on web blog.

# mBrIoQaFQHiMdJa 2019/05/03 22:30 http://caromont1.org/__media__/js/netsoltrademark.

It as not that I want to replicate your web-site, but I really like the pattern. Could you let me know which style are you using? Or was it tailor made?

# vtLFMXLOfrlJtJSOYT 2019/05/04 2:39 http://degreeweapon73.ebook-123.com/post/advantage

Im thankful for the blog.Really looking forward to read more. Want more.

# UMknBejpcKtRVUQdTE 2019/05/04 4:21 https://www.gbtechnet.com/youtube-converter-mp4/

This tends to possibly be pretty beneficial for a few of the employment I intend to you should not only with my blog but

# PlDVIhHQsaTHKW 2019/05/04 16:53 https://wholesomealive.com/2019/04/28/top-12-benef

Well I sincerely liked reading it. This subject offered by you is very effective for correct planning.

# VfOkHMnhJakMPAM 2019/05/07 15:50 https://www.newz37.com

Very good blog article.Much thanks again. Really Great.

# pPCkwNECyhRkz 2019/05/07 17:05 http://all4webs.com/mindlace9/esllzuggxw867.htm

Tumblr article I saw someone writing about this on Tumblr and it linked to

# iQQxNDsmNNOmvt 2019/05/07 17:49 https://www.mtcheat.com/

Its hard to find good help I am constantnly saying that its hard to procure quality help, but here is

# GVtquyPmDZslcDySQF 2019/05/08 20:36 https://sultanwaller.yolasite.com/

Saved as a favorite, I like your website!

# hTZXjhDqMLx 2019/05/08 23:04 https://www.youtube.com/watch?v=xX4yuCZ0gg4

What a funny blog! I actually enjoyed watching this humorous video with my relatives as well as with my friends.

# vRkSRvqzIxkqqchT 2019/05/09 8:56 https://amasnigeria.com/7-types-of-jamb-candidates

skills so I wanted to get advice from someone with experience. Any help would be enormously appreciated!

# dTsIZSjDfHdVbJ 2019/05/09 11:00 http://viajeraconsumada0dg.wallarticles.com/sit-do

It is really a great and helpful piece of info. I am glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

# DZrGwCZPLaaQCaofq 2019/05/09 13:03 https://writexo.com/12i8hzsx

of him as nobody else know such designated about my trouble.

# aCjjvkcSADrKswbb 2019/05/09 15:12 https://reelgame.net/

speed of which you are able to get your loan katy perry tickets the simplest way you are going

# RFRaWzeyAzcJniiyWFG 2019/05/09 15:51 http://joanamacinnisxvs.biznewsselect.com/it-is-no

I think this is a real great blog.Thanks Again. Much obliged.

# qOLtKrslbqOv 2019/05/09 23:36 https://www.ttosite.com/

site and now this time I am visiting this site and reading very informative posts at this time.

# DmFNzojtQynesG 2019/05/10 6:36 https://bgx77.com/

Very good blog.Much thanks again. Keep writing.

# WOrETniYFgEllps 2019/05/10 8:07 https://rehrealestate.com/cuanto-valor-tiene-mi-ca

You are my inspiration, I possess few web logs and rarely run out from brand . The soul that is within me no man can degrade. by Frederick Douglas.

# IDalkpCmhjAD 2019/05/11 3:58 http://wastenot.wales/story.php?title=nonton-movie

This very blog is definitely entertaining additionally amusing. I have discovered a lot of helpful tips out of this source. I ad love to visit it every once in a while. Thanks!

# vluNuflECC 2019/05/11 4:36 https://www.mtpolice88.com/

out. I like what I see so now i am following you.

# GYqNqzakPA 2019/05/12 20:09 https://www.ttosite.com/

Well I definitely enjoyed reading it. This post provided by you is very constructive for correct planning.

# MFnhANWSmrnArRixxkg 2019/05/12 21:43 https://www.sftoto.com/

Just Browsing While I was surfing yesterday I noticed a great post concerning

# naNpXtVQaWWNeFW 2019/05/12 23:55 https://www.mjtoto.com/

Woh I like your content , saved to favorites !.

# nASRzRszlsHSmGF 2019/05/13 18:58 https://www.ttosite.com/

Ridiculous quest there. What happened after? Thanks!

# VNNQtduTzgE 2019/05/14 2:13 https://www.navy-net.co.uk/rrpedia/How_To_Very_Bes

Therefore that as why this post is great. Thanks!

# VrmFFNjXxX 2019/05/14 5:09 http://www.cses.tyc.edu.tw/userinfo.php?uid=221832

That is a really good tip particularly to those fresh to the blogosphere. Brief but very accurate information Appreciate your sharing this one. A must read post!

# ofJiNefbEJT 2019/05/14 9:45 http://www.musumeciracing.it/index.php?option=com_

There is a bundle to know about this. You made good points also.

# LrjiwnNiuPilxwJZOUB 2019/05/14 11:54 https://amara.org/en/videos/YzrXoraHQ9rC/info/plat

Links I am continually looking online for ideas that can help me. Thx!

# ElkEticDJDs 2019/05/14 20:15 https://bgx77.com/

Strange but true. Your resource is expensive. At least it could be sold for good money on its auction!

# CKKeVDQlAaEyNMvhd 2019/05/14 22:24 http://turismoporelmundom10.envision-web.com/a-new

Spot on with this write-up, I actually assume this website wants rather more consideration. I all probably be once more to learn way more, thanks for that info.

# ccLonIXcXTkxseoiXmV 2019/05/15 0:55 https://www.mtcheat.com/

user in his/her brain that how a user can be aware of it.

# rMgAgWsXXM 2019/05/15 2:58 http://olson0997cb.blogspeak.net/she-was-so-happy-

This website was how do I say it? Relevant!! Finally I have found something that helped me. Thanks a lot!

# WJizIkHEdPEgVWQdZp 2019/05/15 3:39 http://www.jhansikirani2.com

Some genuinely prize content on this web site , saved to my bookmarks.

# KuwmPYOCnhV 2019/05/15 9:37 http://www.wenhua.sd.cn/home.php?mod=space&uid

you have a terrific blog here! would you like to make some invite posts on my blog?

# FVZZwxJHeKzy 2019/05/15 17:16 http://mouseactor7.bravesites.com/entries/general/

Wow, awesome blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is wonderful, let alone the content!

# tlZDOjJlrfChme 2019/05/17 5:56 https://www.youtube.com/watch?v=Q5PZWHf-Uh0

This website was how do you say it? Relevant!! Finally I ave found something that helped me. Many thanks!

# JBihtfYdnCCNYeSTHBw 2019/05/17 18:53 https://www.youtube.com/watch?v=9-d7Un-d7l4

webpage or even a weblog from start to end.

# mWzwGcdQDQnFAVsCYrz 2019/05/17 22:22 http://adep.kg/user/quetriecurath443/

I truly appreciate this post.Really looking forward to read more. Great.

# YzOdArOwsViNZpXoqZF 2019/05/18 2:22 https://tinyseotool.com/

Very informative article post.Thanks Again. Much obliged.

# hsfrSPvOWc 2019/05/18 2:50 http://www.zarin.biz/__media__/js/netsoltrademark.

Some genuinely prize content on this website , saved to my bookmarks.

# tQzgWnYWPjOfeDrODH 2019/05/18 5:23 http://developmentcontact.net/__media__/js/netsolt

information. I am bookmarking and will be tweeting this

# aNtQAOGufAT 2019/05/18 9:28 https://bgx77.com/

When some one searches for his necessary thing, therefore he/she needs to be available that in detail, thus that thing is maintained over here.

# FCNHnnMnMcvg 2019/05/18 11:01 https://www.dajaba88.com/

Thanks again for the blog post. Fantastic.

# nTEgwYqRGM 2019/05/20 16:56 https://nameaire.com

So happy to possess located this publish.. Terrific opinions you have got here.. I enjoy you showing your perspective.. of course, analysis is paying off.

# QsMrGGxHWB 2019/05/21 21:38 https://nameaire.com

wow, awesome blog article. Keep writing.

タイトル  
名前  
Url
コメント