Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Using A Custom Format With The DateTimePicker


Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2003, 02:37 PM
sirmilt sirmilt is offline
Contributor
 
Join Date: Jan 2003
Location: Florida
Posts: 413
Default Using A Custom Format With The DateTimePicker


Is there some trick to setting a custom format in the DateTimePicker in code? I can't seem to get it to work.

The situation is as follows:

There are 2 radio buttons that are used to tell the program that we want to refer to either a single month or a range of dates for reporting purposes.

If the user clicks the month button, I want the DateTime Picker to return them month as MMMM yyyy. if the user clicks the period button I want the DateTime Picker to return an exact date as MMMM d, yyyy. The following code has no effect:

dtpPeriod.Format=dtpCustom
dtpPeriod.CustomFormat = "MMMM yyy"

This returns a Short Date.

What have i missed?
Reply With Quote
  #2  
Old 02-27-2003, 03:14 PM
Mikecrosoft's Avatar
Mikecrosoft Mikecrosoft is offline
Mexican Coder
 
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
Default

dtpPeriod.CustomFormat = "MMMM yyy"
dtpPeriod.Format=dtpCustom

Trying reverse it !!!
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->