Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Post-Initialization Event?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Post-Initialization Event?

 Post Reply Post Reply
Author
Message
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Topic: Post-Initialization Event?
    Posted: 09 February 2005 at 4:35pm
Hi

I use both DockingPaneManager and ControlBars. I need to perform some tasks once *all* panes are loaded (they are interdependent). I tried to put my initialization code at the end of MainForm_Load() but it seems that the panes are not attached to the DockingManager at this point. I tried raising an event from within DockingPaneManager_AttachPaneEvent() but got a weird ActiveX error.

Any ideas, anyone?

Thanks

Michal Blazejczyk
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 5:54pm

I handle dockable panes like this.  Each "pane" is a separate UserControl.  I have variables declared in the main form that are instances of each pane to create.  I then use the OnLoad override of the form the setup the panes (I use this instead of the forms constructor just to make sure the form is fully loaded).  Within the setup code, I set my variables to a new instance of each UserControl (which will load each one as it's created).  I then create and add my panes to DockingPaneManager.

You shouldn't have to worry about the AttachPane event.  All it does it tell DockingPaneManager the handles of the controls it needs to capture in order to make the pane.  It has nothing to do with the actual loading of the panes (as far as I know).

Your panes will be loaded in the order they are instatiated.  I like to use separate UserControls for each pane because it keeps the code with the pane and makes it easier to use the same pane in another application.

I'm not sure I answered you question, but I hope I helped provide some useful information.  I've never gotten a lot of feedback about C# issues on this forum, so I'll help you were I can.

Back to Top
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 149
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 6:34pm

Originally posted by Boyd Boyd wrote:

You shouldn't have to worry about the AttachPane event.  All it does it tell DockingPaneManager the handles of the controls it needs to capture in order to make the pane.  It has nothing to do with the actual loading of the panes (as far as I know).

I'm still quite new to all this, but I found if I setup all my panes in an initialization routine by manually assigning the hwnd handle this worked fine.  UNTIL I tried to load a saved configuration, the load routine seems to re-create all the existing panes so either you need to also assign the handles manually after a load or rely on the AttachPane event as it is called after the load as well as when the panes are first created.  (At least I think that's how it all works, )

As for the original question.  What do you mean by "Loaded"?  Can't you just do it after all of your calls to CreatePane?  If you need to know how many panes have been created so far you could use the count property.  Maybe I'm not following what you want to do...

Back to Top
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2005 at 11:09am
Thanks, guys. I got a bit confused by CodeJock samples where they create the actual controls only in AttachPane event handlers. Now I'm creating them in MainForm_Load() and it works fine.

There is one question: is it *guaranteed* that the AttachPane events will be raised after MainForm_Load() finishes executing?

Thanks

Michal
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2005 at 11:12am
AttachPane is called when the pane becomes visible.  If a pane is hidden on startup, then the AttachPane for that pane will not be called until it is shown.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.