Activated Event fired 3 times

3 posts, 0 answers
  1. Greg Wiers
    Greg Wiers avatar
    4 posts
    Member since:
    Feb 2005

    Posted 14 Oct 2008 Link to this post

    We are using the dock manager in a new application and have some concerns with performance due to the code being run multiple times in the Activated event of the UserDockForm.   We have looked through the forums and documentation to  get a better understanding what triggers the "Activated" event, but are not having much luck.  

    Below is the code being used to create the dock form, and the activated event code.  Any help on why this event is fired 3 tiems would be greatly appreciated, and if we should be using a different event let us know.

        Private Function CreateDockedDoc(ByVal caption As String, ByVal size As System.Drawing.Size, ByVal formName As String) As UserDockForm  
            Dim myform As Form = CType(Me.GetType.Assembly.CreateInstance(formName, True), Form)  
            myform.MdiParent = Me 
            Dim dockDocument As UserDockForm = CType(myform, UserDockForm)  
            dockDocument.Text = caption 
            TryCast(DockingManager1.PrimarySite, DockSite).SetDocument(dockDocument)  
            dockDocument.CloseButtonVisible = False 
            Return dockDocument  
        End Function  
        Private Sub frmSystemCodePayPeriodSetup_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated  
            System.Console.WriteLine("Form activated ........")  
        End Sub  
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 16 Oct 2008 Link to this post

    Hi Greg Wiers,

    This is an issue with docking forms and UserDockForm objects. The fix will be available in the release following Q3.

    Sorry for the inconvenience and thank you for the feedback.

    Best wishes,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
  4. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 20 Oct 2008 Link to this post

    The docking system seems to send more status change events than really needed, maybe because it's complicated to track the internal status and send
    only needed events and at the same time make sure that everything is correctly redrawn.

    I ended up with internal flags in some of my dockable windows, to do expensive activation / painting code only when really needed and ignore additional events from the docking system.

Back to Top