[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


dockable window?

Posted on 1998-08-29
Medium Priority
Last Modified: 2011-09-20
I would like to create a dockable window like in visual basic environnement. How can I do this?
I've two forms load (form1 and form2).(Form2.left=form1.left+form1.width and form2.top=form1.top)
Thanks a lot
Question by:sidjey
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1431753
Test for positioning of form1 relative to form2. If it is within the HOT area (Form2.left <= (form1.left+form1.width+HOTAREA) ) then snap it to posisition. That would give look and feel. You would want to test for this on mousemove events, or buttonup events. If you need more, let me know, but this should do it for you.

Author Comment

ID: 1431754
I know that, but it isn't exactly that i would like to do. I would like that my form2 become "dockable" to my form1 and the left 3d borders (form2) and the right 3 borders (form1) disappear (try to move a toolbar in vbIDE and "attach" to another toolbar, you'll seen that i want to do). Do you know how can I do this?
Sorry for my english.

Accepted Solution

shchuka earned 90 total points
ID: 1431755
You can use a panel on you form 1 with align property set to whatever you need (normally top or left).  You can have this panel filled with whatever is on your form2.  I.e. your form2 contains this panel only and it contains all the controls.

When you're snapping it to form1, use SetParent API to put this panel onto form1 and hide the form2.

Use standard drag-and-drop to "unsnap" the panel and SetParent it back onto the form2.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 1431756
This is done in a MDI form enviroment, You need to set things up as redbaron said, then you need some controlarray panels, you set these panels at the dock sized for the form, then place the form on the top of the panel, the panel then becomes the controls the resize events with the form, or draging the panel sides.  The form has to be changed to (I belive) a flat border toolbar MDI child, , which needs an API call:
SetWindowLong(hWnd&, GWL_STYLE, value&)
, since the VB property is read only. I am a little unsure about how to do this final bit, which is sort of the whole point of the operation. So, I'll leave this as a comment until I have got it working, or someone else posts the solution, meanwhile, good hunting


Expert Comment

ID: 1431757
Woop, sorry Shchuka, I didn't refresh, Still there is a problem with this, you will loose the toolbar at the top of the form, still, a simpler and neater solution.

Author Comment

ID: 1431758
Thanks a lot. But how can I use standard drag-and-drop to "unsnap" the panel and SetParent it back onto the form2 ?


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question