ApplicationExplorer Template Walkthrough

Setting Up Your Application

First Steps

1.       Once you have created your project, go to MyProject->Application and modify your application’s properties and Assembly Information (such as Title, Company, etc.).

2.       Go to MyProject->Compile->Advanced Compile Options and make sure SAMPLEMODE=”None”

3.       Go to MyProject->Settings and modify the application’s settings such as the Home Page URL (used by the About Box) and other initial settings like ShowToolbar, ShowStatusBar etc. (NOTE: Make sure to click the “Synchronize” button to apply the settings before you run/debug the application in Visual Studio).

4.       Edit or replace the ApplicationIcon.ico icon.

5.       You may delete or exclude the Sample Code folder in Solution Explorer or keep it around for reference.

Simple Tabbed MDI Application

1.       Go to ApplicationExplorerForm.vb and set the m_uiMode variable to UIMode.ChildrenOnlyBased.

2.       Set the m_uiAllowBuiltInToolbars variable to UIBuiltInToolbars.Navigation to show the toolbar with Back/Fwd buttons, which contain built-in functionality to cycle through windows, or the UIBuiltInToolbars.FileOperations option if you want to show the standard File|Open/Save buttons. You can also show both or neither.

3.       Open ApplicationExplorerForm designer, select the Shortcut Bar control docked on the left, and delete all the items using the Items property. (NOTE: You do not need to set the Shortcut Bar visible property. This is handled automatically).

4.       Select the WindowManagerPanel at the top and set the AutoHide property to True if you’d like it to not be visible when no windows are open.

5.       In ApplicationExplorerForm.vb add your code to handle the various user clicks (File|Open, Save, Help Topics, etc.).You can add new items to the menus and toolbar as you see fit. The File|Open and Save menu and toolbar items can be deleted or hidden as you see fit.

6.       You load and show your child forms just as in any MDI application.

7.       See the ChildrenOnly example code in ApplicationExplorerForm.ExampleCode.vb for more information.

Single Form Application

1.       Go to ApplicationExplorerForm.vb and set the m_uiMode variable to UIMode.SingleViewBased.

2.       Set the m_uiAllowBuiltInToolbars variable to the UIBuiltInToolbars.FileOperations option if you want to show the standard File|Open/Save buttons. (NOTE: You can also set it to UIBuiltInToolbars.Navigation but the Navigation toolbar is normally not applicable for Single Form applications unless your single child form will implement IBrowseCapable).

3.       Open ApplicationExplorerForm designer, select the Shortcut Bar control docked on the left, and delete all the items using the Items property. (NOTE: You do not need to set the Shortcut Bar visible property. This is handled automatically).

4.       In the PerformOnFormLoadActions procedure of ApplicationExplorerForm.vb load your child form and set the WindowManagerPanel1.AuxiliaryWindow property to it (Me.WindowManagerPanel1.AuxiliaryWindow=frm) and show the window (frm.Show()).

5.       In ApplicationExplorerForm.vb add your code to handle the various user clicks (File|Open, Save, Help Topics, etc.).You can add new items to the menus and toolbar as you see fit. The File|Open and Save menu and toolbar items can be deleted or hidden as you see fit.

6.       See the SingleView example code in ApplicationExplorerForm.ExampleCode.vb for more information.

Simple-Master/Details Application

1.       Go to ApplicationExplorerForm.vb and set the m_uiMode variable to UIMode.MultiViewBased.

2.       Set the m_uiAllowBuiltInToolbars variable to UIBuiltInToolbars.Navigation to show the toolbar with Back/Fwd buttons, which contain built-in functionality to cycle through windows, or the UIBuiltInToolbars.FileOperations option if you want to show the standard File|Open/Save buttons. You can also show both or neither.

3.       Open ApplicationExplorerForm designer, select the Shortcut Bar control docked on the left, and delete all the items using the Items property. (NOTE: You do not need to set the Shortcut Bar visible property. This is handled automatically).

4.       In the PerformOnFormLoadActions procedure of ApplicationExplorerForm.vb load your child form and set the WindowManagerPanel1.AuxiliaryWindow property to it (Me.WindowManagerPanel1.AuxiliaryWindow=frm) and show the window (frm.Show()).

5.       In ApplicationExplorerForm.vb add your code to handle the various user clicks (File|Open, Save, Help Topics, etc.).You can add new items to the menus and toolbar as you see fit. The File|Open and Save menu and toolbar items can be deleted or hidden as you see fit.

6.       You load and show your child forms just as in any MDI application.

7.       See the MultiView2 example code in ApplicationExplorerForm.ExampleCode.vb for more information.

Multiple-Master/Details Application

1.       Go to ApplicationExplorerForm.vb and set the m_uiMode variable to UIMode.MultiViewBased.

2.       Set the m_uiAllowBuiltInToolbars variable to UIBuiltInToolbars.Navigation to show the toolbar with Back/Fwd buttons, which contain built-in functionality to cycle through windows, or the UIBuiltInToolbars.FileOperations option if you want to show the standard File|Open/Save buttons. You can also show both or neither.

3.       In ApplicationExplorerForm designer, add items to the Shortcut Bar that will represent the multiple master windows.

4.       In ApplicationExplorer.vb uncomment the m_auxViewForms array variable and add all your master windows to it.
Example:
Private m_auxViewForms As New List(Of Form)(New Form() {New MyMasterForm, New MyOtherMasterForm})

5.       Add code to PerformOnShortcutBarSelectionChangeActions to switch the master window when the user clicks an item in the Shortcut Bar.
Example:
Me.WindowManagerPanel1.AuxiliaryWindow=m_auxViewForms.Item(Me.ShortcutBarSideMenu.SelectedItemIndex)
Then show the window using its Show() method. See the MultiView example code in ApplicationExplorerForm.ExampleCode for a more robust example.

6.       In ApplicationExplorerForm.vb add your code to handle the various user clicks (File|Open, Save, Help Topics, etc.).You can add new items to the menus and toolbar as you see fit. The File|Open and Save menu and toolbar items can be deleted or hidden as you see fit.

7.       You load and show your child forms just as in any MDI application.

8.       See the MultiView example code in ApplicationExplorerForm.ExampleCode.vb for more information.

Setting up your Child Windows (Optional)

Your child windows (or master windows in MultiView mode) can have their menus and toolbars merged with the ApplicationExplorer when they become active. Simply have them implement the ICustomUIToolsCapable interface and pass the menus and toolbars when requested. For example:

Public Function GetMenus() As System.Windows.Forms.MenuStrip Implements ICustomUIToolsCapable.GetMenus
      Return Me.MainMenuStrip
End Function

Public Function GetToolbars() As System.Windows.Forms.ToolStripPanel Implements ICustomUIToolsCapable.GetToolbars
      Return Me.ToolStripPanel1
End Function

Other interfaces are available that allow ApplicationExplorer to communicate with your child windows. For instance, IRefreshCapable allows your child forms to respond (for instance re-get data from a database) when the user clicks on the built-in Refresh button and menu item. Other interfaces allow you to supersede ApplicationExplorer functionality. For instance, IEditOperationsCapable allows the child window to take over Edit|Cut/Copy/Paste operations (although ApplicationExplorer’s built-in Edit functionality is quite robust and all-encompassing). See the forms and code in the Sample Code subfolder for more information.