Click here to Skip to main content
15,881,852 members
Articles / Programming Languages / C#
Article

Docking control with tear-away frame tool windows

Rate me:
Please Sign up or sign in to vote.
4.00/5 (9 votes)
6 Jul 20031 min read 107.3K   1.6K   42   17
A container control that tears away into a tool window when dragged

Image 1

Introduction

Well, never being one to be easily satisfied, I was quite happy to find Phil Wright's excellent article on docking controls. However, I of course wanted more. I wanted a control that would behave like a container in the design environment, and would allow me to tear it away from the sides of its container and drop it wherever I wanted it.

So, using Phil's work as a base (thanks, Phil!) I extended his control to give it a little more design flexibility and a way to move it around more like a Visual Studio tool window.

Using the control is simple. Just copy the .cs and .resx files into your project directory and include them in the project itself. You'll either have to add an Images directory to your project for the tool's icon or change the [ToolboxBitmap ....] line in the .cs file to point to an image you want to use. Then, use it like any other control.

Known issues with this version:

  1. No location serialization - the control does not remember where it was placed between iterations.
  2. Control does not always size correctly when dragged and docked to an edge.
  3. Does not always play nicely with the design environment - I've had it lose child controls, somewhat intermittently.

Anyhow, it needs a little work (I'll try to keep new versions posted), but it's enough to get you started. Enjoy!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionCant MagicDocking do this already? Pin
leppie7-Jul-03 16:30
leppie7-Jul-03 16:30 
AnswerRe: Cant MagicDocking do this already? Pin
Paul Selormey7-Jul-03 18:22
Paul Selormey7-Jul-03 18:22 
GeneralRe: Cant MagicDocking do this already? Pin
leppie8-Jul-03 7:37
leppie8-Jul-03 7:37 
Paul Selormey wrote:
What difference does it make?

The difference is his motivation behind creating this control:

"However, I of course wanted more. I wanted a control that would behave like a container in the design environment, and would allow me to tear it away from the sides of its container and drop it wherever I wanted it."



leppie::AllocCPArticle(Generic DFA State Machine for .NET);
GeneralRe: Cant MagicDocking do this already? Pin
Heath Stewart23-Jan-04 6:16
protectorHeath Stewart23-Jan-04 6:16 
GeneralRe: Cant MagicDocking do this already? Pin
Super Lloyd1-Dec-05 22:25
Super Lloyd1-Dec-05 22:25 
GeneralRe: Cant MagicDocking do this already? Pin
Paul Selormey2-Dec-05 22:07
Paul Selormey2-Dec-05 22:07 
AnswerRe: Cant MagicDocking do this already? Pin
Diego Mijelshon8-Jul-03 2:18
Diego Mijelshon8-Jul-03 2:18 
GeneralRe: Cant MagicDocking do this already? Pin
rahtrow8-Jul-03 2:46
rahtrow8-Jul-03 2:46 
GeneralRe: Cant MagicDocking do this already? Pin
Diego Mijelshon8-Jul-03 3:53
Diego Mijelshon8-Jul-03 3:53 
GeneralRe: Cant MagicDocking do this already? Pin
fadi8-Jul-03 3:57
fadi8-Jul-03 3:57 
GeneralRe: Cant MagicDocking do this already? Pin
leppie8-Jul-03 7:47
leppie8-Jul-03 7:47 
GeneralRe: Cant MagicDocking do this already? Pin
fadi8-Jul-03 9:29
fadi8-Jul-03 9:29 
GeneralRe: Cant MagicDocking do this already? Pin
Diego Mijelshon22-Jul-03 17:45
Diego Mijelshon22-Jul-03 17:45 
GeneralRe: Cant MagicDocking do this already? Pin
8-Jul-03 22:39
suss8-Jul-03 22:39 
GeneralRe: Cant MagicDocking do this already? Pin
TigerNinja_8-Jul-03 4:24
TigerNinja_8-Jul-03 4:24 
GeneralRe: Cant MagicDocking do this already? Pin
lee_connell8-Jul-03 17:31
lee_connell8-Jul-03 17:31 
GeneralRe: Cant MagicDocking do this already? Pin
stefanos330-Nov-03 20:47
stefanos330-Nov-03 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.