Results 1 to 26 of 26

Thread: Build an environment similar to VC++6

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Build an environment similar to VC++6

    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?

    TIA!

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar 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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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?

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    Everything's possible mate

    Do you have a more specific query? Like how to implement a splitter, etc. When you say you have "done this already", is that the docking code?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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.

    I hope this helps some more.

    TIA!

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    A screenshot would help... I don't know what the VC++ 6 IDE looks like and I'm a little confused.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    This is the functionality and look I want for my project. Any thoughts?

    TIA
    Attached Images Attached Images    

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++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.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    Is a user control hard to do? I have no experience at all with those.

  10. #10
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    Nope, it is pretty much just like a borderless form. Make it Alignable and it can be placed onto an MDI parent form.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    Are there any tutiorials about making user controls? I am still in the dark about how to make em. Thanks a ton so far!

  12. #12
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    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.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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.

  14. #14
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    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

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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.

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    Anyone have any thoughts? Please shoot them to me, I need to get an environment like this working soon. TIA!

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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!

    TIA

  18. #18
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    Sorry, I forgot about you

    Have you figured how to make a Usercontrol yet?

  19. #19
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Build an environment similar to VC++6

    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).

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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.

  21. #21
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Build an environment similar to VC++6

    Quote Originally Posted by chemicalNova
    @Penagate:
    Crickey! Your sleeping patterns are just as bad as mine (now everyone will think all aussies say crickey).
    I've never heard anyone say Strewth though. That must be a myth from the movies

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    BTW, this is being done in a VB6 app.

  23. #23
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Build an environment similar to VC++6

    Strewth! (Lawl Alf)

    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.

    Either way, it isn't easy in VB :\

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  24. #24

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    258

    Re: Build an environment similar to VC++6

    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.

  25. #25
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Build an environment similar to VC++6

    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..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  26. #26
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Build an environment similar to VC++6

    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++

    chem
    Attached Files Attached Files

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width