Solved

dockable window?

Posted on 1998-08-29
6
247 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
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
A macro to Count the number of rows across all worksheets 3 93
Microsoft Access combo box help 2 46
How to compare ms sql hashbytes results within vb6 5 73
vbModal 12 51
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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