this was modified from the sdk, it's called by the document opened event
al
'// <summary>This function adds an anchor bar, sets the properties of
'// the anchor bar, and adds a form as contents of the anchor bar. The
'// form is the basic menu for my application (dynamic network displays,
etc).
//</summary>
'// <param name="visioApplication">A running Visio application</param>
'// <returns>True if successful, otherwise False</returns>
Public Function funcBuildAnchorWindows(ByVal visioApplication As _
Microsoft.Office.Interop.Visio.Application) As Boolean
Const menuBarTitle As String = "Menu"
Const listBarMergeTitle As String = "vNetMenu"
Dim returnValue As Boolean = False
Dim listWindow As Microsoft.Office.Interop.Visio.Window
Dim windowStates As Object
Dim windowTypes As Object
Try
' The anchor bar will be docked to the bottom-left corner of the
' drawing window and set the anchor bar to auto-hide when not in
' use.
windowStates = Microsoft.Office.Interop.Visio. _
VisWindowStates.visWSAnchorTop Or _
Microsoft.Office.Interop.Visio. _
VisWindowStates.visWSAnchorLeft Or _
Microsoft.Office.Interop.Visio. _
VisWindowStates.visWSAnchorAutoHide Or _
Microsoft.Office.Interop.Visio. _
VisWindowStates.visWSVisible
' The anchor bar is a window created by an add-on
windowTypes = Microsoft.Office.Interop.Visio. _
VisWinTypes.visAnchorBarAddon
' Add a custom anchor bar.
listWindow = addAnchorWindow(visioApplication, _
menuBarTitle, _
windowStates, _
windowTypes)
' Set the form as contents of the anchor bar.
listForm = New frmAnchorMenu
listForm.ParentVisioApplication = visioApplication
addFormToAnchorWindow(listWindow, _
listForm)
' The MergeID allows the anchor bar window to be identified
' when it is merged with another window.
listWindow.MergeID = listMergeId
' Allow the anchor window to be merged with other windows that
' have a zero-length MergeClass property value.
listWindow.MergeClass = ""
' Set the MergeCaption property with string that is shorter
' than the window caption. The MergeCaption property value
' appears on the tab of the merged window.
listWindow.MergeCaption = listBarMergeTitle
Catch err As Exception
subLogException(err)
subDisplayException(Nothing, err)
End Try
Return returnValue
End Function
Spark said:
Thank you for your kindly help
I want to create a anchcor window for my project (using VB.NET). It has
the
same appearance like Visio built-in windows(Custom Properties, Size &
Position, Drawing Explorer, and Pan & Zoom windows).
The visio 2003 sdk and UML template can create AnchorBarBuiltIn style
window
in document winow.
I try to use the Add method to add a anchored window(varType =
visAnchorBarBuiltIn) to Document object. But It fails.
objRet = object.Add ([varCaption][, varFlags]
[, varType][, varLeft][, varTop][, varWidth]
[, varHeight][, bstrMergeID][, bstrMergeClass]
[, nMergePostition])
Thank you again.
Al Edlund said:
C:\Program Files\Microsoft Office\Visio11\SDK\Samples\Readme Samples
Summary.htm