Thread: checkboxes

  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Brisbane, Australia
    Rep Power


    ok i know this might seem like a simple thing, but im a newbie vb programmer so gimme a chance...
    ok ive got a barebones poker game, i finish the shuffling algorithm, the arrays n stuff, the thing that gets me stuck is the checkboxes "holding" cards. i dont know how to link them up to holding the cards.
    right now i have declared:
    deck (1 to 52) ' to provide slots for cards
    hand (1 to 5) ' to provide hand for cards
    handsuit (1 to 5) ' to provide a placeholder for suits for cards in the hand array
    handnum (1 to 5) ' to provide a placeholder for card names in the hand array
    my checkboxes are undeclared arrays named check1(index as integer)
    how would i go about creating code to retain the value in the hand array relative to the checkboxes? if anyone doesnt understand please tell me what you would like clarified and ill do the best i can rephrasing it for you

    Da AzNiNsEcT
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Somewhere in the great unknown
    Rep Power
    If I understand you correctly, you are loading up a "dealt" hand of five cards into the hand array. You also have five checkboxes. Match the index of the checkbox to the index of the hand array.
    For iCntr = 1 To 5
        If chkDiscard(iCntr) = vbChecked Then
            'get another card and place it in this slot
            Hand(iCntr) = NewCardFunction
        End If
    Next iCntr

IMN logo majestic logo threadwatch logo seochat tools logo