I want to build an environment like that of the VC++6 environment. I want to doc the MDIchild forms, move them around, and even minimize them if I wanted to. Does anyone know how I can do that using VB6? Is it possible or is that a native style to VC++6?
Docking is fairly simply implemented by using position approximation code which is executed when the form is moved. However, since VB unfortunately does not provide a _Move event for forms, you need to subclass the form and trap the WM_MOVING message, and run the docking code there. Basically, during moving, you need to compare the proposed position of the form with the edges of the client area of the MDI parent form and if it is within a certain area then alter the proposed coordinates so it "snaps" to the edge of the parent client area.
I have done this already, however, I am wanting to make my environment where you can resize one window and the other will do so as well. I basically want o copy the environment exactly, as in the way forms move, "snap" to borders, and the like. Is this possible to do in VB6?
I have made 2 windows inside an MDI form that resize to the parent. However, I want a splitter, i think if i am thinking of what you are thinking, that will resize the windows together. I want that complex environment like VC++6. Sorry, I do not know all of the lingo yet, but I am rapidly learning. What I see, looks like more then 1 window, possibly in frames, but is basically mazimized so you see the control button of the child form under the parent form's control button, like the child is maximized. I wish i could explain better, but all I can say, is I want a setup like VB++6.
OK, the panels at the side of the MDI form, I would make those alignable Usercontrols. That way you can resize them easily and if the MDI child windows are maximised then they will resize to fit the client area automatically.
I don't know of any off-hand but it is pretty straightforward. Just create the controls on the UserControl like you would a Form. The code is all the same too, except you use UserControl instead of Me. The events are pretty self-explanatory.
Now, this will popup a window like in the SS's I sent you? Or will these just allow a toolbar type setting for controls? I tried doing something simple and checking for a usercontrol1.show method or whatnow, but it doesn't popup with that at all.
Oh I see. No, the Usercontrols would only be for things like sidebars. You can show/hide them by using .Visible from the MDI parent form.
Popup toolwindows are a bit harder to do, I'd have to think about it for a while. As it happens, I'm going to bed, so either someone else will have to help or I will be back sometime later today
I want to be able to use the form as a MDIChild, with docking capabilities, but with the look and feel like the pictures of the windows in those SS's I sent. Thanks for keeping up with me though.
Bump, I am still looking for an answer to this question. Searches on google are turning up with code and proprietary OCX,DLL's which I cannot use because I need to distribute this app througout my company. Any help is most appreciated!
To get what you want, you really are going to have to jump into some hardcore stuff. Subclassing as penagate suggested, or the API. You can create a toolbar using the CreateWindow() API (which can then be resized), which will dock automatically (with a few extra arguments). Your best bet would be to learn what the API is, find some C++ code which creates a toolbar, and use the appropriate APIs (the C++ functions in the C++ code pretty much) to create the toolbar.
@Penagate:
Crickey! Your sleeping patterns are just as bad as mine (now everyone will think all aussies say crickey).
The problem, is that I need windows dockable, not toolbars. I will have a setup where there are 2 dockable windows on each side of the MDIForm, then a form that is a standard MDIChild form. The outter forms will include treeviews for navigational purposes. VB6 does this type of environment in thier IDE, but I want to know if I can leverage that or the nicer-looking VC++6 environment.
I know this is being done in VB6, but the API is a bunch of functions which aren't normal VB functions (windows functions, like normal C functions). If you find the CreateWindowEx() API, you'd be able to create a dockable window. What I meant in my other post, is that I think if you use CreateWindow() to create a toolbar, it can be resized.
If I used CreateWindowEx(), would I need to use a form I already made like a Template? How would I be able to insert functions into it? I am crazy-new to creating new windows in run-time.
Its pretty advanced. It would require a callback function. The best way would be to look up a few examples in C++, and just look at how it works there. I could create an example of creating a window. Give me a little while..
Ok. This is advanced as I say. MSDN can give you more window styles. You should look there for a few of the ones I didn't get (the WS_EX_ ones). Creating it as an MDI child and a few Extended window styles should do the trick. If not, then you're going to have to either program the MDI Parent in API aswell, or create it in C++