Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB6 card game question Pin
riced6-May-09 22:32
riced6-May-09 22:32 
GeneralRe: VB6 card game question Pin
ymilan9-May-09 2:01
ymilan9-May-09 2:01 
GeneralRe: VB6 card game question Pin
riced10-May-09 2:17
riced10-May-09 2:17 
GeneralRe: VB6 card game question Pin
ymilan10-May-09 5:14
ymilan10-May-09 5:14 
GeneralRe: VB6 card game question Pin
ymilan9-May-09 3:01
ymilan9-May-09 3:01 
GeneralRe: VB6 card game question Pin
riced9-May-09 6:27
riced9-May-09 6:27 
GeneralRe: VB6 card game question Pin
ymilan10-May-09 5:14
ymilan10-May-09 5:14 
GeneralRe: VB6 card game question Pin
riced11-May-09 5:45
riced11-May-09 5:45 
Sounds a bit of a strange tutorial, how can source and target be the same?
As I said I'm not sure what the GUI is like so here's my take on what you might need to do.
Assuming you have four piles (one each for Hearts, Spades, Clubs and Diamonds) each being a control array of images. The aim being to complete each pile by placing cards on it in order.
You also have a deck of cards and possibly one or more heaps of cards (it depends on the version of solitaire you want to play).
Simplifying, the rules are that the top card of the deck is turned face up. It can then be placed on one of the piles or one of the heaps. A card can be moved from a heap to the appropriate pile provided it is same suit and 1 higher in value than top of pile (if the pile is empty it must be the Ace).

In terms of code the source will be the selected card on a heap, or the top of deck; the target will be one of the piles.
So the piles must react to the DragDrop event (as in your Hearts_DragDrop).
The question is what must it do in this event? The answer depends on the rules of the game and your GUI design. However, it should only be dropping one card onto the top of the pile. Your first loops are trying to drop all the image1().Pictures onto all the Hearts().Pictures. Looking at the code it has the same effect as this bit of code (not what I think was intended):
For HeartsIndex = 0 To 12
   If TypeOf Source Is Image Then
      Hearts(HeartsIndex).Picture = Image1(12).Picture
   End If
Next

I.e. the effect is to set all the Hearts().Pictures to image1(12).Picture.

It might be better to continue this off-forum, if so, you can mail me as riced with domain david-rice dot demon dot co dot uk. (obviously in proper email address format!)

Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis

GeneralRe: VB6 card game question Pin
ymilan15-May-09 11:27
ymilan15-May-09 11:27 
GeneralRe: VB6 card game question Pin
riced18-May-09 6:11
riced18-May-09 6:11 
GeneralRe: VB6 card game question Pin
ymilan18-May-09 9:22
ymilan18-May-09 9:22 
GeneralRe: VB6 card game question Pin
ymilan2-Jun-09 14:26
ymilan2-Jun-09 14:26 
GeneralRe: VB6 card game question Pin
riced3-Jun-09 4:42
riced3-Jun-09 4:42 
GeneralRe: VB6 card game question Pin
ymilan3-Jun-09 5:10
ymilan3-Jun-09 5:10 
GeneralRe: VB6 card game question Pin
ymilan3-Jun-09 6:28
ymilan3-Jun-09 6:28 
GeneralRe: VB6 card game question Pin
riced3-Jun-09 8:06
riced3-Jun-09 8:06 
GeneralRe: VB6 card game question Pin
ymilan3-Jun-09 9:02
ymilan3-Jun-09 9:02 
GeneralRe: VB6 card game question Pin
riced3-Jun-09 10:04
riced3-Jun-09 10:04 
GeneralRe: VB6 card game question Pin
ymilan3-Jun-09 11:54
ymilan3-Jun-09 11:54 
GeneralRe: VB6 card game question Pin
ymilan4-Jun-09 2:47
ymilan4-Jun-09 2:47 
GeneralRe: VB6 card game question Pin
ymilan2-Jun-09 14:29
ymilan2-Jun-09 14:29 
GeneralRe: VB6 card game question Pin
ymilan2-Jun-09 23:24
ymilan2-Jun-09 23:24 
QuestionAttached to Events Pin
Thayhor6-May-09 8:55
Thayhor6-May-09 8:55 
AnswerRe: Attached to Events Pin
Dave Kreskowiak6-May-09 9:05
mveDave Kreskowiak6-May-09 9:05 
GeneralRe: Attached to Events Pin
Thayhor6-May-09 11:13
Thayhor6-May-09 11:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.