主婦と.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.

# VDZiLDdEHY 2014/08/08 2:16 https://www.youtube.com/user/katiek4604/featured?v

I am so grateful for your post.Much thanks again. Awesome.

# YxyMBDeXtxLsxDC 2014/08/08 4:37 http://www.emeraldmatch.com/Miami-Dating-Site

I truly appreciate this post.Thanks Again. Much obliged.

# LuAJpfJJOgkTrVpW 2014/08/08 5:51 https://www.youtube.com/watch?v=RCfvinbybnc

Great, thanks for sharing this article post.Really looking forward to read more.

# vJbsiJAifwX 2014/08/08 15:28 http://channelsmedia.me/

Really informative blog article.Thanks Again. Much obliged.

# lMDcSeFHKE 2014/08/08 18:04 http://www.sanantonio.com/places/law-offices-of-je

Thanks-a-mundo for the blog.Really looking forward to read more.

# FiKjDSqkdge 2014/08/08 18:49 http://carpetcleaningrockwalltx.jimdo.com/

Thanks so much for the post.Much thanks again. Want more.

# VDZnrvIkft 2014/08/09 1:28 http://www.amjobhunter.info

I think this is a real great article post.Thanks Again. Awesome.

# rGdWYvOGjmCFq 2014/08/09 4:15 http://xn--80alfk0afh.xn--p1ai/user/ugnayiopdeaiid

Very informative article post.Really looking forward to read more. Fantastic.

# AnWDkuIANlwCaySo 2014/08/09 10:54 http://downloadsoverviews.com/tool-software/tube-v

Muchos Gracias for your post.Thanks Again. Keep writing.

# ZHsuwoHcWCHqKAHT 2014/08/09 20:31 http://allpcsoftware.com/free-download-connectify/

Appreciate you sharing, great blog article.Thanks Again. Awesome.

# crByyUYIuQZhlG 2014/08/11 14:32 http://www.walktc.com/

This is one awesome blog article.Really looking forward to read more. Much obliged.

# yPhLiXxeIkLjO 2014/08/11 16:02 http://cliks.fr/Hi45

Thanks again for the article post.Much thanks again. Much obliged.

# hddMlanvxqo 2014/08/12 17:58 http://bengoshi-japan.net/?p=14703

Thanks for the blog post.Really looking forward to read more. Much obliged.

# AONtkvDiVuGMMRXeRam 2014/08/12 19:19 http://mcabenefitsonline.info/story/71946

Great, thanks for sharing this post.Really looking forward to read more.

# CmnWKmbhGDvsJ 2014/08/12 23:25 http://agri-life.net/userinfo.php?uid=562980

Very neat article.Much thanks again. Will read on...

# eniNkvyFkTRfAH 2014/08/13 0:01 http://hottchatt.com/blog/view/17636/the-art-of-se

I value the article. Awesome.

# fHMQvLnkjQ 2014/08/13 3:02 http://hiu-net.com/

I really like and appreciate your article post.Much thanks again. Great.

# MkVajyHmzQrrGLQP 2014/08/13 17:46 http://hayday.hack-team.org

I really enjoy the blog post. Keep writing.

# dzrTWolLKYaZZ 2014/08/13 19:22 http://www.fourcorners.info

I think this is a real great article post.Thanks Again. Will read on...

# LoAPaepTcNSQp 2014/08/13 19:33 https://www.facebook.com/comodescargarvideosdeyout

Very good blog post. Fantastic.

# XjfUrWIfIfNNz 2014/08/13 22:25 http://ekyrs.org/support/index.php?action=profile;

Very informative article.Really looking forward to read more.

# nJtSPwBzfgmogLM 2014/08/14 16:23 http://www.propertyblogshop.com

I really like and appreciate your article post.Really looking forward to read more.

# FIzmArjJxm 2014/08/15 2:33 http://www.gaiaonline.com/journal/?mode=view&p

I really enjoy the article post.Much thanks again. Awesome.

# vtrnsOyRcTXhxjARE 2014/08/15 22:10 http://kyrgyzembkorea.com/user/recippnrcugran/

Im obliged for the article post.Thanks Again. Will read on...

