-
Mar 21st, 2005, 10:16 AM
#1
Thread Starter
Lively Member
Dissapearing Cards ?
Hi, in my blackjack game I have everythin working fine and dandy now, thnaks but I need screen shots but evrytime a window appears over the card it will dissapear or if i minimise the window the cards will dissapear, this makes it a pain when trying to use print screen, is there any way 2 make the cards stop dissapearing??
-
Mar 21st, 2005, 10:19 AM
#2
Fanatic Member
Re: Dissapearing Cards ?
Try setting autoredraw to be true on the cards container
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Mar 21st, 2005, 10:26 AM
#3
Thread Starter
Lively Member
Re: Dissapearing Cards ?
I do not have a container they just appear at a particular point on the form, I set the forms autoredraw to true but no cards appear at all when I do this?
-
Mar 21st, 2005, 10:32 AM
#4
Fanatic Member
Re: Dissapearing Cards ?
Place the code for drawing the cards into Form_Paint event.
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Mar 21st, 2005, 10:47 AM
#5
Re: Dissapearing Cards ?
If you've set the AutoRedraw property you must call the Refresh method after you've painted the cards.
-
Mar 21st, 2005, 10:48 AM
#6
Thread Starter
Lively Member
Re: Dissapearing Cards ?
Sorry im not to sure what you mean by that? could you please explain
-
Mar 21st, 2005, 10:52 AM
#7
Re: Dissapearing Cards ?
Set the AutoRedraw property of the form at design time. Then in the procedure that paints the cards on the form add a Me.Refresh call at the end.
-
Mar 21st, 2005, 11:26 AM
#8
Thread Starter
Lively Member
Re: Dissapearing Cards ?
So I just place the Me.Refresh before the End Subs for the Deal, hit and stick commands? I tried that and the cards woul;d appear quickly and dissapear again, I think I may have placed it in the wrong location?
-
Mar 21st, 2005, 12:02 PM
#9
Thread Starter
Lively Member
Re: Dissapearing Cards ?
SO say I have the procedure for the hit command
VB Code:
Private Sub CMD_Hit_Click()
If PlrCardNbr < 5 Then 'Checks to see that the player has less than 5 cards
PlrCardNbr = PlrCardNbr + 1 'Increments Players card count by 1
Xpos = Xpos + 25 'Positons card 25 spaces along so doesnt cover previous card
PlayerCard(PlrCardNbr) = Int(52 * Rnd) 'Claculates random value between 0 and 51 for card
cdtDraw Me.hdc, Xpos, 425, PlayerCard(PlrCardNbr), 0, vbWhite 'Displays card
AddToPlayerTotal PlayerCard(PlrCardNbr) 'Adds value of Players card to Players total
If Player1_total > 21 Then 'Checks to see if player is bust
MsgBox "you are bust, the dealer wins this hand please click deal to play again", vbInformation
Player1_total = 0 'resets Player and Dealers score to 0
Dealer_total = 0
CMD_Hit.Enabled = False 'Grays out the Hit and Stick buttons, but allows the deal button to be click
CMD_Stick.Enabled = False
CMD_Deal.Enabled = True
Dealer_wins = Dealer_wins + 1 'Increments Dealer wins by 1
MsgBox "Player has won " & Player_wins & " times, Dealer has won " & Dealer_wins & " times.", vbInformation 'Displays how many time the player has won and how many times the dealer has won
End If
End If
End Sub
Where abouts would the Me.refresh go within this, I tried at the start but this did not work and also at the end but again this did not work?
-
Mar 21st, 2005, 12:14 PM
#10
Hyperactive Member
Re: Dissapearing Cards ?
Try placing it at the end of your CMD_Deal sub.
-
Mar 21st, 2005, 12:21 PM
#11
Thread Starter
Lively Member
Re: Dissapearing Cards ?
Thanks but I tried that, no cards appeared at all dont know whats happening?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|