Results 1 to 7 of 7

Thread: How do you access group box controls that are in a collection

Threaded View

  1. #3

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    4
    Yeah, I guess I wasn't very specific. Basically, I'm writing sort of a questionaire or test. It reads the questions from a file. Each question will be placed in a groupbox as a label. The groupbox also contains another groupbox that houses the radio buttons.

    Each question group box (containing questions and choices) is added to a collection. There are three questions per page so a next button loads the next three questions onto the form.

    So, whenever I hit either the next or previous button, I'd like to store my answers to an array (for now). I just don't know how to refer to the radio buttons inorder to check their state.

    Here is a sample of how each question is organized:

    VB Code:
    1. grpBoxTFQuestion = New GroupBox
    2.  
    3.         With grpBoxTFQuestion
    4.             .Size = gbTFq.Size          
    5.         End With
    6.  
    7.         lbltfquest = New Label 'creates a new label
    8.         grpBoxTFQuestion.Controls.Add(lbltfquest) 'adds the question in the group box
    9.         With lbltfquest
    10.             .Size = lblTFQuestion.Size
    11.             .Text = p(1)
    12.             .Location = lblTFQuestion.Location
    13.         End With
    14.  
    15.         grpboxRDOButtons = New GroupBox 'group box for true false selection
    16.         grpBoxTFQuestion.Controls.Add(grpboxRDOButtons)
    17.         With grpboxRDOButtons
    18.             .Size = gbTF.Size
    19.             .Location = gbTF.Location
    20.         End With
    21.  
    22.         rdoT = New RadioButton
    23.         grpboxRDOButtons.Controls.Add(rdoT)
    24.         With rdoT
    25.             .Size = rdoTrue.Size
    26.             .Location = rdoTrue.Location
    27.             .Text = rdoTrue.Text
    28.         End With
    29.  
    30.  
    31.         rdoF = New RadioButton
    32.         grpboxRDOButtons.Controls.Add(rdoF)
    33.         With rdoF
    34.             .Size = rdoFalse.Size
    35.             .Location = rdoFalse.Location
    36.             .Text = rdoFalse.Text
    37.         End With

    I'm sure it's a simple answer, but I'm an even bigger simpleton!!!
    Last edited by stefanos33; Apr 8th, 2004 at 02:48 PM.

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