Gaming, IT, Multimedia & Music Please use this forum to discuss Gaming, IT, Multimedia & Music. |
|
|
24th November 2007, 15:30
|
#1
|
Regular Poster
Join Date: Nov 2005
Location: Birmingham United Kingdom (England)
Posts: 336
Car(s): Civic TypeR
|
Visual Basic
Just wondering has anyone ever used visual basic, if so just wondering if you know how to add up the values in two text boxes and then subtract it from a value from a label thanks.
__________________
MK1 VTR, Magnex 3 inch Full System De-Catted, K&N Air Filter, VTS Alloys, Lowered, ICE (15" JBL x2, 1200Watt Amp, Pioneer 6x9\'s, 4 Tweeters, Pioneer H/U)
|
|
|
24th November 2007, 15:31
|
#2
|
Saxperience Post Whore
Join Date: Dec 2005
Location: MaDchester
Posts: 8,432
Car(s): Vts
|
Label2.Caption = Textbox1.Text + Textbox2.Text - Label1.caption ?? not used it for ages!
Last edited by b0t13; 24th November 2007 at 15:37.
|
|
|
24th November 2007, 15:32
|
#3
|
Saxperience Hardcore!
Join Date: Dec 2005
Location: Bradford
Posts: 26,687
Car(s): '15 Focus ST-2
|
Probably best in IT section mate.
Funny you should ask though, I was using it all day yesterday at work programming....have you used Macros before?
|
|
|
24th November 2007, 15:32
|
#4
|
Saxperience Post Whore
Join Date: Nov 2007
Location: Liverpool
Posts: 8,780
Car(s): Seat Leon
|
I am doing a course on it.. but I can't rememebr xD
Is it VB.Net or VB6?
|
|
|
24th November 2007, 15:32
|
#5
|
Established Member
Join Date: Jul 2007
Location: Plymouth
Posts: 1,877
Car(s): CLio sport 172
|
[QUOTE=saxotistic;1645986]Just wondering has anyone ever used visual basic, if so just wondering if you know how to add up the values in two text boxes and then subtract it from a value from a label thanks.[/QUOT
Nope did java scripting in college which is ment to be very similar if i remember correctly
|
|
|
24th November 2007, 15:34
|
#6
|
Saxperience Post Whore
Join Date: Dec 2005
Location: MaDchester
Posts: 8,432
Car(s): Vts
|
from the javascripts ive seen, its completely diff lol
|
|
|
24th November 2007, 15:40
|
#7
|
Super Moderator
Join Date: Aug 2007
Location: Lancashire
Posts: 14,256
Car(s): Astra VXR + 1989 Astra GTE
|
Hey i used VB6 alot back in college, should of really posted this in the IT section but nvm eh.
You will need a few variables..
Dim labelnumber As Currency
Dim textonenumber As Currency
Dim texttwonumber As Currency
Dim answer As Currency
Private Sub Command1_Click()
Let textonenumber = Text1.Text
Let texttwonumber = Text2.Text
Let labelnumber = Label1
Let answer = textonenumber + texttwonumber - labelnumber
Let Text3.Text = answer
End Sub
There you go mate, you'll need three textboxs, one label, and a command button.
__________________
Quote:
Originally Posted by ns9900
how big is it, edge to edge?
|
Quote:
Originally Posted by 12u55
14 inches or so.
|
Quote:
Originally Posted by ns9900
sorry bud, too big for me. GLWS tho
|
Last edited by Paul; 24th November 2007 at 15:43.
|
|
|
24th November 2007, 15:40
|
#8
|
Regular Poster
Join Date: Nov 2005
Location: Birmingham United Kingdom (England)
Posts: 336
Car(s): Civic TypeR
|
Quote:
Originally Posted by b0t13
Label2.Caption = Textbox1.Text + Textbox2.Text - Label1.caption ?? not used it for ages!
|
gonna try that out now thanks
__________________
MK1 VTR, Magnex 3 inch Full System De-Catted, K&N Air Filter, VTS Alloys, Lowered, ICE (15" JBL x2, 1200Watt Amp, Pioneer 6x9\'s, 4 Tweeters, Pioneer H/U)
|
|
|
24th November 2007, 15:46
|
#9
|
Regular Poster
Join Date: Nov 2005
Location: Birmingham United Kingdom (England)
Posts: 336
Car(s): Civic TypeR
|
Quote:
Originally Posted by Paul_CGM
Hey i used VB6 alot back in college, should of really posted this in the IT section but nvm eh.
You will need a few variables..
Dim labelnumber As Currency
Dim textonenumber As Currency
Dim texttwonumber As Currency
Dim answer As Currency
Private Sub Command1_Click()
Let textonenumber = Text1.Text
Let texttwonumber = Text2.Text
Let labelnumber = Label1
Let answer = textonenumber + texttwonumber - labelnumber
Let Text3.Text = answer
End Sub
There you go mate, you'll need three textboxs, one label, and a command button.
|
would it be possible to do it without using a command button, i am doing a marketing section for my assignemnt, so in marketing there are different promotion method so i want the user to enter the amount in % they wish to spend of their promotion budget, then i want something like a label displaying 100% so as the user eneters the % they wish to spend for it decrease it automatically if that makes sense, thanks
__________________
MK1 VTR, Magnex 3 inch Full System De-Catted, K&N Air Filter, VTS Alloys, Lowered, ICE (15" JBL x2, 1200Watt Amp, Pioneer 6x9\'s, 4 Tweeters, Pioneer H/U)
|
|
|
24th November 2007, 15:47
|
#10
|
Central South
Join Date: Jun 2006
Location: East Sussex
Posts: 3,105
Car(s): VTS :)
|
I havn't used VB in ages, but dont you have to type convert between strings and integers using val()?
__________________
Can I be your car fwrend??
|
|
|
24th November 2007, 15:47
|
#11
|
Super Moderator
Join Date: Aug 2007
Location: Lancashire
Posts: 14,256
Car(s): Astra VXR + 1989 Astra GTE
|
oops you mean subtract the values out the textboxes from the label, iv done the label from the textboxs. one minute.
edit,
Well its alot easier using a button, but.. one minute i'll have a quick look.
__________________
Quote:
Originally Posted by ns9900
how big is it, edge to edge?
|
Quote:
Originally Posted by 12u55
14 inches or so.
|
Quote:
Originally Posted by ns9900
sorry bud, too big for me. GLWS tho
|
|
|
|
24th November 2007, 15:49
|
#12
|
Central South
Join Date: Jun 2006
Location: East Sussex
Posts: 3,105
Car(s): VTS :)
|
Set an event for the textbox (OnChange or OnKeyPress).
__________________
Can I be your car fwrend??
|
|
|
24th November 2007, 15:52
|
#13
|
Regular Poster
Join Date: Nov 2005
Location: Birmingham United Kingdom (England)
Posts: 336
Car(s): Civic TypeR
|
Quote:
Originally Posted by Paul_CGM
oops you mean subtract the values out the textboxes from the label, iv done the label from the textboxs. one minute.
edit,
Well its alot easier using a button, but.. one minute i'll have a quick look.
|
Yeh sorry, so for example if they want to spend 50% on t.v advertising, then it should deducted it from the label but also if the user decides they want to make the 50% to 40% so the label goes back up by 10% becuase of the change so i want the label value to go up and down based on the numbers the user enters, thanks
__________________
MK1 VTR, Magnex 3 inch Full System De-Catted, K&N Air Filter, VTS Alloys, Lowered, ICE (15" JBL x2, 1200Watt Amp, Pioneer 6x9\'s, 4 Tweeters, Pioneer H/U)
|
|
|
24th November 2007, 15:52
|
#14
|
Super Moderator
Join Date: Aug 2007
Location: Lancashire
Posts: 14,256
Car(s): Astra VXR + 1989 Astra GTE
|
Done a quick 5 minute job here, dont know if it will help.
Dim labelnumber As Currency
Dim textonenumber As Currency
Dim texttwonumber As Currency
Dim answer As Currency
Private Sub Text1_Change()
Let textonenumber = Text1.Text
Let texttwonumber = Text2.Text
Let labelnumber = Label1
Let answer = labelnumber - (textonenumber + texttwonumber)
Let Text3.Text = answer
End Sub
Private Sub Text2_Change()
Let textonenumber = Text1.Text
Let texttwonumber = Text2.Text
Let labelnumber = Label1
Let answer = labelnumber - (textonenumber + texttwonumber)
Let Text3.Text = answer
End Sub
Private Sub Text3_Change()
Let textonenumber = Text1.Text
Let texttwonumber = Text2.Text
Let labelnumber = Label1
Let answer = labelnumber - (textonenumber + texttwonumber)
Let Text3.Text = answer
End Sub
Put the data format for the textboxs to number also. (properties)
edit:
in the screenshot i've forgot to delete the command button.
__________________
Quote:
Originally Posted by ns9900
how big is it, edge to edge?
|
Quote:
Originally Posted by 12u55
14 inches or so.
|
Quote:
Originally Posted by ns9900
sorry bud, too big for me. GLWS tho
|
Last edited by Paul; 24th November 2007 at 15:55.
|
|
|
24th November 2007, 15:56
|
#15
|
Super Moderator
Join Date: Aug 2007
Location: Lancashire
Posts: 14,256
Car(s): Astra VXR + 1989 Astra GTE
|
Quote:
Originally Posted by saxotistic
Yeh sorry, so for example if they want to spend 50% on t.v advertising, then it should deducted it from the label but also if the user decides they want to make the 50% to 40% so the label goes back up by 10% becuase of the change so i want the label value to go up and down based on the numbers the user enters, thanks
|
Hmm complicated it now, you want to change the value of the label?
edit
get a screenshot of your work up so i can see what you mean ?
__________________
Quote:
Originally Posted by ns9900
how big is it, edge to edge?
|
Quote:
Originally Posted by 12u55
14 inches or so.
|
Quote:
Originally Posted by ns9900
sorry bud, too big for me. GLWS tho
|
|
|
|
24th November 2007, 17:19
|
#16
|
Saxperience Addict
Join Date: Jan 2007
Location: Benfleet, Essex
Posts: 10,834
Car(s): Megane 225 Cup
|
I'll post some Visual Basic program soon, ever tried Dev C++ much easier program to use in my opion.
|
|
|
24th November 2007, 22:55
|
#17
|
Central South
Join Date: Jun 2006
Location: East Sussex
Posts: 3,105
Car(s): VTS :)
|
Delphi or C# is a good start for beginners, Microsoft do a free version of C#.NET
http://www.microsoft.com/express/vcsharp/
__________________
Can I be your car fwrend??
|
|
|
24th November 2007, 23:41
|
#18
|
Saxperience Post Whore
Join Date: Dec 2005
Location: MaDchester
Posts: 8,432
Car(s): Vts
|
delphi and c++ are good, but i made my first prog in vB years ago lol.
tbh delphi and vb are pointless knowing in the working world as its old skool now, gd to learn from tho..
|
|
|
25th November 2007, 00:07
|
#19
|
Saxperience Hardcore!
Join Date: May 2006
Location: Bristol
Posts: 16,575
Car(s): JP4urio, 306 DTurbo SportShed
|
I had to use this in computing at college. Got bored so spent the whole year making awesome pointless crap and sending it around. Like a thingy that opens and closes the disk try every three seconds you cant turn off. Good times
|
|
|
25th November 2007, 03:03
|
#20
|
Super Moderator
Join Date: Aug 2007
Location: Lancashire
Posts: 14,256
Car(s): Astra VXR + 1989 Astra GTE
|
Quote:
Originally Posted by Ben_Saxo
I had to use this in computing at college. Got bored so spent the whole year making awesome pointless crap and sending it around. Like a thingy that opens and closes the disk try every three seconds you cant turn off. Good times
|
*cough* cntrl alt delete *cough*
__________________
Quote:
Originally Posted by ns9900
how big is it, edge to edge?
|
Quote:
Originally Posted by 12u55
14 inches or so.
|
Quote:
Originally Posted by ns9900
sorry bud, too big for me. GLWS tho
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 20:58.
|