Auto create workspace
Page 1 of 1
Sublime




Posts: 8615

PostPosted: Thu, 15th Dec 2005 05:20    Post subject: Auto create workspace
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-Cool 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!

http://artpad.art.com/?irqy7s4162w <3 you too
Back to top
tRanSwarP




Posts: 202
Location: Germany
PostPosted: Thu, 15th Dec 2005 12:58    Post subject:
hmm im more form the c# corner Wink .. 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));
}
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
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


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group