Click here to Skip to main content
16,004,944 members
Home / Discussions / C#
   

C#

 
AnswerRe: constructor fires when?? Pin
Colin Angus Mackay31-Jan-07 6:41
Colin Angus Mackay31-Jan-07 6:41 
QuestionDateTimeMonthPicker Pin
Pratik Vasant Shah31-Jan-07 5:44
Pratik Vasant Shah31-Jan-07 5:44 
AnswerRe: DateTimeMonthPicker Pin
Luc Pattyn31-Jan-07 8:11
sitebuilderLuc Pattyn31-Jan-07 8:11 
QuestionRe: DateTimeMonthPicker Pin
Pratik Vasant Shah31-Jan-07 19:27
Pratik Vasant Shah31-Jan-07 19:27 
AnswerRe: DateTimeMonthPicker Pin
Luc Pattyn1-Feb-07 1:12
sitebuilderLuc Pattyn1-Feb-07 1:12 
QuestionRe: DateTimeMonthPicker Pin
Pratik Vasant Shah1-Feb-07 2:03
Pratik Vasant Shah1-Feb-07 2:03 
AnswerRe: DateTimeMonthPicker Pin
Luc Pattyn1-Feb-07 2:16
sitebuilderLuc Pattyn1-Feb-07 2:16 
AnswerRe: DateTimeMonthPicker Pin
Luc Pattyn1-Feb-07 5:13
sitebuilderLuc Pattyn1-Feb-07 5:13 
Hi,

you are absolutely right, when ShowUpDown=true the look and behavior change,
and you can get an ArgumentOutOfRangeException; seems the DateTimePicker gets
initialized to DateTime.Now with all details (year, month, day, h, m, s) even
when only parts of it are used. And adding 1 month to 31-JAN throws.
(This is not a big surprise, there is no such thing as a partial DateTime,
and when you were to modify ShowUpDown to false again, you would hope to see
the current date, not something else...)

Obviously the workaround must be to modify the DateTimePicker.Value at LOAD time,
i.e. before the buttons can be activated. I would suggest:
myPicker.Value=new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

Smile | :)

Luc Pattyn

QuestionDrawing on a form Pin
Da_Bigg_Z31-Jan-07 5:35
Da_Bigg_Z31-Jan-07 5:35 
AnswerRe: Drawing on a form Pin
Colin Angus Mackay31-Jan-07 5:51
Colin Angus Mackay31-Jan-07 5:51 
GeneralRe: Drawing on a form Pin
Da_Bigg_Z31-Jan-07 6:01
Da_Bigg_Z31-Jan-07 6:01 
GeneralRe: Drawing on a form Pin
RugbyLeague31-Jan-07 6:14
RugbyLeague31-Jan-07 6:14 
GeneralRe: Drawing on a form Pin
Luc Pattyn31-Jan-07 8:21
sitebuilderLuc Pattyn31-Jan-07 8:21 
AnswerRe: Drawing on a form Pin
Ennis Ray Lynch, Jr.31-Jan-07 9:59
Ennis Ray Lynch, Jr.31-Jan-07 9:59 
QuestionWhich user has the file open? Pin
RugbyLeague31-Jan-07 5:01
RugbyLeague31-Jan-07 5:01 
AnswerRe: Which user has the file open? Pin
ednrgc31-Jan-07 6:49
ednrgc31-Jan-07 6:49 
GeneralRe: Which user has the file open? Pin
RugbyLeague1-Feb-07 23:47
RugbyLeague1-Feb-07 23:47 
GeneralRe: Which user has the file open? Pin
ednrgc2-Feb-07 2:29
ednrgc2-Feb-07 2:29 
QuestionSystem call in .NET Pin
BehemotCat31-Jan-07 5:00
BehemotCat31-Jan-07 5:00 
AnswerRe: System call in .NET Pin
Wizard_0131-Jan-07 6:10
Wizard_0131-Jan-07 6:10 
GeneralRe: System call in .NET Pin
BehemotCat31-Jan-07 7:36
BehemotCat31-Jan-07 7:36 
GeneralRe: System call in .NET Pin
Dan Neely31-Jan-07 8:23
Dan Neely31-Jan-07 8:23 
GeneralRe: System call in .NET Pin
Luc Pattyn31-Jan-07 8:23
sitebuilderLuc Pattyn31-Jan-07 8:23 
GeneralRe: System call in .NET Pin
BehemotCat31-Jan-07 9:30
BehemotCat31-Jan-07 9:30 
QuestionUser Control and Window form Pin
biswabhusan31-Jan-07 4:33
biswabhusan31-Jan-07 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.