1

I can't find Click event(picture1) in vs2008 . but the MSDN have Click event (picture2). why?

picure1:

enter image description here

picure2: enter image description here

dream
  • 95
  • 8

1 Answers1

5

The click event is marked with [BrowsableAttribute(false)] which means that it won't show up in the properties box. The reason for this is because it's not designed to called directly from your code. From MonthCalendar.Click's MSDN page:

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

There's more information about the BrowsableAttribute here.

keyboardP
  • 68,824
  • 13
  • 156
  • 205
  • Thank a lot for KeyboardP ! Now i had known this reason. I have a new question: "not use directly "-- How do i use this event ? – dream Oct 25 '12 at 01:17
  • You don't; you are strongly encouraged not to. Would MouseDown or MouseUp provide what you need? – roken Oct 25 '12 at 03:11
  • I need is MonthCalendar.DoubleClick(). I want to provide two kinds operation for select date. One: click OK button . Two: if user double click the MonthCalendar, then return the selected date. – dream Oct 25 '12 at 03:56
  • You can create your own double-click method as shown here http://stackoverflow.com/questions/8498014/capture-doubleclick-for-monthcalendar-control-in-windows-forms-app – keyboardP Oct 25 '12 at 10:30
  • Thanks for roken,KeyboardP. My understanding is as follow: MonthCalendar don't complete DoubleClick() as inherited Control. So you only design for it . – dream Oct 26 '12 at 01:16
  • Yes, it's only there to ensure consistency in the framework. You have to either avoid double-clicking or implement it yourself. – keyboardP Oct 26 '12 at 10:44