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

Visual Basic

 
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 
GeneralRe: VB6 card game question Pin
ymilan15-May-09 11:27
ymilan15-May-09 11:27 
Hi,

I've been working more on this and came up with the following.   wondering if State variable makes any difference.   Anyhow, when I run at runtime, the card from image1 pile that I drag from the left to the right over the same card, actually copies all of those cards in the entire suit of the hearts cards.   Hope this makes sense.   Here is the code.


Private Sub Image1_DragOver(Index As Integer, Source As Control, _
      X As Single, Y As Single, State As Integer)
      Dim HeartsIndex As Integer
     
      For Index = 0 To 12
      For HeartsIndex = 0 To 12
      If State = 0 Then
            Hearts(HeartsIndex).Picture = Image1(Index).Picture
      End If
      Next
      Next
     
End Sub


Private Sub Hearts_DragOver(Index As Integer, Source As Control, _
      X As Single, Y As Single, State As Integer)

Dim HeartsIndex As Integer

  
      If State = 2 Then
            If Hearts(HeartsIndex).Picture <> Image1(Index).Picture Then
                  Image1(Index).Drag vbEndDrag
                  MsgBox ("You're Right")
            Exit Sub
            Else
                  Image1(Index).Drag vbCancel
                  MsgBox ("You're Wrong")
            End If
      End If
End Sub


Private Sub Image1_DragDrop(Index As Integer, Source As Control, _
      X As Single, Y As Single)

     
      If Source.Name <> Image1(Index).Picture Then Exit Sub

  
   Image1(Index).Picture = Source.Picture
End Sub





Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)

      For Index = 0 To 12
            Hearts(Index).Picture = Source.Picture
      Next
  
End Sub
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 
GeneralRe: Attached to Events Pin
Dave Kreskowiak6-May-09 15:30
mveDave Kreskowiak6-May-09 15:30 

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.