# BxcfmuHVfEEXZOgw 2014/08/16 0:55 http://kyrgyzembkorea.com/user/racccddurbrgeo/

Very neat blog post.Really looking forward to read more. Fantastic.

# dilWsvNApGyT 2014/08/16 2:23 http://invobr.ru/user/ucyyioeroonagb/

I value the article.Thanks Again. Much obliged.

# cKdoHTtiqjZpDPq 2014/08/16 19:46 http://www.fiverr.com/bapparabi/manually-create-10

Thanks-a-mundo for the post. Keep writing.

# azaiusvibXc 2014/08/16 22:10 http://www.buytopproducerformula.com/

Thanks so much for the article post.Really looking forward to read more.

# GcgbxnvmPa 2014/08/17 9:42 http://hugemo.asia

I think this is a real great article.Thanks Again.

# xYQLfSJWeaTJ 2014/08/18 4:07 http://www.firstclassdallas.com/Dallas-Restaurants

Hey, thanks for the article post. Great.

# rDKplmllEHA 2014/08/18 21:41 http://www.phpbbplanet.com/aguinaldohighsc/profile

Awesome article.Really looking forward to read more. Will read on...

# kRQhFROPhwmIhX 2014/08/19 9:05 http://www.theboatonlinestore.com/

Im thankful for the article post.Really looking forward to read more. Will read on...

# UiVfVUOHObWKoZBacEs 2014/08/19 17:09 http://www.alesandra.lt/drabuziai/chalatai/

Great, thanks for sharing this blog post. Keep writing.

# uRIcrBfQboO 2014/08/19 18:13 http://ekyrs.org/support/index.php?action=profile;

Thanks again for the blog post. Will read on...

# nlzACJEkLTNEiw 2014/08/19 20:37 http://youtu.be/bh2rHHVZfaE

Thanks for the blog article.Thanks Again.

# mqbvPHRjjIpLECErqz 2014/08/20 18:48 http://www.adrenalinbecker.de

Thanks so much for the article.Much thanks again.

# saEKJUYTbp 2014/08/21 16:50 http://www.m88so.com/Main/Home.aspx?affiliateId=97

Awesome blog. Fantastic.

# nKRXmJaBFAbkEvbWuf 2014/08/21 21:05 http://www.irectify.co.uk/

Very informative blog.Much thanks again. Keep writing.

# CWoRigTqCPKt 2014/08/22 17:02 http://www.myfilmebi.net/user/dgbeiiciodrdea/

Major thankies for the blog article.Much thanks again. Great.

# EqDPHjOUQQZfvqKq 2014/08/24 17:13 http://degi.info/story/88439

Im grateful for the post.Really looking forward to read more. Keep writing.

# uhRvVpeOqkrfF 2014/08/24 21:51 http://www.pinterest.com/IrvineCarRepair/

Thanks so much for the blog post.Thanks Again. Much obliged.

# rTLPkMEwaDTjrcNP 2014/08/25 22:38 http://blog.filmentiergratuit.fr/

Thanks a lot for the article post.Really looking forward to read more. Want more.

# IBcHgpNvXMt 2014/08/25 22:48 http://huntinafrica.co.za

Really enjoyed this article post.Thanks Again. Fantastic.

# khJBBwgSaktlTdTW 2014/08/26 7:31 http://theboatonlinestore.es/

Muchos Gracias for your post.Thanks Again. Will read on...

# riFmSSTNvVVekfF 2014/08/26 8:17 http://podle.pl/

Really enjoyed this blog article.Much thanks again.

# GjwiYVVjCeXPjPCY 2014/08/26 8:49 http://ecommerce-for-business.com/

Really informative article. Keep writing.

# qrciASmDwEdCOjzJ 2014/08/26 9:07 http://www.theboatonlinestore.co.uk/

Muchos Gracias for your article post.Really looking forward to read more. Much obliged.

# FMKiGwuuPmgpTJawM 2014/08/26 10:14 http://vender-en-internet.es/

Appreciate you sharing, great blog post. Great.

# FAcmqzbJyMfmMuTaCX 2014/08/26 11:47 http://vendere-su-internet.com/

