HighTechTalks DotNet Forums  

How to Show only year in DayTimePicker in C#

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss How to Show only year in DayTimePicker in C# in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sandeep Singh
 
Posts: n/a

Default How to Show only year in DayTimePicker in C# - 08-22-2007 , 04:59 AM






Hi Everyone,

How to show on UI only year using VS DayTimePicker.

Looking forward for your response.

Thanks
Sandy



Reply With Quote
  #2  
Old   
Eric Moreau
 
Posts: n/a

Default Re: How to Show only year in DayTimePicker in C# - 08-22-2007 , 05:52 AM






Can't you use a combo box?

--


HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc. (http://www.emoreau.com)
Membre du réseau .NET Expertise www.dotnet-expertise.com


"Sandeep Singh" <sandeepmaharana (AT) yahoo (DOT) com> wrote

Quote:
Hi Everyone,

How to show on UI only year using VS DayTimePicker.

Looking forward for your response.

Thanks
Sandy




Reply With Quote
  #3  
Old   
PvdG42
 
Posts: n/a

Default Re: How to Show only year in DayTimePicker in C# - 08-22-2007 , 07:31 AM



"Sandeep Singh" <sandeepmaharana (AT) yahoo (DOT) com> wrote

Quote:
Hi Everyone,

How to show on UI only year using VS DayTimePicker.

Looking forward for your response.

Thanks
Sandy

Looking here:

http://msdn2.microsoft.com/en-us/lib...r_members.aspx

it appears that is not an option. Consider Eric's suggestion to avoid
unnecessary complexity.



Reply With Quote
  #4  
Old   
Tim Van Wassenhove
 
Posts: n/a

Default Re: How to Show only year in DayTimePicker in C# - 08-22-2007 , 11:43 AM



On 2007-08-22, Sandeep Singh <sandeepmaharana (AT) yahoo (DOT) com> wrote:
Quote:
How to show on UI only year using VS DayTimePicker.
this.dateTimePicker1.CustomFormat = "yyyy";
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;

You probably want to set the ShowUpDown to true too.

Anyway, a NumericUpDown control would do the same.



--
Kind regards,
Tim Van Wassenhove <url:http://www.timvw.be/>


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.