By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,289 Members | 1,463 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,289 IT Pros & Developers. It's quick & easy.

ToolStripManager.Merge and .RevertMerge help please

P: n/a
Newbie alert!

VB 2005 Express. One MDIParent form and one regular Form. The MDIParent has
the standard ToolStrip. The MDI Child Form has its own ToolStrip that is to
be merged onto the MDIParent's ToolStrip. Sounds simple, right?

I've gone through quite a few URLs that all pretty much say the same thing
but I have yet to get this completely working. (Most of those URLs also seem
to wander away from ToolStrip and instead go down the same illustration path
using MenuStrip. My problem is with ToolStrips, not MenuStrips.)

No problem with ToolStripManager.Merge(sourceToolStrip, targetToolStrip),
other than the fact that no matter what I do with the ToolStripButton
MergeAction and MergeIndex I can't seem to get the buttons to merge in the
middle of the target.

Calling ToolStripManager.RevertMerge(sourceToolStrip, targetToolStrip), on
the other hand, appears to have no effect.

In the MDI Child, the ToolStrip's AllowMerge and AllowItemReorder are set to
True. The individual ToolStripButtons are all set to Insert (or Append -
I've tried it both ways) with unique MergeIndex values (let's say they're
values from 51-55).

The MDI Child's New() subroutine simply calls:

ToolStripManager.Merge(Me.ToolStrip, MyParent.ToolStrip)

No problems there (other than the merged button order that is - they always
get tacked on the end of the target).

The MDI Child's FormClosing() subroutine equally simply calls:

ToolStripManager.RevertMerge(Me.ToolStrip, MyParent.ToolStrip)

Unfortunately the merged result is still displayed.

In the MDIParent, the ToolStrip's AllowMerge and AllowItemReorder properties
are also set to True. The individual ToolStripButtons are mostly default
(Append, -1) except for the last separator and Help buttons that have a
MergeIndex of 98 and 99 respectively.

The big question is how does one get merged ToolStrips unmerged?

The bonus question is how does one get ToolStripButtons to merge in the
middle of the target?

Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"MyndPhlyp" <no****@homeright.nowwrote in message
news:OG**************@TK2MSFTNGP05.phx.gbl...
>
The MDI Child's FormClosing() subroutine equally simply calls:

ToolStripManager.RevertMerge(Me.ToolStrip, MyParent.ToolStrip)
Doh! Finally figured that one out. Had to reverse the order of the
ToolStrips in the parameter list.

Still trying to figure out how to get the ToolStripButtons of the source to
merge in the middle of the target though.
Jul 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.