Setting a handle on a User Form |
Post Reply |
Author | |
PhilJeary
Newbie Joined: 16 March 2004 Location: United Kingdom Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 23 August 2006 at 12:49pm |
Hi all,
I had a form (frmMain) with the following:
Public A As Pane, B As Pane
Both are set up as follows:
Set A = DockingPaneManager.CreatePane(1, 250, 120, DockLeftOf, Nothing)
A.Handle = frmTreeViewPane.hWnd Set B = DockingPaneManager.CreatePane(2, 800, 400, DockRightOf, A)
B.Handle = frmSelections.hWnd frmTreeViewPane contains a shortcutbar with the following Forms that get displayed:
Set ItemSelections = wndShortcutBar.AddItem(1, "Selections", frmSelectionsPane.hWnd)
Set Item = wndShortcutBar.AddItem(2, "User Tables", frmUserTablesPane.hWnd) Set Item = wndShortcutBar.AddItem(3, "Reports", frmReportsPane.hWnd) Set Item = wndShortcutBar.AddItem(4, "Schedules", 0) Set Item = wndShortcutBar.AddItem(5, "Export Tables", frmExportTablesPane.hWnd) When one of the shortcuts is selected, the following runs which displays the selected form on the B pane:
Select Case Item.Id
Case 1 frmMain.B.Handle = frmSelections.hWnd
Case 2 frmMain.B.Handle = frmUserTables.hWnd
Case 3 frmMain.B.Handle = frmReports.hWnd
Case 5 frmMain.B.Handle = frmExpDataSetup.hWnd My Point......
While this works fine as a stand alone Exe project, if I try and convert it to an OCX, thus making frmMain a User Control it stops working.
Setting the handles in the user control and the handle changes in frmTreeViewPane work fine, but these ones don't work:
frmMain.B.Handle = frmExpDataSetup.hWnd
etc
I assume it's because I'm referencing the User Control from the outside. A and B Panes were declared as public but still it returns
Object variable or With block variable not set
Does anyone have any idea where i'm going wrong?
Hopefully i've described that well enough but if anything is unclear please let me know.
Regards,
Phil
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |