adding treeview to visio

Started by david, December 10, 2008, 03:48:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

david

i'm trying to add a treeview to visio and so far with no success...
i found a treeview sample in File->New->BrainStorming->BrainStorming Diagram.
you can drag the window in which the treeview exists to the location of the custom properties.  this is exactly what i want.
if i add a treeview control from Insert->Control, i won't be able to move the treeview to that location.  and in addition, the treeview will be considered as one of visio's shapes which is not what i want.

therefore, i don't want to use that control.  i want to have a treeview just like in Brainstorming example.
but i didn't find any code they used in Brainstroming so i don't know how to do it in my code.

anyone knows how to do it? just a simplest treeview with only a root. that will be a great start for me because now i'm stuck...

hope anyone can help

thanks in advance
David

Wombat

I don't think that Visio has any built-in TreeView control. You can add custom windows and put forms and buttons into those windows, but you have to handle the logic yourself--you have to analyze the Visio diagram with your own code.

6'4" and full of muscle

david

but visio does have a built-in treeview control so i don't really understand what you said.  as i said you can find a treeview control in insert->control.  but that control is not comfortable and it has to be between the frame and the properties meaning that the frame must be very small.  that's why i don't want such a control.  what i want is a treeview just like in File->New->BrainStorming->BrainStorming Diagram.  this is a comfortable treeview that is located just where the properties are and therefore the frame can take almost the whole screen.  but i need to know how to build such treeview.  it's very important anybody knows?

thanks in advance
David

aledlund

That 'treeview' appears to be an anchor window with a treeview inside of it. An example of coding a solution like that is in both v2003 and v2007 sdk, named wbstreeview.
al

david

thanks for your answer.  i didn't know about the anchor window.

but i tried in my code a very simple command and it didn't work well.
the command i wrote was:

    Dim wAddon As Visio.Window
    Set wAddon = ActiveWindow.Windows.Add("Treeview - Window", visWSVisible, _
    visAnchorBarAddon, , , 300, 400)

it created an anchor window in visio but it didn't work well.  i couldn't really do anything with that window.  it seemed like the window was half there and visio just didn't finish to create the window.

is there something wrong in my code?

david


Paul Herber

The code you have there seems to be working fine. It creates a window just as you've asked for. It's just a window with a caption of the height and width you specified, and it's transparent. You aren't asking it to do any more than that.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/