From: Jacob on 12 Sep 2008 08:49 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 13 Sep 2008 14:57 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
|
Pages: 1 Prev: Using OCX in .NET Next: Format textbox to 3 decimal point. |