| | |
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 .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms generatetags gridview html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year






