I am running VB6 on WIN10.
I have already figured out how to shuffle the deck.
I do not know how to place the cards on the form. I think the hard way is to have a jpg of all the cards (52) and load the pictures. Then with then mouse move the pics to another place when necessary.
I think there is an easier way. It may be cards.dll, which I cannot find. Also I don't know to install it or use it.
Can't help you out if you are looking for full dealing and playing animation (IE you play a card and the card smoothly moves from your "hand" onto the "board", or when the cards are dealt, you see the "top" of each card smoothly making its way from the dealer's deck to the player's hand).
But I've written numerous card games in VB 6.0 and Borland C++ Builder and in each case I simply used arrays of PictureBoxes that were used to display the card images, and the act of clicking on a card in hand would be interpreted as playing the card, and then the image of the card would simply be moved from the "hand" picturebox to the appropriate "board" picturebox (provided the card was legally able to be played, etc.)
This does require having an image for each card in a deck, but in the case of Borland C++ Builder, I built a custom deck of cards component (equivalent to an OCX in VB 6.0) where the parent type was an ImageList, so I was able to store all of the card images into the component, and also all of the logic of shuffling, dealing cards, card ranks, suit information, multiple decks, multiple jokers per deck, etc. Drop that onto a form and I've got everything I need to start writing a card game as far as the cards part goes.
If you put some time into it, the same type of thing should be able to be built into an OCX in VB 6.0.
I know this msg doesn't belong here, but I don't know where tto put it.
I did not get a notification when members posted to my original question. How do I correct this problem?
VB6 use double buffer on forms (using the autoredraw). The name of the property is not exactly what it say. Autoredraw just place the double buffer. When a refresh produced we get the next buffer. So to draw a form, we have to place the cards, and when this done we give a refresh.
Don't use picture boxes. VB6 is very fast to redraw a form, and handling the refresh is the way to do anything very fast (you draw in the buffer not shown). Don't use dovents in events. Never do a lot of process in an event. Use a timer to render the next frame Timers have a resolution of ms, so you need a redrav each 1000/50 (for 50 hz) or (1000/60) for 60 hz.
You have to thing using specific variables for specific objects. These objects are the cards. Another set of variables are the "state" of the game. One of them unlock the players mouse to do something. You have to use flags to bypass or not the mouse down event. You have to check the player "grab" of a card.
So you have to worry about on event, not many events from many pictureboxes.
I know this msg doesn't belong here, but I don't know where tto put it.
I did not get a notification when members posted to my original question. How do I correct this problem?
Thanks
I think it should be the default. An email should be sent, I don't know if you have to enable allowing Admin to send e-mail for the notification e-mail to work or not.
But, you can just click on the Settings menu selection at the upper right of the forum page, and then select "General Settings" under "My Settings" on the left, and make sure you have "Default Thread Subscription Mode:" set to "Instantly, using email", if that is what you want.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
For years I have been getting e-mail notifications. I did not change any settings. This is the first thread that no notifications were sent. The new thread also did not have any notifications.
Per your ORIGINAL post, here is an example (pretty simple---does not include the shuffling, which you say you can do) on how to move pictureboxes (card images) to a blank space.
EDIT: it does NOT use cards.dll, but simply a directory (supplied--could have used resources but didn't so you can modify as needed) of 52 card images (clubs hearts, spades, diamonds), no jokers.
oops, sorry ..will post an update shortly...noted that the Ace of Spades is missing...BUT, you can figure out the movement of the pbs from what i have already posted
Last edited by SamOscarBrown; Dec 2nd, 2020 at 11:46 AM.