How to create a dockable window like stencil-window?

S

Spark

Can I create a dockable window like stencil-window and add control to the
window?
 
A

Al Edlund

those are called anchor windows, and there are examples on how to work with
them in the visio sdk
al
 
S

Spark

Thank you for your help, Al Edlund

but I couldn't find the example in visio sdk. could you do me fovor to tell
me where the example or copy the example to the post.

Thank you again.
 
S

Spark

Thank you for your answer, Al Edlund

I couldn't find the example in visio sdk. could you do me fovor to tell me
where the example?

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).


Thank you again.
 
A

Al Edlund

C:\Program Files\Microsoft Office\Visio11\SDK\Samples\Readme Samples
Summary.htm
 
L

lostwings

Hi guy,

I cannot help to solve your problem. But I think you could be of help to
solve my problem. Do you know how to show/hide custom properties window,
which is a visio built-in window, via VBA code? From your question, it seems
to me that you can do this simple task. :)

Thanks
 
S

Spark

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.
 
A

Al Edlund

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
 
D

David Parker

After unstalling the SDK, check out:
C:\Program Files\Microsoft Office\Visio11\SDK\Samples\Treeview\VBNet
 
D

David Parker

Visio.Application.DoCmd(1658)
or
Visio.Application.DoCmd(visio.VisUIcmds.visCmdCustProp)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top