Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

VB project, need some help please

  • 09-04-2003 03:54PM
    #1
    Closed Accounts Posts: 826 ✭✭✭


    have a simple problem with my VBproject.

    We r suposed to do a poker game, o more acuratly the start of a poker game. anyways. We r useing a dll (card32.dll if I remember corectly) to display the deck of cards. Now the problem is:

    When I sort the cards so that they are player 1 in one row and 2 in another and so on I can sort them so that they are seperated or overlapping (the cards pertaining to player 1, 2 and so on) but when I go to seperate the players so that the cards are not touching i cant get ot right. I can get the 1st and 2nd lines to seperate but the rest always mess up

    the code is:

    Call Openers(Players)
    intImgNo = 1
    For intPlayer = 1 To Val(txtNumPlayers.Text)
    For intCard = 1 To 5
    LastPlayers.Text = txtNumPlayers.Text
    Load imgPoker(intImgNo)
    imgPoker(intImgNo).Visible = True
    imgPoker(intImgNo).Left = imgPoker(intCard - 1).Left + imgPoker(intCard - 1).Width * 0.75
    imgPoker(intImgNo).Picture = TheDeck.SetCardImage(Players(intPlayer, intCard))
    imgPoker(intImgNo).Top = imgPoker(0).Top + imgPoker(intPlayer - 1).Height * intPlayer + 100
    intImgNo = intImgNo + 1
    Next
    Next
    For intImgNo = 1 To 5
    imgPoker(intImgNo).Top = (imgPoker(0).Top) + 1450
    Next


    and the pic should explain what I mean



    p.s: I know the code is sh!t but I will be changing some of it. its jut modified code of mine from ealier and melded with my lecturars stuff. the whole openers thing is gotta go.


Comments

  • Registered Users, Registered Users 2 Posts: 629 ✭✭✭str8_away


    imgPoker(intImgNo).Top = imgPoker(0).Top + imgPoker(intPlayer - 1).Height * intPlayer + 100

    Your problem is in this line.
    Think what you are trying to do.

    imgPoker(intImgNo).Top = FirstCard.Top + (height_of_card * row number) + gap_between_row.

    This only gives you ONE gap.

    try
    imgPoker(intImgNo).Top = FirstCard.Top + (height_of_card + gap_between_row) * row number.


    hope this helps


  • Closed Accounts Posts: 826 ✭✭✭Snowball


    thanx, will try tomorrow. upto eyeballs today


Advertisement