|
Option Strict Off
' Copyright And Detail -------------------------------------------------------------------------------------
' Name: Itchin.Winforms.UIStudio.Controls.NavigationBarDesigner
' Author: Gary Noble (gwnoble@msn.com)
' Date: 19/08/2005
'
' Requires: Nothing
'
' Copyright � Parts 2005 Gary Noble
' --------------------------------------------------------------------------------------
'
' A Designer Class For The NavigationBar Class Design-Time Support
'
' --------------------------------------------------------------------------------------
' History:
'
' --------------------------------------------------------------------------------------
' Date User Detail
' --------------------------------------------------------------------------------------
'
' 19/08/2005 Gary Noble Original
'
' --------------------------------------------------------------------------------------
'
' ********* If You Use This Control Please Give Credit *********
'
' --------------------------------------------------------------------------------------
' Copyright (c) 2005/6 Gary Noble
' ---------------------------------------------------------------------
'
' Redistribution and use in source and binary forms, with or
' without modification, are permitted provided that the following
' conditions are met:
'
' 1. Redistributions of source code must retain the above copyright
' notice, this list of conditions and the following disclaimer.
'
' 2. Redistributions in binary form must reproduce the above copyright
' notice, this list of conditions and the following disclaimer in
' the documentation and/or other materials provided with the distribution.
'
' 3. The end-user documentation included with the redistribution, if any,
' must include the following acknowledgment:
'
' "This product includes software developed by Gary Noble"
'
' Alternately, this acknowledgment may appear in the software itself, if
' and wherever such third-party acknowledgments normally appear.
'
' THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
' INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
' AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
' GARY NOBLE OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
' INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
' BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
' USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
' THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'
' ---------------------------------------------------------------------
Imports System.Runtime.InteropServices
Imports System.Drawing.Imaging
Public Class ButtonBarDesigner
Inherits System.Windows.Forms.Design.ControlDesigner
Private m_Control As ButtonBar
Private Sub OnSelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
m_Control.Invalidate()
End Sub
Private Sub OnComponentRemoving(ByVal sender As Object, ByVal e As ComponentEventArgs)
m_Control.Invalidate()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
Dim s As ISelectionService = DirectCast(GetService(GetType(ISelectionService)), _
ISelectionService)
Dim c As IComponentChangeService = DirectCast(GetService(GetType _
(IComponentChangeService)), IComponentChangeService)
'Unhook events
RemoveHandler s.SelectionChanged, AddressOf OnSelectionChanged
RemoveHandler c.ComponentRemoving, AddressOf OnComponentRemoving
MyBase.Dispose(disposing)
End Sub
Public Overrides ReadOnly Property AssociatedComponents() As _
System.Collections.ICollection
Get
Return CType(Me.Component, ButtonBar).Controls
End Get
End Property
Public Sub New()
MyBase.New()
End Sub
Public Overrides Sub Initialize(ByVal component As System.ComponentModel.IComponent)
MyBase.Initialize(component)
m_Control = CType(Me.Control, ButtonBar)
'Hook up events
Dim s As ISelectionService = DirectCast(GetService(GetType(ISelectionService)), _
ISelectionService)
Dim c As IComponentChangeService = DirectCast(GetService(GetType _
(IComponentChangeService)), IComponentChangeService)
AddHandler s.SelectionChanged, AddressOf OnSelectionChanged
AddHandler c.ComponentRemoving, AddressOf OnComponentRemoving
End Sub
Protected Overrides Function GetHitTest(ByVal point As System.Drawing.Point) As Boolean
MsgBox("kkk")
Return True
End Function
Protected Overrides Sub OnMouseLeave()
m_Control.Invalidate()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.