Public /*! @brief PaintDCイベントハンドラを追加する */ Sub AddPaintDC(h As PaintDCEventHandler) If IsNothing(paintDC) Then paintDC = New PaintDCEventHandler End If paintDC += h End Sub /*! @brief PaintDCイベントハンドラを削除する */ Sub RemovePaintDC(h As PaintDCEventHandler) If Not IsNothing(paintDC) Then paintDC -= h End If End Sub Protected /*! @brief ウィンドウの描画が必要なときに呼び出されます。 */ Virtual Sub OnPaintDC(e As PaintDCEventArgs) If Not IsNothing(paintDC) Then paintDC(This, e) End If End Sub Private paintDC As PaintDCEventHandler Public /*! @brief Clickイベントハンドラを追加する */ Sub AddClick(h As EventHandler) If IsNothing(click) Then click = New EventHandler End If click += h End Sub /*! @brief Clickイベントハンドラを削除する */ Sub RemoveClick(h As EventHandler) If Not IsNothing(click) Then click -= h End If End Sub Protected /*! @brief クリックされたときに呼び出されます。 */ Virtual Sub OnClick(e As EventArgs) If Not IsNothing(click) Then click(This, e) End If End Sub Private click As EventHandler Public /*! @brief DoubleClickイベントハンドラを追加する */ Sub AddDoubleClick(h As EventHandler) If IsNothing(doubleClick) Then doubleClick = New EventHandler End If doubleClick += h End Sub /*! @brief DoubleClickイベントハンドラを削除する */ Sub RemoveDoubleClick(h As EventHandler) If Not IsNothing(doubleClick) Then doubleClick -= h End If End Sub Protected /*! @brief ダブルクリックされたときに呼び出されます。 */ Virtual Sub OnDoubleClick(e As EventArgs) If Not IsNothing(doubleClick) Then doubleClick(This, e) End If End Sub Private doubleClick As EventHandler Public /*! @brief MouseDownイベントハンドラを追加する */ Sub AddMouseDown(h As MouseEventHandler) If IsNothing(mouseDown) Then mouseDown = New MouseEventHandler End If mouseDown += h End Sub /*! @brief MouseDownイベントハンドラを削除する */ Sub RemoveMouseDown(h As MouseEventHandler) If Not IsNothing(mouseDown) Then mouseDown -= h End If End Sub Protected /*! @brief マウスボタンが押されたときに呼び出されます。 */ Virtual Sub OnMouseDown(e As MouseEventArgs) If Not IsNothing(mouseDown) Then mouseDown(This, e) End If End Sub Private mouseDown As MouseEventHandler Public /*! @brief MouseUpイベントハンドラを追加する */ Sub AddMouseUp(h As MouseEventHandler) If IsNothing(mouseUp) Then mouseUp = New MouseEventHandler End If mouseUp += h End Sub /*! @brief MouseUpイベントハンドラを削除する */ Sub RemoveMouseUp(h As MouseEventHandler) If Not IsNothing(mouseUp) Then mouseUp -= h End If End Sub Protected /*! @brief マウスボタンが離されたときに呼び出されます。 */ Virtual Sub OnMouseUp(e As MouseEventArgs) If Not IsNothing(mouseUp) Then mouseUp(This, e) End If End Sub Private mouseUp As MouseEventHandler