Solved

dockable window?

Posted on 1998-08-29
6
255 Views
Last Modified: 2011-09-20
Hello,
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
Nathalie
0
Comment
Question by:sidjey
[X]
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
6 Comments
 
LVL 1

Expert Comment

by:redbaron082997
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.
0
 

Author Comment

by:sidjey
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.
0
 
LVL 2

Accepted Solution

by:
shchuka earned 30 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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:wford
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


0
 
LVL 1

Expert Comment

by:wford
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.
0
 

Author Comment

by:sidjey
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 ?

Nathalie
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

707 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