Making editors for cricket games

It says I don't have the proper Service Packs installed and all. I used to try and install them, but they would just stop 70% of the way too and report an error and stop. So, thats why I con't use any of them...
 
ZoraxDoom said:
It says I don't have the proper Service Packs installed and all. I used to try and install them, but they would just stop 70% of the way too and report an error and stop. So, thats why I con't use any of them...

You done need any Service Pack's.I dont have any either and I use Sharp Develop and .Net Framework.So its not big deal.
 
After some technical errors I did it!

126455570.jpg
 
RabbleRouser said:
I did a web browser! :cool:

Well it's better than that Microsoft thing you're using! :p

Reminds me of a Dilbert cartoon. They're getting paid for every bug they fix in their code so he asks ratbert to dance all over the keyboard.
Unforunately this creates so many bugs he tells him that he just authored a web browser.
 
i did this yesterday itself but forgot to post it :p (server probs) ;)

also, whens the next tutorial coming ??
 

Attachments

  • done.JPG
    done.JPG
    98.7 KB · Views: 172
Good to see more people getting it done.Now wasnt that easy? (Once you get it installed and running i.e).

I think the next tutorial might be sometime next week.I need to speak to Colin though before I can say for certain.
 
Its pretty simple, just add a webbrowser control on to your form and use its navigate method to display a page.
PHP:
WebBrowser1.Navigate("http://www.planetcricket.org")
 
Prakash said:
Its pretty simple, just add a webbrowser control on to your form and use its navigate method to display a page.
PHP:
WebBrowser1.Navigate("http://www.planetcricket.org")

Or add this code to the "Go" button
PHP:
WebBrowser1.Navigate(TextBox1.Text)

Well it's better than that Microsoft thing you're using!

Reminds me of a Dilbert cartoon. They're getting paid for every bug they fix in their code so he asks ratbert to dance all over the keyboard.
Unforunately this creates so many bugs he tells him that he just authored a web browser.

:rtfl
 
Last edited:
Second installment.
Teaches:
coding conventions
use of combo box
Select Case
combining strings

The idea is to make a very simple program that will display like a cricket scorecard when you enter the information required.

First start a new project and add 4 text boxes, a combo box, a button and 5 labels like so:

tut2pic1.jpg


Use the properties menu to change the text on the labels:

tut2pic2.jpg


Like so:

tut2pic3.jpg


Click on one of the text boxes and go to properties again. This time change the name not the text:

tut2pic4.jpg


The names we are going to use are as follows:
for the bowler box - txtbowler
for the batsman box - txtbatsman
for the how out box - cbohowout
for the fielder box - txtfielder
for the runs box - txtruns
for the display button - cmddisplay

These are all vb.net coding conventions. See here for more information.

tut2pic5.jpg


Your drop down box (on the properties menu) should look like this:

tut2pic6.jpg


Next we're going to add some items into the combo box. Click onto the box and on the properties menu, click on the box by collection.

tut2pic7.jpg


A box for you to type in will open. Type the following:

tut2pic8.jpg


That's our form designed. Now onto the coding :)

Double click on the display button, like in the last lesson and the code window will open. Type the following:

tut2pic9.jpg


"Dim result as string" means that we are defining "result" as a variable of type string which we can then use within the sub
"Select Case cbohowout.text" is a function where the program works out what to do next based on the value of cbohowout.text (our combobox).
[normally we'd use selectedindex instead of text but I'm trying to keep it simple for the moment. See here to see it done with selectedindex instead)

tut2pic10.jpg


We then add our first case. In this example the code says that if the combo box is set to "bowled" it will give execute this line of code. In other words this is what "result" will equal.
result will equal
"txtbatsman.text" (the contents of the batsman text box)
"&" (the symbol used to join together more than one string)
" b " (space, letter b, space)
"&" (again)
"txtbowler.text" (the contents of the bowler text box)
"&"
" " (used to put a space between bowler and runs)
"txtruns.text" (the contents of the runs text box)

It's much simpler than it looks...

Next add in a Case statement for "caught"

tut2pic11.jpg


Same principle as above, we've just added a fielder in for caught.

Code it for all the possibilites of the combobox and put a messagebox at the end (like in the first tutorial):

tut2pic12.jpg


Finally go back to your form design, click on the view menu and select tab order. Change it to make it easier to navigate:

tut2pic14.jpg


Run the program and post a screenshot here :)
 

Users who are viewing this thread

Top