Divelements Community
Customer discussion of all Divelements products

Inherit HeaderControl

Latest post 02-20-2007 1:44 by JoshEinstein. 1 replies.
  • 02-06-2007 1:01

    • CarBar
    • Not Ranked
    • Joined on 11-01-2006
    • Posts 2

    Huh? [:^)] Inherit HeaderControl

    I need to create a UserControl that essentially is a HeaderControl.  I have tried creating a UserControl that inherits TD.Eyefinder.HeaderControl, but I lose designtime support for it as it just looks like a compontent.  Is there a simple way to do this, or should I create a UserControl and add a HeaderControl to it that dock = fill?  If the later is true how do I pass through the BuddyPane property so that it works correctly when I add it to a form.  I have tried the following, but I believe that the VisibleChanged Event doesn't fire at design time, so it is always invisible...

            <Category("Behavior")> _
            <Description("Associates the HeaderControl with a NavigationPane so that the HeaderControl is only displayed when the NavigationPane is active.")> _
            Public Property BuddyPane() As TD.Eyefinder.NavigationPane
                Get
                    Return Me.hdcBase.BuddyPane
                End Get
                Set(ByVal value As TD.Eyefinder.NavigationPane)
                    Me.hdcBase.BuddyPane = value
                End Set
            End Property

            Private Sub hdcProjectManagement_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles hdcBase.VisibleChanged
                Try
                    Me.Visible = hdcBase.Visible
                Catch ex As Exception
                    FFI.ErrorModule.ExceptionHandling.LogExceptionInHandler(ex)
                End Try
            End Sub
  • 02-20-2007 1:44 In reply to

    Re: Inherit HeaderControl

    Inheriting HeaderControl shouldn't break design-time support for *using* your derived control on a form or user control. However, HeaderControl by default inherits from ContainerControl which has no designer for itself.

    In other words, if you're trying to use the designer for the HeaderControl, then you have to make a UserControl and expose new members that you map to the user control.

    But if you just want to add some behavior to HeaderControl, then you can do so in code and continue to use your derived class in the form designer.

    Sorry my explanation is so confusing, I'm having a hard time wording it correctly.
Page 1 of 1 (2 items) | RSS
Copyright © 2008 Divelements Limited
Powered by Community Server (Commercial Edition), by Telligent Systems