From: Jacob on
For some reason, the MonthCalendar class (control) does not show the
MouseDoubleClick method (event) in the VS IDE. I added an event
handler but can't get the succker to fire the event it points to.

Any idea what I'm doing wrong? Here is the code I added...

Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
AddHandler MonthCalendar1.MouseDoubleClick, AddressOf MDC_event
End Sub

Private Sub MDC_event(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs)
' Do something
End Sub


Thanks in advance,
Jacob
From: kimiraikkonen on
On Sep 12, 3:49 pm, Jacob <ja...(a)letitgo.org> wrote:
> For some reason, the MonthCalendar class (control) does not show the
> MouseDoubleClick method (event) in the VS IDE. I added an event
> handler but can't get the succker to fire the event it points to.
>
> Any idea what I'm doing wrong? Here is the code I added...
>
> Public Sub New()
> ' This call is required by the Windows Form Designer.
> InitializeComponent()
> ' Add any initialization after the InitializeComponent() call.
> AddHandler MonthCalendar1.MouseDoubleClick, AddressOf MDC_event
> End Sub
>
> Private Sub MDC_event(ByVal sender As Object, ByVal e As
> System.Windows.Forms.MouseEventArgs)
> ' Do something
> End Sub
>
> Thanks in advance,
> Jacob

Same with VB 2008 Express + .NET 3.5 SP1. Though IntelliSense doesn't
offer Double Click and Click events for MonthCalendar unlike MSDN
docs, however when you define event strictly within handles clause, no
compilation error is claimed, interestingly, also the event isn't
raised at runtime on doubleclick though application is compiled
without indicating any exception:

Private Sub MonthCalendar1_DoubleClick(ByVal sender As System.Object,
_
ByVal e As System.EventArgs) Handles MonthCalendar1.DoubleClick
MsgBox("test")
End Sub

However behaviour is the same as Combobox, CheckBox and Button.
(IntelliSense doesn't offer DoubleClick but compiling is succeeded,
but event isn't raised) based on my tests.


Onur Güzel