This is a migrated thread and some comments may be shown as answers.

Activated Event fired 3 times

2 Answers 88 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Greg Wiers
Top achievements
Rank 1
Greg Wiers asked on 14 Oct 2008, 11:31 AM
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 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 16 Oct 2008, 03:50 PM
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.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 20 Oct 2008, 01:30 PM

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.

regards
erwin
Tags
Dock
Asked by
Greg Wiers
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
Share this question
or