I need to make an application and my idea is for a horse betting thing. I want the user to be able select a number of horses (1- to place a bet on. This can be done from a combo box but how do I get it so that if the combo box = 2 then the workspace has
horse 1 and horse 2 'betting options' up? the same for the rest of the numbers too.
o and it's in VB.
Also if that's not very easy how would I get an equation to work if the workspace is the same throughout i.e. 8 hourses but any combination is filled in.
i.e. horse 1 has £10 horse 2 £5 horse 3 nothing horse 4 nothing horse 5 £20 etc. right through to 8. At the moment the code is a bit ugly and there are 64 different combinations (bet on or don't bet the amount is irrelevant) and that's a shit loada coding to be done. Is there an easier way to do it other than (for example) IF horse5.text = "" then End. i.e. all the boxes need to be filled in for it to 'work'.
Stealth88 and Lod|_Dod| wrote:
"And the winner is.... Sublime!" That fucking kid is always right. Sublime FTW!
hmm im more form the c# corner .. but maybe VB has vectors (Arraylists, arrays that change size automaticly)
had a similar problem and solved it like this:
Code:
Vector horsieVector = new Vector(); //Strings for storing bets
Horse horse[]; // our horses
for (int i = 0; i < horse.lenght ;i++)
{
if (horse[i].hasBet()) horsieVector.add(horse[i].Text = "Bet");
else horsieVector.add(horse[i].Text = "No Bet");
}
for (int i = 0; i < horsieVector.size(); i++)
{
Console.out.println((String) horsieVector.get(i));
}
Signature/Avatar nuking: none (can be changed in your profile)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum