ShuckyD's first VB app  | |
July 21st, 2006, 04:32 PM
|
#1 (permalink)
| | Mobile Member
Join Date: Apr 2005 Location: S. Central PA
Posts: 3,601
|
i thought i would give this one an interesting title, i decided after working at this new job im at, i get some free time so i would use that time wisely and learn something, what i chose is the infamous Visual Basic (.NET to be exact)
So i want to share with you my FIRST Windows APPLICATION for VB  I just thought some of you would get a kick out of it.. its very complex too
Just open the zip and run it, its a slot machine like program. Its sorta what the install guide for VB.Net from M$ tells you to make, with a couple slight altercations. Next i want to add a thing where it has a set amount of money and it takes a portiion each time you hit spin, etc. Just some stuff to learn the basics. How would any of you go about doing it.
ohh and heres all the code for it as well Code: Private Sub cmd_End_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_End.Click
'this is some intense coding right here
End
End Sub
Private Sub cmd_Spin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_Spin.Click
'oh yea this is some good programming
PictureBox1.Visible = False ' keeps picture 1 hidden
PictureBox2.Visible = False ' same as above for the stack of $$
Label1.Text = CStr(Int(Rnd() * 10)) ' pick numbers
Label2.Text = CStr(Int(Rnd() * 10))
Label3.Text = CStr(Int(Rnd() * 10)) ' end the picking
'if any 7's show up, display picture and beep
If (Label1.Text = "7") Or (Label2.Text = "7") Or (Label3.Text = "7") Then
PictureBox1.Visible = True
PictureBox2.Visible = True
Beep()
End If
End Sub i really got a kick out of the end buttons code. Theres usually a little more writing involved in other languages ive learned like C#
__________________ Thinkpad T61 14.1" wide | WinXP Pro | C2D T8300 CPU | 3GB DDR2 | 160GB HDD | AGN & WWAN
Lenovo S10 10.2" LED display | 1.6Ghz Atom CPU | 1GB DDR2 | 1.3mp webcam | B/G WiFi | 160GB HDD
Last edited by ShuckyD : July 21st, 2006 at 04:35 PM.
|
| |
July 21st, 2006, 04:40 PM
|
#2 (permalink)
| | Mobile Member
Join Date: Apr 2005 Location: S. Central PA
Posts: 3,601
|
somehow in copying that code into this post i deleted whatever else there was, probably above it and now it wont compile anymore, are there any VB people in here that know what it says either above or below the shown code to make it work. If not i'll just copy the code into a new app that i make or just make a whole other one since it didnt take that long at all UPDATE: the first number in that program doesnt work, it did but i fiddled with the code and took away the Int() function and i guess that was the last time i compiled it, now my code is bummed ...but alas it did work at one point, so i know what i did wrong there
Last edited by ShuckyD : July 21st, 2006 at 04:44 PM.
|
| |
July 21st, 2006, 05:32 PM
|
#3 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,552
|
Well you are missing a LOT from that code above.
Includes
Class
Main
Window initialization code
Event handler assignment code....
All you have there are the two functions that are event handlers for the click. Missing everything else.
Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
|
| |
July 21st, 2006, 05:35 PM
|
#4 (permalink)
| | Mobile Member
Join Date: Apr 2005 Location: S. Central PA
Posts: 3,601
|
heh thanks
yea i figured i would just scrap that application and try another one, and see what else i can do. Not to sure how i would do math in VB and then make it work through textboxes but i will try. |
| | | Thread Tools | Search this Thread | | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | my little app | large_nostril | Webmastering and Programming | 12 | January 22nd, 2005 10:50 AM | | Very handy app | M_Six | Applications and Operating Systems | 16 | September 2nd, 2003 05:49 AM | | Were can i download an app | phil_monk | Processors, Memory, and Overclocking | 10 | February 5th, 2003 07:55 AM | | Need App suggestion | TOAD6147 | Applications and Operating Systems | 8 | January 18th, 2003 11:47 AM | | cp an app from one hd to another? | jutah | General Tech Discussion | 4 | October 12th, 2002 05:36 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |