Click here to Skip to main content
15,915,163 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
Wow!   Thanks for the expert explanation.   Does this mean I would put:

Image1(0).Tag = Hearts(0).Tag

Somewhere in the first part of the code?   Where so?   This is all my code so far; problem is which ever card is in the first slot (as in Image1(0)), but can be any card, when dropped over Hearts(0), it says, you're right and allows drop.   If the real Image1(0).Picture, King Hearts is dropped over Hearts(0), it says you're wrong.

I changed all my settings in design mode to put images on the left as Automatic and none for both OLE modes.   I set images on the right to be Manual for drag and none for both Ole modes.   Any problems on this?   Here is all of my code so far:   I appeciate your help....

Option Explicit
Public Sub Main()
      Start_Game.Show

End Sub
Private Sub Exit_Click()
      MsgBox ("Thank you for playing.   Good Bye.")
End

End Sub


Private Sub Start_Click()

      Dim arrDeck(52)
      Dim Cardcount As Integer
      Dim Counter As Integer

Do While Cardcount <= 51
      arrDeck(Cardcount) = Cardcount
      Cardcount = Cardcount + 1
Loop

Dim swap As Integer
Dim posn1 As Integer
Dim posn2 As Integer
Randomize
      For swap = 0 To 100
            posn1 = Int(52 * Rnd)
            posn2 = Int(52 * Rnd)
            If (posn1 <> posn2) Then
                  KingH(0).Picture = Image1(posn1).Picture
                  Image1(posn1).Picture = Image1(posn2).Picture
                  Image1(posn2).Picture = KingH(0).Picture
            End If
      Next swap

Counter = 0

For Counter = 0 To 51
      Image1(Counter).Visible = True
Next Counter

End Sub
Private Sub Hearts_DragOver(Index As Integer, Source As Control, _
      X As Single, Y As Single, State As Integer)
If Index <= 12 Then
      If State = 0 Then
            Hearts(Index).Picture = LoadPicture("C:\Program1\redbacking.gif")
      Else
            If State = 1 Then
                  Hearts(Index).Picture = Hearts(Index).Picture
            Else
                  If State = 2 Then
                  End If
            End If
      End If
End If

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

If Hearts(Index).Tag = Source.Tag Then
      Image1(Index).Drag vbEndDrag
      MsgBox ("You're Right")
      Else
      Image1(Index).Drag vbCancel
      MsgBox ("You're Wrong")
      Exit Sub
End If

End Sub
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 
GeneralRe: Attached to Events Pin
Thayhor6-May-09 21:05
Thayhor6-May-09 21:05 
GeneralRe: Attached to Events Pin
Dave Kreskowiak7-May-09 1:49
mveDave Kreskowiak7-May-09 1:49 
Questioncheckedlistbox in vb.net Pin
Pankaj-codeproject6-May-09 8:46
Pankaj-codeproject6-May-09 8:46 
AnswerRe: checkedlistbox in vb.net Pin
Dave Kreskowiak6-May-09 9:15
mveDave Kreskowiak6-May-09 9:15 
GeneralRe: checkedlistbox in vb.net Pin
Pankaj-codeproject6-May-09 20:55
Pankaj-codeproject6-May-09 20:55 
QuestionPlaying Music in VB.Net application [modified] Pin
DarkSorrow386-May-09 8:12
DarkSorrow386-May-09 8:12 
AnswerRe: Playing Music in VB.Net application Pin
Dave Kreskowiak6-May-09 8:35
mveDave Kreskowiak6-May-09 8:35 
GeneralRe: Playing Music in VB.Net application Pin
DarkSorrow386-May-09 8:54
DarkSorrow386-May-09 8:54 

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.