Click here to Skip to main content
15,886,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to flip/turn cards over Pin
Dave Kreskowiak12-Jun-09 9:33
mveDave Kreskowiak12-Jun-09 9:33 
GeneralRe: How to flip/turn cards over Pin
ymilan15-Jun-09 7:14
ymilan15-Jun-09 7:14 
AnswerOT Pin
Luc Pattyn12-Jun-09 6:37
sitebuilderLuc Pattyn12-Jun-09 6:37 
GeneralRe: OT Pin
ymilan15-Jun-09 10:00
ymilan15-Jun-09 10:00 
GeneralRe: OT Pin
Luc Pattyn15-Jun-09 10:04
sitebuilderLuc Pattyn15-Jun-09 10:04 
GeneralRe: OT Pin
ymilan15-Jun-09 10:17
ymilan15-Jun-09 10:17 
GeneralRe: OT Pin
Luc Pattyn15-Jun-09 10:22
sitebuilderLuc Pattyn15-Jun-09 10:22 
GeneralRe: OT Pin
ymilan16-Jun-09 5:48
ymilan16-Jun-09 5:48 
You're right; I changed some of the code.   I'm thinking that on mousedown event, somewhere I would flip the backing cards over when the user presses the mouse down on the card.   How would I do that?  

Here it is:

Option Explicit
Public Sub FormLoad()

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

End Sub
Private Sub Start_Click()
      Image2.Visible = False
      Dim Selected As Boolean
      Dim arrDeck(52)
      Dim Cardcount As Integer
      Dim Counter As Integer
      Dim Index As Integer
        
      Do While Cardcount <= 52
            arrDeck(Cardcount) = Cardcount
            Cardcount = Cardcount + 1
      Loop

      Dim swap As Integer
      Dim posn1 As Integer
      Dim posn2 As Integer

      Randomize
      For swap = 0 To 50
         ' Get two random positions
         posn1 = Int(52 * Rnd)
         posn2 = Int(52 * Rnd)

         ' Swap pictures at these positions
            If (posn1 <> posn2) Then
                  KingH(0).Picture = Image1(posn1).Picture
                  KingH(0).Tag = Image1(posn1).Tag
                  Image1(posn1).Picture = Image1(posn2).Picture
                  Image1(posn1).Tag = Image1(posn2).Tag
                  Image1(posn2).Picture = KingH(0).Picture
                  Image1(posn2).Tag = KingH(0).Tag
            End If
      Next swap

Start_Game.Refresh
     
      For Counter = 0 To 50
            Counter = Counter + 1
            Image1(Counter).Picture = LoadPicture("C:\Program1\Back.gif")
              
      Next Counter

      Counter = 0

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

End Sub
Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, _
X As Single, Y As Single)
      Image1(Index).Drag vbBeginDrag

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
            Hearts(Index).Picture = Source.Picture
            Source.Picture = Image1(Index).Picture
            Source.Visible = False
            Source.Drag vbEndDrag
            MsgBox ("OK")
      Else
         Image1(Index).Picture = Image1(Index).Picture
         Source.Drag vbCancel
         MsgBox ("No Way Shirley")
      End If

End Sub
GeneralRe: OT Pin
Luc Pattyn16-Jun-09 6:16
sitebuilderLuc Pattyn16-Jun-09 6:16 
GeneralRe: OT Pin
ymilan16-Jun-09 6:54
ymilan16-Jun-09 6:54 
GeneralRe: OT Pin
Luc Pattyn16-Jun-09 11:28
sitebuilderLuc Pattyn16-Jun-09 11:28 
GeneralRe: OT Pin
ymilan16-Jun-09 11:30
ymilan16-Jun-09 11:30 
QuestionRead the comma delimited text file. Pin
Member 402761712-Jun-09 4:59
Member 402761712-Jun-09 4:59 
AnswerRe: Read the comma delimited text file. Pin
EliottA12-Jun-09 5:25
EliottA12-Jun-09 5:25 
AnswerRe: Read the comma delimited text file. Pin
Dave Kreskowiak12-Jun-09 5:26
mveDave Kreskowiak12-Jun-09 5:26 
GeneralRe: Read the comma delimited text file. Pin
Member 402761716-Jun-09 21:17
Member 402761716-Jun-09 21:17 
GeneralRe: Read the comma delimited text file. Pin
Dave Kreskowiak17-Jun-09 1:39
mveDave Kreskowiak17-Jun-09 1:39 
AnswerRe: Read the comma delimited text file. Pin
LloydA11112-Jun-09 9:15
LloydA11112-Jun-09 9:15 
QuestionTrying to acccess sql parameter from dataset Pin
Roger Rainey12-Jun-09 3:56
Roger Rainey12-Jun-09 3:56 
AnswerRe: Trying to acccess sql parameter from dataset Pin
Colin Angus Mackay12-Jun-09 4:28
Colin Angus Mackay12-Jun-09 4:28 
QuestionFolder permissions Pin
vhassan12-Jun-09 1:58
vhassan12-Jun-09 1:58 
AnswerRe: Folder permissions Pin
Dave Kreskowiak12-Jun-09 3:48
mveDave Kreskowiak12-Jun-09 3:48 
AnswerRe: Folder permissions Pin
Nagy Vilmos12-Jun-09 3:59
professionalNagy Vilmos12-Jun-09 3:59 
QuestionDynamic Data Exchange LinkExecute Pin
vhassan11-Jun-09 19:50
vhassan11-Jun-09 19:50 
AnswerRe: Dynamic Data Exchange LinkExecute Pin
Dave Kreskowiak12-Jun-09 3:46
mveDave Kreskowiak12-Jun-09 3:46 

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.