Click here to Skip to main content
16,020,628 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need to copy the results of a msgbox Pin
beeker55337-May-09 5:59
beeker55337-May-09 5:59 
QuestionVB6 card game question Pin
ymilan6-May-09 9:57
ymilan6-May-09 9:57 
AnswerRe: VB6 card game question Pin
Mycroft Holmes6-May-09 14:26
professionalMycroft Holmes6-May-09 14:26 
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 
I did some work on this, but what happens at run time is:
The message displayed is "This card does not belong here" irregardless of whatever image1 card I place drag and drop over the hearts card.   I can drag the matching card, or another one to the very same slot and that message is displayed.   It's like the code never gets past the <> line.
At run time, after I drop the image1 card over the hearts card, then all the cards in the image1(0) slot automatically drop on the same position hearts cards.   Any ideas on how I can wrestle with this would be appreciated.

Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
         Dim HeartsIndex As Integer
         Dim NewIndex As Integer
         Dim Button As Integer
        
         For HeartsIndex = 0 To 12
                  For Index = 0 To 12
                           Hearts(HeartsIndex).Picture = Image1(Index).Picture
                              If Button = vbLeftButton Then
                                    If TypeOf Source Is Image Then
                                          Hearts(HeartsIndex).Picture = Source.Picture
                  End If
                  End If
                  Next
                  Next
  
   For NewIndex = 0 To 12
                              If Source.Picture <> Image1(NewIndex).Picture Then
                                    Image1(NewIndex).Drag vbCancel
                                    MsgBox ("This card does not belong here")
                              Exit Sub
                              Else
                                    Image1(NewIndex).Drag vbEndDrag
                                    MsgBox ("You're right!")
                                   
                           Exit Sub
                  End If
                  Next
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 
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 

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.