<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Setting a handle on a User Form</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Suite Pro : Setting a handle on a User Form]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 22 Apr 2026 17:59:16 +0000</pubDate>
  <lastBuildDate>Wed, 23 Aug 2006 12:49:36 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=4864</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Setting a handle on a User Form : Hi all,  I had a form (frmMain)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4864&amp;PID=15150&amp;title=setting-a-handle-on-a-user-form#15150</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=415">PhilJeary</a><br /><strong>Subject:</strong> 4864<br /><strong>Posted:</strong> 23 August 2006 at 12:49pm<br /><br />Hi all,<DIV>&nbsp;</DIV><DIV>I had a form (frmMain) with the following:</DIV><DIV>&nbsp;</DIV><DIV>Public A As Pane, B As Pane</DIV><DIV>&nbsp;</DIV><DIV>Both are set up as follows:</DIV><DIV>Set A = DockingPaneManager.CreatePane(1, 250, 120, DockLeftOf, Nothing)<BR>A.Handle = frmTreeViewPane.hWnd</DIV><DIV>Set B = DockingPaneManager.CreatePane(2, 800, 400, DockRightOf, A)<BR>B.Handle = frmSelections.hWnd<BR></DIV><DIV>frmTreeViewPane contains a shortcutbar with the following Forms that get displayed:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; Set ItemSelections = wndShortcutBar.AddItem(1, "Selections", frmSelectionsPane.hWnd)<BR>&nbsp;&nbsp;&nbsp; Set Item = wndShortcutBar.AddItem(2, "User Tables", frmUserTablesPane.hWnd)<BR>&nbsp;&nbsp;&nbsp; Set Item = wndShortcutBar.AddItem(3, "Reports", frmReportsPane.hWnd)<BR>&nbsp;&nbsp;&nbsp; Set Item = wndShortcutBar.AddItem(4, "Schedules", 0)<BR>&nbsp;&nbsp;&nbsp; Set Item = wndShortcutBar.AddItem(5, "Export Tables", frmExportTablesPane.hWnd)</DIV><DIV>&nbsp;</DIV><DIV>When one of the shortcuts is selected, the following runs which displays the selected form on the B pane:</DIV><DIV>&nbsp;</DIV><DIV>Select Case Item.Id<BR>Case 1</DIV><DIV>&nbsp;&nbsp;&nbsp; frmMain.B.Handle = frmSelections.hWnd<BR>Case 2</DIV><DIV>&nbsp;&nbsp;&nbsp; frmMain.B.Handle = frmUserTables.hWnd<BR>Case 3</DIV><DIV>&nbsp;&nbsp;&nbsp; frmMain.B.Handle = frmReports.hWnd<BR>Case 5<BR>&nbsp;&nbsp;&nbsp; frmMain.B.Handle = frmExpDataSetup.hWnd</DIV><DIV>&nbsp;</DIV><DIV>My Point......</DIV><DIV>&nbsp;</DIV><DIV>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.</DIV><DIV>&nbsp;</DIV><DIV>Setting the handles in the user control and the handle changes in frmTreeViewPane work fine, but these ones don't work:</DIV><DIV>&nbsp;&nbsp;&nbsp; frmMain.B.Handle = frmExpDataSetup.hWnd</DIV><DIV>&nbsp;&nbsp;&nbsp; etc</DIV><DIV>&nbsp;</DIV><DIV>I assume it's because I'm referencing the User Control from the outside.&nbsp; A and B Panes were declared as public but still it returns </DIV><DIV>&nbsp;</DIV><DIV>Object variable or With block variable not set</DIV><DIV>&nbsp;</DIV><DIV>Does anyone have any idea where i'm going wrong?</DIV><DIV>&nbsp;</DIV><DIV>Hopefully i've described that well enough but if anything is unclear please let me know.</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Phil</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 23 Aug 2006 12:49:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4864&amp;PID=15150&amp;title=setting-a-handle-on-a-user-form#15150</guid>
  </item> 
 </channel>
</rss>