Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Need help making a VB script............
New Posts  All Forums:Forum Nav:

Need help making a VB script............

post #1 of 5
Thread Starter 
So i need to make a script that takes a number thats inputted into a textbox, then displays that number times all the numbers from 1 to 9 to a label on a new line
EX.

textbox - [2]

--------- ------
label - | 2 * 1 = 2 |
label - | 2 * 2 = 4 |
label - | 2 * 3 = 6 |
label - | 2 * 4 = 8 |
label - | 2 * 5 = 10|
---------- ------
ALL ONE LABEL

But it has to be a number from 1 to 100
Obviously a buttton will activate it
Answer is displayed to a new line and the center of the label.
and the input textbox accepts only numbers.
Any help would receive +rep and grattitude.
Edited by Smoblikat - 3/6/11 at 11:36am
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
post #2 of 5
Thread Starter 
How would i make it display the multiplication chart?
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
post #3 of 5
Thread Starter 
answerlabel.Text = number.ToString & " * 1 =" & " " & (number * 1).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 2 =" & " " & (number * 2).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 3 =" & " " & (number * 3).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 4 =" & " " & (number * 4).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 5 =" & " " & (number * 5).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 6 =" & " " & (number * 6).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 7 =" & " " & (number * 7).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 8 =" & " " & (number * 8).ToString & ControlChars.NewLine _
& answerlabel.Text = number.ToString & " * 9 =" & " " & (number * 9).ToString & ControlChars.NewLine

Converting from string "2 * 3 = 6" to type boolean is not valid.
I keep getting this error.
Edited by Smoblikat - 3/6/11 at 12:47pm
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
post #4 of 5
Thread Starter 
Fixed it, now how do i make it so that the textbox only acepts numbers from 1 to 99 and nothing else.
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
post #5 of 5
i havent messed with VB yet, but i get a taste of it in two weeks. I would imagine that you can create a assignment statement to only allow a value between 1 and 99
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Need help making a VB script............