I truly appreciate this blog article.Thanks Again. Want more.

# gMBpGUJdSkaOHrLCKtA 2014/08/26 12:00 http://www.theboatonlinestore.com/

Very informative blog post.Really looking forward to read more.

# vSQUnPxRInA 2014/08/26 13:25 http://gigaarcade.com

Im grateful for the article post. Fantastic.

# hOPsytvWyFY 2014/08/26 14:31 http://www.m88so.com/Main/Home.aspx?affiliateId=97

Thanks for sharing, this is a fantastic article post.Thanks Again. Much obliged.

# NzFdwkmRwAWjee 2014/08/26 22:49 http://noaggravation.info/story/22855

Thanks so much for the post. Fantastic.

# vfrEjYBXXiefAFRtgPY 2014/08/27 1:49 http://daem-soft.ru/user/abugbbgnpubbcr/

Thanks again for the blog article. Really Great.

# JDMGfXqDHwCGVUkC 2014/08/27 17:44 http://www.kutsenko.ru/forum/index.php?showuser=43

Fantastic article.Thanks Again. Great.

# alKpRCltfQKJwRDpzW 2014/08/27 21:56 http://farcry2.info/index.php?subaction=userinfo&a

Really informative blog article.Really looking forward to read more. Really Great.

# FiFprKsYHehaowoY 2014/08/28 18:20 http://studylib.com/index.php?subaction=userinfo&a

Very good blog article.Much thanks again. Will read on...

# nLefjOBEcJtV 2014/08/28 19:46 http://jobsaratov.ru/tools.php?event=profile&p

Enjoyed every bit of your article post.Much thanks again. Fantastic.

# AUOnvenSZLJdUVXiGsx 2014/08/28 22:35 http://kyrgyzembkorea.com/user/gonednciiauciy/

Wow, great article post.Much thanks again. Great.

# VOVCXPQqJDbnGgyRx 2014/08/29 6:59 http://mega-sborka.ru/user/Jareejahroodsh7i/

Very neat post. Want more.

# dcFWnpmRHokKspYze 2014/08/29 11:59 http://invobr.ru/user/dcodndogagbuci/

Thanks again for the post.Really looking forward to read more. Keep writing.

# vgXzJNbiznadQxTuOH 2014/08/29 15:56 http://kyrgyzembkorea.com/user/cpgubngcuuopyy/

Im grateful for the blog.Much thanks again. Awesome.

# DwweXrQPmozHOt 2014/08/30 0:35 http://www.lista-nascita.it

This is one awesome blog. Will read on...

# LcUefgGaLOZquoE 2014/08/30 1:57 http://kinowarez.com/user/nggcordcoonobu/

Appreciate you sharing, great blog. Really Great.

# YbxcwTCNoyQNdrJ 2014/08/30 6:13 http://apkvvc.ru/user/SibnesDrierne595/

I truly appreciate this blog article.Really looking forward to read more. Fantastic.

# oIenDwXylvZKzyh 2014/08/30 14:48 http://forum.pocketz.ru/index.php?s=f06167d5065c7d

Great article.Much thanks again. Much obliged.

# KgWJJaiaRjZ 2014/08/30 16:11 http://www.desdv.ru/user/Pubcuccicabut318/

I am so grateful for your article.Much thanks again.

# NwqkePmkep 2014/08/31 5:12 http://www.avtobooki.ru/user/UNURNEREK838/

I value the article post.Really looking forward to read more. Really Great.

# SncPQWKnXNQKaLoGyTx 2014/09/01 18:07 http://firebase116.org/forums/users/nrpydncpaoppdc

Thanks for sharing, this is a fantastic post.Thanks Again.

# Iss online 2014/09/01 20:33 Michaeloa

crorkservice, I see you know the meaning of literate comments ... :))
for example, there is (http://mksonline.ucoz.ru/)

# JeboAvyUycWjldt 2014/09/08 19:37 http://www.arrasproperties.com/

You made some respectable factors there. I regarded on the web for the difficulty and located most people will associate with along with your website.

# 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/

タイトル  
名前  
Url
コメント