Handling Frames & Radio Buttons

I have a frame1  on a form. And Frame1 contains Frame2. Frame2 is having 3 Radio buttons. Can any one help mw how to generate a control array for Frame2 Dynamically.
I have used the following to generate frame2 dynamically
load frame2(1). But the dynamically created frame(ie, Frame2(1)) is not having the radio buttons.
I need a new frame exactly same as that of frame2(0)(ie., created at design time which is a container for 3 radio buttons).
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You're not going to like this answer but it's the truth. Get into the more object-oriented aspects of VB and learn how to make a user control. Then it's easy. Create a user control containing your frame and 3 radio buttons and you can then have as many of those as you like on the form, whether in or outside control arrays.
kbalarajuAuthor Commented:
I'm using the following code & could able to generate them. but the problem is the container is not being change for the option buttons eve though I set them.
Could you pl. look at the code & figure out what the problem is?
    'This variable is used for creating option buttons dynamically(Index value for the Option button to be created)
    'Bcoz we have 3 design time option buttons in frame2(0)(So, indexes will be 0,1,2)
    j = 3
    'Create Charts dynamically & Display charts
    'If i is 0 then use the design time controls
    For i = 0 To 3
        If (i > 0) Then 'Create controls Dynamically
            'Create chart control & Set it's left property
            Load CityDivisions(i)
            CityDivisions(i).Left = CityDivisions(i - 1).Left + CityDivisions(i - 1).Width + 5
            'Create frame Control & Set Properties
            Load Frame2(i)
            Frame2(i).Left = Frame2(i - 1).Left + Frame2(i - 1).Width + 250
            Frame2(i).Visible = True
            Frame2(i).Caption = "Radio Group" & Str(i)
            Frame2(i).BorderStyle = 0
            ''Create Option buttons whose container is above created frame
            For k = 1 To 3  'Create Totally 3 option buttons
                'Create an option button
                Load Option1(j)
                'Set it's container property so that Option button belongs to newly created frame
                Option1(j).Container = Frame2(i)
                'Set other properties
                Option1(j).Visible = True
                Option1(j).Caption = Option1(j Mod 3).Caption
                'Option button left value with in the frame
                Option1(j).Left = 435
                Option1(j).Top = Option1(j Mod 3).Top
                j = j + 1
            Next k
        End If
        'Call the procedure to draw the chart
        DrawCityDivisionChart CityDivisions(i), ("Los Angeles" + Trim(Str(i))), i
    Next i
Use the following function:

Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Call SetParent(Option1(3).hWnd, Frame1(1).hWnd)
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Option1(j).Container = Frame2(i) ' this will generate error

Set Option1(j).Container = Frame2(i)
kbalarajuAuthor Commented:
I don't want to use any API Calls. Need modification to my code. Ameba said it correctly.
>Ameba said it correctly
Set ameba.points = 25 ' try this :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kbalarajuAuthor Commented:

Thanks Everyone for helping me!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.