Merging two custom windows

Started by Visano, June 30, 2008, 02:25:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visano

Hi,

I have added two anchored windows using the following code with VB 6.

    varWindowStates = VisWindowStates.visWSVisible + VisWindowStates.visWSDockedLeft
    varWindowTypes = VisWinTypes.visAnchorBarAddon
   
    1st window
    Set vsoAnchorWindow = myVisioApp.ActiveWindow.Windows.Add("A", varWindowStates, varWindowTypes, 0, 0)
    vsoAnchorWindow.MergeCaption = "AnchorWindow 1"
    vsoAnchorWindow.MergeID = CUSTOM_MERGE_ID_1
    vsoAnchorWindow.MergeClass = ""
   
    2nd window
    Set vsoAnchorWindow = myVisioApp.ActiveWindow.Windows.Add("A", varWindowStates, varWindowTypes, 0, 0)
    vsoAnchorWindow.MergeCaption = "AnchorWindow 2"
    vsoAnchorWindow.MergeID = CUSTOM_MERGE_ID_2
    vsoAnchorWindow.MergeClass = ""
   
 
I can merge them manually by dragging one over the other. Programatically how can I merge these windows?

If anybody has any idea on this please let me know.

:)
Thanks

Visano

Visio Guy

Buon Giorno, Visano,

I've been playing with this for the past hour, because it's a GOOD QUESTION, and I can't figure it out.

There are a bunch of merge-related arguments in the Windows.Add method, which I didn't try. I wonder if setting them for newly-added windows has any effect?

I also noticed, that in merged windows, the MergeID is the same, but I can't figure out how to merge them. I've tried putting windows in the same place, setting their WindowStates to be "merged", etc.

The Macro Recorder and Visio Event Monitor tool were also of no help.

Hopefully somebody will see this that has figured it out!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Visano

Hi Mr. Visio Guy,

thank you for your quick respond.
I have tried a lot with all the parameters of the ActiveWindow.Add method but merging the windows was not possible.
If you get clue or some informations from MS please let me know.

WR
Visano

P.S.

By the way I found this newsgroup nice & transparent. :)




Visano

Hi Guys,

has anyone still no answer for this problem?

:)

WR
Visano

9rey

Hi,
sorry for "necroposting" :)
but I guess I know how to merge windows.

After many unsuccessful attempts, finally, I've done it:

    Set wnd1 = ActiveWindow.Windows.add("wnd1", visWSVisible Or visWSDockedRight, visAnchorBarAddon)
    'any random GUID
    wnd1.MergeID = "{BD8994FC-A032-412B-B557-9039E82AB7FA}"
    wnd1.MergeCaption = "wnd1"
    wnd1.MergeClass = "1"

    Set wnd2= ActiveWindow.Windows.add("wnd2", visWSVisible Or visWSDockedRight Or visWSAnchorMerged, visAnchorBarAddon, , , , , "{BD8994FC-A032-412B-B557-9039E82AB7FA}", "1", 2)
    wnd1.MergeCaption = "wnd2"

Nikolay

Yooo! The Merge-Windows Mystery is finally solved! :D
Thank you for sharing!

A bit simplified version (it seems that you just have to set MergeID separately to a GUID, and then create the window to be merged with that GUID):

Set wnd1 = ActiveWindow.Windows.Add("wnd1", visWSVisible, visAnchorBarAddon)
wnd1.MergeID = "{BD8994FC-A032-412B-B557-9039E82AB7FA}"
Set wnd2= ActiveWindow.Windows.Add("wnd2", visWSVisible Or visWSAnchorMerged, visAnchorBarAddon, , , , , "{BD8994FC-A032-412B-B557-9039E82AB7FA}")