Click here to Skip to main content
Click here to Skip to main content

Docking control with tear-away frame tool windows

By , 6 Jul 2003
 

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

About the Author

Iridar
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionCant MagicDocking do this already?memberleppie7 Jul '03 - 16:30 
Hi
 
AFAIK (and if I remember correctly) the Magic Docking Control can do this "tearing" away thing.
 
CHeers Smile | :)
 
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
AnswerRe: Cant MagicDocking do this already? PinmemberPaul Selormey7 Jul '03 - 18:22 
What difference does it make?
 
Best regards,
Paul.

 
Jesus Christ is LOVE! Please tell somebody.
GeneralRe: Cant MagicDocking do this already? Pinmemberleppie8 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? PineditorHeath Stewart23 Jan '04 - 6:16 
Crownwood Consulting is now charging for the MagicLibrary, so I think this article on how to create your own is well worth it. Besides, whoever said that there should only be one library to solve a specific solution. I, for one, like having choices.
 
 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Cant MagicDocking do this already? PinmemberSuper Lloyd1 Dec '05 - 22:25 
Haha...
I voted you 5!
 
I will add:
"So?"
GeneralRe: Cant MagicDocking do this already? PinmemberPaul Selormey2 Dec '05 - 22:07 
Wow, this thread is two years old Smile | :)
 
Best regards,
Paul.
 
Jesus Christ is LOVE! Please tell somebody.
AnswerRe: Cant MagicDocking do this already? PinmemberDiego Mijelshon8 Jul '03 - 2:18 
Better than both: http://www.divil.co.uk/net/controls/dockingsuite/[^]
GeneralRe: Cant MagicDocking do this already? Pinmemberrahtrow8 Jul '03 - 2:46 
Wow - I have never seen that docking suite. I am working on a large project based on the MagicLibrary. Can you provide some reasons why you think this library is better than the MagicLibrary?
THanks
GeneralRe: Cant MagicDocking do this already? PinmemberDiego Mijelshon8 Jul '03 - 3:53 
1 - Full design time support
2 - Less buggy
 
Enough for me Smile | :)
 
Diego
GeneralRe: Cant MagicDocking do this already? Pinmemberfadi8 Jul '03 - 3:57 
its closed source. matter as well purchase one fully functional and supported duh
GeneralRe: Cant MagicDocking do this already? Pinmemberleppie8 Jul '03 - 7:47 
fadi wrote:
its closed source.
 
So is most of .NET fx.... And its royalty free. In fact the most "popular" OSI licenses demand the product be used in a free product. Others require commercial licensing if used in commercial applications, even if the source is open.
 
fadi wrote:
matter as well purchase one fully functional and supported duh
 
Why? If you can get one for free? Would you use the .NET fx is you have to pay a license fee for every single class you use? NO.
 
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
GeneralRe: Cant MagicDocking do this already? Pinmemberfadi8 Jul '03 - 9:29 
developers come to this site to view articles and sample code, hence the name of the site is CodeProject.com not NoCodeProject.com. Saying "oh yes, there are other closed-source projects out there that does the same" is pointless. Quick search on google.com would give even more results than codeproject.com if that is what you are looking for.

GeneralRe: Cant MagicDocking do this already? PinmemberDiego Mijelshon22 Jul '03 - 17:45 
IMHO, the first rule before writing a single line of code on something, is checking if somebody has already done the same.
If you can make it better, go on. If you can't, why waste your time?
GeneralRe: Cant MagicDocking do this already? PinmemberTim Dawson8 Jul '03 - 22:39 
My controls are not open source but they _are_ supported Smile | :)
GeneralRe: Cant MagicDocking do this already? PinmemberSoliant8 Jul '03 - 4:24 
Can't stand looking at ugly VB code though.
 




R.Bischoff | C++
 
.NET, Kommst du mit?

GeneralRe: Cant MagicDocking do this already? Pinmemberlee_connell8 Jul '03 - 17:31 
Yeah I agree can't stand looking at ugly vb code, but hey does that really matter? and BTW: he has optional c# code views too. I am very excited about trying out these controls/classes. I have used magiclibrary, but way too buggy for me. I would rather use free closed source that works good, then open source that's bug ridden. MagicLibrary if you read in their forums will be making their next big release commercial.
GeneralRe: Cant MagicDocking do this already? Pinmemberstefanos330 Nov '03 - 20:47 
idiots at MagicDocking. Their software is too buggy for any serious
company. Making their next release commercial, lol. They probably
think no one reads open source articles.

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 7 Jul 2003
Article Copyright 2003 by Iridar
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid