Frames with Check boxes?

Discussion in 'AutoCAD' started by pkirill, Feb 17, 2004.

  1. pkirill

    pkirill Guest

    Is there an easy way to check or uncheck a bunch of check boxes in a frame?
    I've got it set now that when a user clicks the frame all the boxes uncheck
    if checked and vica versa - each with its own If/Then/Else statement. But
    I'm now looking at adding a LOT of check boxes and I was hoping there was
    some way to group them.

    thanks for any help!
     
    pkirill, Feb 17, 2004
    #1
  2. pkirill

    Heath Guest

    try some thing like

    Dim CheckBox As Control
    For Each CheckBoxIn UserForm1.Frame1.Controls
    CheckBox.Value = True '' check the box...
    Next CheckBox

    HTH

    Heath
     
    Heath, Feb 17, 2004
    #2
  3. pkirill

    LochDhu Guest

    Use this to start - edit to accept the frame name:

    Sub Lo()
    Dim ctl As Control
    Dim chk As CheckBox
    Dim Parent As Object
    For Each ctl In Me.Controls
    If TypeOf ctl Is CheckBox Then
    Set chk = ctl
    If ctl.Parent.Name = "Frame1" Then chk.Value = Not chk.Value
    End If
    Next ctl
    End Sub

    Good Luck,

    Scott
     
    LochDhu, Feb 17, 2004
    #3
  4. pkirill

    pkirill Guest

    Much Thanks! Very helpful!
     
    pkirill, Feb 17, 2004
    #4
  5. pkirill

    wivory Guest

    As an aside, what happens if some of the checkboxes are checked and some are not, then they click the frame? Do all the checked ones become unchecked and all the unchecked ones become checked? This doesn't seem particularly helpful. On the other hand a couple of buttons like "Check All" and "Uncheck All" seems more intuitive.

    But I also wonder if checkboxes are really the right paradigm to be using for what you want. If you need a LOT then perhaps there is a better way. If you care to elaborate a little on what the requirement is we may be able to suggest an alternative approach.

    Just my two cents.

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Feb 18, 2004
    #5
  6. pkirill

    pkirill Guest

    Thanks, Wayne -

    What I'm looking at setting up a routine that will compile a series of color
    coordination drawings. This is my first round on this routine and is
    targeted at a specific project where I know exactly which files need to be
    converted to what. I'm looking at 5 disciplines (each with it's own frame)
    and each frame having 4 choices of files to process. Existing 1st floor,
    existing 2nd floor, new 1st floor, new second floor. Each week we have to
    compile these and send them to a client. The check boxes on/off is simply
    so I can either run all the disciplines or just one or two. What
    occasionally happens is that I run the process and then later someone, say
    Electrical, makes a minor change and I need to run just the
    Electrical/New/1st floor again before we post. All-in-all the routine
    processes 37 drawings to create the 20 we need to submit.

    So basically what I'm trying to create is a Check All/Check None For This
    Discipline subr.

    make more sense?



    are not, then they click the frame? Do all the checked ones become
    unchecked and all the unchecked ones become checked? This doesn't seem
    particularly helpful. On the other hand a couple of buttons like "Check
    All" and "Uncheck All" seems more intuitive.
    for what you want. If you need a LOT then perhaps there is a better way.
    If you care to elaborate a little on what the requirement is we may be able
    to suggest an alternative approach.
     
    pkirill, Feb 18, 2004
    #6
  7. pkirill

    wivory Guest

    Okay, I think I understand. On that basis it sounds like what you're doing (combined with the suggestions of others here) is fine.

    If it was me, I'd probably do it slightly different. From what I understand you're saying, typically you want to process everything but occasionally you want to only (re)process a particular drawing or two. On that basis I would have all your checkboxes as you do now, but preceding those I would have two option buttons: one called "Process Everything" that is selected by default and the other called "Process Selected". Further I would have all the checkboxes disabled and unselected by default. The action of choosing the Selected option button would cause all the checkboxes to become Enabled so the user could check the ones required.

    Hmmm...I was about to say this approach would save you having to loop through all the checkboxes turning them on for a Check-All button but then I realised you still have to do the loop to Enable them all. Okay, how about this...you have all the checkboxes Enabled but you have the frames containing them Disabled (which effectively disables the checkboxes). That way when the user chooses the Selected option button you only have to enable a few frames instead of heaps of checkboxes.

    Please yourself whether you adopt this. I'm just a bit of a fanatic when it comes to interface design.

    Regards

    Wayne
     
    wivory, Feb 19, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.