| | |
Need simple code for VB.NET
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2004
Posts: 1
Reputation:
Solved Threads: 0
I have a project where the user selects from 4 combo boxes, and I want to "Keep Score" based on their selections in those combo boxes
They pick the 1st item in the 1st cbo box, it adds 1, if they pick the second item, it adds 2 and so on - when they click "COMPUTE" button, the code using IF...THEN...ELSE or Case structure will compute the total "score," and display the result in a message box.
Anyone know where I can get a snippet of code that would closely resemple that ? I could figure the rest out...change the names etc. - I am a newbie to VB.NET, and wouldn't know where to start...
Thanks ! :cheesy:
Steve
They pick the 1st item in the 1st cbo box, it adds 1, if they pick the second item, it adds 2 and so on - when they click "COMPUTE" button, the code using IF...THEN...ELSE or Case structure will compute the total "score," and display the result in a message box.
Anyone know where I can get a snippet of code that would closely resemple that ? I could figure the rest out...change the names etc. - I am a newbie to VB.NET, and wouldn't know where to start...
Thanks ! :cheesy:
Steve
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Solved Threads: 0
firstly you need to set a variable to store the score temporarily. to do this type at the top of the forms code (above the load event):
dim compute as integer
then go down to the code for ur combo boxes and to each one add:
compute = compute + 1
then go to the code for your compute button and type into the code:
name of textbox that your showing the result in.text = compute
that should do the trick if it doesnt i'll try and think of something else.
cheers,
steve
dim compute as integer
then go down to the code for ur combo boxes and to each one add:
compute = compute + 1
then go to the code for your compute button and type into the code:
name of textbox that your showing the result in.text = compute
that should do the trick if it doesnt i'll try and think of something else.
cheers,
steve
each item in a combo box has an index:
index = 0 for first item
index = 1 for second item
index = 3 for third item
...etc
Then you can compute "SCORE" by adding the indexes of the combo boxes selected.
You can also increment SCORE whenever the combo box change, so the user does not have to do the extra step of clicking the button, plus you can show the SCORE everytime he makes a selection.
hope it helps.
index = 0 for first item
index = 1 for second item
index = 3 for third item
...etc
Then you can compute "SCORE" by adding the indexes of the combo boxes selected.
You can also increment SCORE whenever the combo box change, so the user does not have to do the extra step of clicking the button, plus you can show the SCORE everytime he makes a selection.
hope it helps.
![]() |
Similar Threads
- Simple ASP.Net Login Page using C# (C#)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Sql server connection using code in VB.NET (VB.NET)
- CAn anyone provide me a very simple code for shopping cart? (PHP)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Dreamweaver templates in Visual Studio 2005
- Next Thread: how to Install vb.net window application on client system with database
Views: 5395 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database databasesearch datagrid datagridview design designer dissertation dissertations dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy highlighting images inline insert installer intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting studio syntax table tcp text textbox time timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





