How to create a control array - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to create a control array

dantbdantb Posts: 3Member
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

  • DarQDarQ Posts: 1,625Member
    : 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.