How to create a control array

I am new at vb and trying to lean from a book. I have a frame with 3 option buttons. trying to give them all the same names. Everytime I try and name the second buton I get ambigous name. Some how Im mising the instructions on how to do this correctely, If could help would appriciate it.

This is in all 3 buttons
Private Sub optSize_Click(Index As Integer)
‘Read pizza size
PizzaSize = optSize(Index).Caption
End Sub

Comments

  • : I am new at vb and trying to lean from a book. I have a frame with 3 option buttons. trying to give them all the same names. Everytime I try and name the second buton I get ambigous name. Some how Im mising the instructions on how to do this correctely, If could help would appriciate it.
    :
    : This is in all 3 buttons
    : Private Sub optSize_Click(Index As Integer)
    : ‘Read pizza size
    : PizzaSize = optSize(Index).Caption
    : End Sub
    :
    :
    In the property window in VB you can see the value [INDEX] with that one you can create a control array. But when you get the error like you say, i think it asks if you want to create an array.
    Anyway, just enter a value in the index part of the propery window!

    Succes!


    Greetz from DarQ

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion