Prevent some Toolstrips from dropping on some ToolStripContainer

J

Joe

I have a few ToolStripContains and ToolStrips in my app and only want
certain ToolStrips to be able to be dropped on certain ToolStripContainers.
Is there anyway to do this? I tried the DragEnter event of the
ToolStripContainer but it didn't help.

Thanks,
Joe
 
L

Luke Zhang [MSFT]

Hello Joe,

In VS.NET 2005, ToolStrips can be draged btween ToolStripContainers by
default. For example, we can put two ToolStripContainers on a form ( We may
change the back color of the Containerpanel so that we can recognize them
from form). Put a ToolStrip on one of ToolStripContainers, dock it on the
top panel. And run the program, you will be able to drag and drop the
ToolStrip.

If you want a ToolStripContainer to reject a certain ToolStrip, you may add
some code in:

ToolStripContainer_TopToolStripPanel_ControlAdded()

remove the last added control and and its back to original
ToolStripContainer.

Hope this help,

Luke
 

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