dimanche 29 novembre 2015

Comparing data from 2 arrays VB

Can I compare 2 arrays to check for a active checkbox in Visual Basic? There's one array that collects all the checkboxes in a vertical column and then the other array collects the checkboxes in a horizontal column. I'm not very good with VB so could you simplify the answer for me please.

    Dim Choice1(4) As Integer
    Choice1(0) = chkbocsYmg1Choice1.Checked
    Choice1(1) = chkbocsYmg2Choice1.Checked
    Choice1(2) = chkbocsYmg3Choice1.Checked
    Choice1(3) = chkbocsYmg4Choice1.Checked
    Choice1(4) = chkbocsYmg5Choice1.Checked

    Choice1(4) = "1"

That's the vertical column

    Dim Line1(4) As Integer
    Line1(0) = chkbocsYmg1Choice1.Checked
    Line1(1) = chkbocsYmg1Choice2.Checked
    Line1(2) = chkbocsYmg1Choice3.Checked
    Line1(3) = chkbocsYmg1Choice4.Checked
    Line1(4) = chkbocsYmg1Choice5.Checked

That's the horizontal column. It's a 5x5 grid of checkboxes with only one checkbox that's true in a horizontal and vertical lineup.




Aucun commentaire:

Enregistrer un commentaire