Click here to Skip to main content
16,006,065 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
GeneralRe: OT Pin
Luc Pattyn16-Jun-09 6:16
sitebuilderLuc Pattyn16-Jun-09 6:16 
Hi,

I have several comments:

1.

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

you are incrementing Counter twice: once explicitly, once implicitly in the For statement.
If that is what you want, you should adapt the for statement and add "Step 2" for clarity.

And you are loading that image from file over and over.

2.
I would keep the state of the game in my own data structures, independent of the GUI; I might choose to have an integer array storing the card numbers (0-51), a bool array storing a front/back flag, etc. Then perform the game rules on that data, and when something changes update the GUI.

So e.g. the initial card shuffle would occur in data arrays, not in PictureBoxes.

3.
I would keep all the card images in a single Image array, and load that once at app start. You seem to get all cards loaded in the PictureBoxes through the Designer (that is a lot of unnecessary work, such things are much easier in code).

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

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 
GeneralRe: Dynamic Data Exchange LinkExecute [modified] Pin
vhassan14-Jun-09 18:24
vhassan14-Jun-09 18: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.