| | |
Input Box Validation
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I have this project that i have made, although i have been trying to figure out how to make it so that the user can only enter integers in the input box and no letters (if they do the program crashes)
Can anyone help us out/guide me in the right direction...
Dim num1 As Integer
Dim num2 As Integer
Dim counter As Integer
Case 2
MsgBox("Begin execution", MsgBoxStyle.Information)
num1 = InputBox("Please enter a number")
MsgBox("Command executed", MsgBoxStyle.Exclamation)
'shows two message boxes
'asks the user to enter a number via an input box
Case 3
MsgBox("Begin execution", MsgBoxStyle.Information)
num2 = InputBox("Please enter another number")
MsgBox("Command executed", MsgBoxStyle.Exclamation)
'shows two message boxes
'asks the user to enter another number via an input box
Thanks!
I have this project that i have made, although i have been trying to figure out how to make it so that the user can only enter integers in the input box and no letters (if they do the program crashes)
Can anyone help us out/guide me in the right direction...
Dim num1 As Integer
Dim num2 As Integer
Dim counter As Integer
Case 2
MsgBox("Begin execution", MsgBoxStyle.Information)
num1 = InputBox("Please enter a number")
MsgBox("Command executed", MsgBoxStyle.Exclamation)
'shows two message boxes
'asks the user to enter a number via an input box
Case 3
MsgBox("Begin execution", MsgBoxStyle.Information)
num2 = InputBox("Please enter another number")
MsgBox("Command executed", MsgBoxStyle.Exclamation)
'shows two message boxes
'asks the user to enter another number via an input box
Thanks!
Hi,
use Val() function check this :
Even if user enters some Text chars, u get its value as zero..
May be u can write check after that to enter some Valid Value
Regards
Veena
use Val() function check this :
VB.NET Syntax (Toggle Plain Text)
num1 =Val(InputBox("Please enter a number"))
Even if user enters some Text chars, u get its value as zero..
May be u can write check after that to enter some Valid Value
Regards
Veena
![]() |
Similar Threads
- input box (Visual Basic 4 / 5 / 6)
- Looking for List Box help, please! (VB.NET)
- Input box not showing (HTML and CSS)
- Text input box alignment question (HTML and CSS)
- Sending data to a input box on another website? (PHP)
- Validation Problems for Input Box data (VB.NET)
- event object (HTML and CSS)
Other Threads in the VB.NET Forum
- Previous Thread: .net framework notes
- Next Thread: Single Sign On
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons c# center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial server soap sql table tcp text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






