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
I meant as what would be the coding for it, I am all new to this VB.net and this is my first project. (its a simple 'machine cycle simulation' of two numbers being added)
Do not use the plain textbox on your form instead use a masked text box.
Set the following properties for the masked textbox
1. For the mask select numeric and increase the maximum length up to what you desire
2. Set the RejectInputOnFirstFailure property to true.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.