New Solitaire Question

One card does not show up

Page 1 of 1

1 Replies - 628 Views - Last Post: 06 April 2009 - 11:07 PM Rate Topic: -----

#1 ymilan  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 16-March 09

New Solitaire Question

Posted 06 April 2009 - 10:10 PM

The following code works, EXCEPT it does not display the first card image at all. Any ideas? I tried just about everything....thanks.

Private Sub Start_Click()
Dim arrDeck(52)
Randomize
Dim CardCount As Integer
Dim CardVal As Integer
Dim Subnum As Integer
Dim Counter As Integer

CardCount = 1

Do While CardCount < 53
    arrDeck(CardCount) = -1
    CardCount = CardCount + 1
Loop

CardCount = 1
Counter = 0

Do While CardCount < 53 And Counter < 53
10 CardVal = Int((52 * Rnd) + 1)
If arrDeck(CardVal) = -1 Then
    arrDeck(CardVal) = CardCount
    Subnum = Counter
    Image1(Subnum) = Image1(CardVal)
    Image1(CardVal).Visible = True
    CardCount = CardCount + 1
    Counter = Counter + 1
Else:  GoTo 10
End If
Loop

This post has been edited by JackOfAllTrades: 07 April 2009 - 04:30 AM


Is This A Good Question/Topic? 0
  • +

Replies To: New Solitaire Question

#2 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: New Solitaire Question

Posted 06 April 2009 - 11:07 PM

Well, for starters, you need to put your code in the [code] tags .

I think you need something in the Private Sub Form_Load().
But anything else, I'm not 100% sure.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1