Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB project, need some help please

Options
  • 09-04-2003 3:54pm
    #1
    Closed Accounts Posts: 836 ✭✭✭


    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 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: 836 ✭✭✭Snowball


    thanx, will try tomorrow. upto eyeballs today


Advertisement