Results 1 to 12 of 12

Thread: How do I get a bunch of checkboxes to lay down in order ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Location
    Anywhere I want to.
    Posts
    119

    How do I get a bunch of checkboxes to lay down in order ?

    I have four checkboxes vertically in Index order 0, 1, 2 and 3 in pic1.
    I click on them from top to bottom.

    I Copy,
    I Paste into pic2 and the incremental checkboxes in this next group are not in order of Index as I wold expect as 4, 5, 6 and 7.

    I have lots to copy paste !
    So how do I do that ?

  2. #2
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    898

    Re: How do I get a bunch of checkboxes to lay down in order ?

    I'd approach the problem by putting all your checkboxes where you want them.
    Then bring up the form (it's a text file_ in Notepad or other text editor.
    Then manually change the indexes of the checkboxes to your desired order.
    HTH

  3. #3
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,410

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Do check boxes come in bunches? Isn't a bunch the group noun for flowers? Can they be tied up with string? So many questions. Is the same applicable to check boxes? I think not.

    Check boxes are simply grouped. It is a group of check boxes. Hope that clarifies things.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,608

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Quote Originally Posted by LorinM View Post
    I have four checkboxes vertically in Index order 0, 1, 2 and 3 in pic1.
    I click on them from top to bottom.
    Mark them from Bottom to top.....

    Remember: The last "marked" Control will be the first one pasted....

    btw: why would you expect the Index (TabIndex?) to be in Order to your "previous" CheckBoxes?
    The (Tab-) Index Order for "newly" pasted Controls starts with the highest available (Tab-) Index of the Form/Container
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Location
    Anywhere I want to.
    Posts
    119

    Re: How do I get a bunch of checkboxes to lay down in order ?

    I did not say Tabindex.
    Index as in array Index ... chkSel(Index).value

  6. #6
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,318

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Quote Originally Posted by LorinM View Post
    I have four checkboxes vertically in Index order 0, 1, 2 and 3 in pic1.
    I click on them from top to bottom.

    I Copy,
    I Paste into pic2 and the incremental checkboxes in this next group are not in order of Index as I wold expect as 4, 5, 6 and 7.

    I have lots to copy paste !
    So how do I do that ?

    Hmmm....Let me understand.
    1-You have an array of checkboxes inside picturebox # 1 (Check(0), check(1), check(2) and check(3))
    2-You select them and select copy (or CTRTL-C)
    3-You move your mouse inside picturebox # 2
    4-You paste (or CTRL-V)
    5-You get those checkboxes with some indices.

    It sounds like you DO have check(4), Check(5), check(6) and Check(7) in picturebox # 2 (that is the way it works)
    Is that what you want, or do you want an array of them in picturebox #2 WITH THE SAME indices as in picturebox #1?
    Sam I am (as well as Confused at times).

  7. #7
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,318

    Re: How do I get a bunch of checkboxes to lay down in order ?

    OR, are they in a mixed order from top to bottom (ex: 5,7, 4 6)? Is THAT the issue?

    EDIT: By the way...I tried to replicate what you said (see my steps above)....when I pasted the four checkboxes into a second picturebox, they ended up, from top to bottom, as I would expect, 4, 5, 6, 7.

    EDIT: PS---I added a third picturebox and selected (from top to bottom) the four checkboxes in my second picturebox, and then pasted them into my third picturebox...they appeared in the order I expected (from top to bottom: 8, 9, 10, 11).
    Last edited by SamOscarBrown; Jun 12th, 2024 at 12:26 PM.
    Sam I am (as well as Confused at times).

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Location
    Anywhere I want to.
    Posts
    119

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Perhaps it has to do with their physical position, Left Side or whatever. My group is a vertical group of four, fairly close but not touching visually.

  9. #9
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,318

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Not sure your problem, as when I did what I THINK you did, mine come out just as expected. What are you doing differently than what I said in post 6?

    Are you using the mouse to select as a group (that is drawing a 'box; around them, or are you clicking on the top one, the second one down, then then the third, and then the last one (using the Ctrl Key)?
    Sam I am (as well as Confused at times).

  10. #10
    Addicted Member Mongoose_MHS's Avatar
    Join Date
    May 2024
    Posts
    187

    Re: How do I get a bunch of checkboxes to lay down in order ?

    The one thing I have read on here is.. Use FRAMES. When using multiple option boxes and checkboxes is that they should be contained to do what you want.. They cannot all be on the same form without being seperated in a confined area. I'm not sure if i'm explaining that right. Maybe someone else can explain it better.
    Last edited by Mongoose_MHS; Jun 12th, 2024 at 11:45 PM.
    Monroe High School.. GO HORNETS!

    If I've help you, please add to my reputation level! Each reply has a "STAR" icon followed by: "Rate this post".. click that

  11. #11
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,318

    Re: How do I get a bunch of checkboxes to lay down in order ?

    A frame is a container...a Picturebox is a container. works the same in both
    Sam I am (as well as Confused at times).

  12. #12
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,665

    Re: How do I get a bunch of checkboxes to lay down in order ?

    Positioning controls is a simple problem. It's even easier if you have an array of controls because you can just loop through them.

    This is air-code so take it for what it's worth...

    Code:
    Sub PositionControls
    Dim n as long
    Const SPACING = 180
    
    with chkBox(0)
    
        .Left = SPACING
        .Top = SPACING
    
    end with
    
    For n= chkBox.Lbound + 1 To chkBox.Ubound
    
       .Left = chkBox(0).Left
       .Top = chkBox(n-1).Top + chkBox(n-1).Height + SPACING
    
    Next n
    
    End Sub

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