home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

ShuckyD's first VB app

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1685
Discussions: 200,957, Posts: 2,379,497, Members: 246,327
Old July 21st, 2006, 04:32 PM   Digg it!   #1 (permalink)
Mobile Member
 
ShuckyD's Avatar
 
Join Date: Apr 2005
Location: S. Central PA
Posts: 3,601
ShuckyD's first VB app

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#
Attached Files
File Type: zip MyLucky7.zip (47.1 KB, 44 views)
__________________
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.
ShuckyD is offline   Reply With Quote
Old July 21st, 2006, 04:40 PM     #2 (permalink)
Mobile Member
 
ShuckyD's Avatar
 
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.
ShuckyD is offline   Reply With Quote
Old July 21st, 2006, 05:32 PM     #3 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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.
jkrohn is offline   Reply With Quote
Old July 21st, 2006, 05:35 PM     #4 (permalink)
Mobile Member
 
ShuckyD's Avatar
 
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.
ShuckyD is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Is It Just Me? (2948)
The disrespect of Obama by Russian .. (41)
Making Health Care Worse (178)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
Regular Build (11)
windows 7 problem (7)
Laptop with wireless problem. (5)
Is the PSU I received dead? (12)
Print spooler problem (15)
windows vista security holes (11)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
Recent Discussions
Open With ..... Win7 (1)
Kingston Bluetooth Dongle Driver (0)
webcam (0)
upgrade for hp a6101 (0)
windows vista security holes (11)
Laptop with wireless problem. (5)
Modern Warfare 2: Who Bought It? (64)
tv not turn on-makes clicking sound (2)
CPU fan stops spinning randomly (9)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Point and Shoot Camera Suggestions. (4)
Multiple Restarts Required at Boot (2)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Hp Artist Edition + Matching Bag (0)


All times are GMT -4. The time now is 07:39 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28