Results 1 to 14 of 14

Thread: [RESOLVED] How do I move existing controls into a frame?

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    [RESOLVED] How do I move existing controls into a frame?

    I have a form with several disparate controls and now I want to group them all together in a frame. Maybe I should have done that from the start, but I didn't. If I pull a frame onto my form from the toolbox and drag one of the existing controls to the frame, it gets put underneath it, not in it. If I drag a new control to the frame, it gets put in it. Can I move my existing controls to the frame or do I have to start all over?

    This is VB6.

    Thanks.
    Last edited by MMock; May 9th, 2007 at 07:54 AM. Reason: resolved

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How do I move existing controls into a frame?

    Draw your frame on the form.

    Right mouse click the desired control and click Cut.

    Click in the frame/right mouse click/click Paste

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    Re: How do I move existing controls into a frame?

    I needed to cut and paste not drag and drop (for some reason).

    I apologize, I have a habit of posting and then searching, I guess because if I search and don't find my answer I've wasted time that a post could've been sitting out there getting answered.

    Thanks to this forum for already having answered it!

  4. #4

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    Re: How do I move existing controls into a frame?

    And thanks to Hack, whose reply I just saw after I posted mine!!!

  5. #5
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Re: [RESOLVED] How do I move existing controls into a frame?

    I tried Cut and paste to get some labels from the form onto a frame... and they all vanished !
    So use cut with some concern.

  6. #6
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,942

    Re: [RESOLVED] How do I move existing controls into a frame?

    Hmmm, I use cut-and-paste to do precisely this all the time.

    When you have the controls in the clipboard, you do have to be sure to not put anything else in the clipboard before you do your paste. When doing this, I always draw my frame before I do the cut. And then, I cut, and immediately paste, so I don't forget and accidentally throw out my controls.

    Good Luck,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  7. #7
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Re: [RESOLVED] How do I move existing controls into a frame?

    Maybe I didn't follow the sequence correctly, but thought I had.
    Do you know if you can build a frame outline around some controls, without using an actual frame control - or is the correct way to always draw the frame first ?
    I tried the line control but couldn't change it's appearance to suit.

  8. #8
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: [RESOLVED] How do I move existing controls into a frame?

    Alex

    I just tried this ...

    Put 2 OptionButtons on a Form
    Put 1 Frame on the Form

    Name:  alex0.png
Views: 3434
Size:  6.3 KB

    Then ...
    1. Click on Option1 .. 8 blue "handles" appear
    2. Press Ctrl-X .. to cut
    3. Click on Frame1 .. 8 blue "handles" appear
    4. Press Ctrl-V .. to paste
    5. Drag Option1 down and to right a bit to move from top-left of Frame1


    .. and I get this

    Name:  alex1.png
Views: 3258
Size:  6.3 KB

    Is this what you did?

    Spoo
    Last edited by Spooman; Nov 22nd, 2017 at 05:08 AM. Reason: 8 handles .. not 6 !!

  9. #9
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Re: [RESOLVED] How do I move existing controls into a frame?

    Hi thanks for info... that worked for me too! But no, it wasn't what I did. I had drawn about 10 labels and selected them all with the mouse.
    I expected a 'hand' to become available to move them as one ... but no. So I control-x and then control-v in the frame. They didn't show up.. I might have got a second Frame instead. Was all a bit unexpected... confusing. But end result I had to build them again.

  10. #10
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: [RESOLVED] How do I move existing controls into a frame?

    Alex

    Glad it worked.

    Out of curiosity, how did you select all 10 at once?

    Spoo

  11. #11
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Re: [RESOLVED] How do I move existing controls into a frame?

    I moused over all 10 with left button down, this draws a dotted line then let go and they're all selected.

    In VBA you get a handle to move them all, but VB6, no. Control and arrow keys work. But it moved under the frame, from memory. I mucked about
    with Send to Back/Front but no joy. Wonder what they actually do....

  12. #12
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: [RESOLVED] How do I move existing controls into a frame?

    Interesting

  13. #13
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: [RESOLVED] How do I move existing controls into a frame?

    Sounds like you just messed up.
    I do this type of thing all the time as well.
    I usually move the frame off to the side to make sure I don't accidentally catch the frame when I drag the mouse to select the other controls.
    Then I cut the controls, click on the frame to select it, and then paste.
    I then move the frame back to where I want it.

    I just tried it and it works fine for me. You should be able to drag multiple controls, even if you don't see the hand cursor.
    But since labels are lightweight controls, i.e. windowless, they are drawn on their container, i.e. they are drawn on the form, or drawn on the frame (or a picturebox).
    If you select them from the form, then drag them "over" a frame, when you release them they will be drawn on the form, so are underneath the frame and you can't see them. Since the frame is not a lightweight control (it is its own window), it can't be pushed to be beneath windowless controls like labels.
    So, when you dropped the labels and they "disappeared", you should have moved the frame, and possibly any other controls that may have been covering the labels to get access to them again, select them and "cut" them rather than drag them.
    You then select the container you want to add them to, i.e. the form, a frame or a picturebox, and then paste them into that container.

  14. #14
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,942

    Re: [RESOLVED] How do I move existing controls into a frame?

    Yes, I agree. I've also messed up a few times in the past when doing this. That's why I recommended always creating the frame before the copy-paste.

    It's always a pain to have to go find an old backup copy of the form, load it into another copy of the IDE, and then re-copy the controls from that backup form.

    I'm fortunate to almost always be developing on multi-monitor systems. When doing re-arranging like this, I typically stretch the form out such that it's very large (sometimes spreading across monitors), to give me work-space. That way, it's much easier to see what I'm doing. If working with SSTab (or other container), I will sometimes stretch that out too.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

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