10/31/2011 07:35 by ScottHamman
Load the Visual Basic 6.0 environment by clicking the program's shortcut icon from the desktop, or selecting "Microsoft Visual Basic 6.0" from the "Start" menu in your computer.
Select "Standard EXE" from the "New Project" dialog box, then click "Open" button.
Add a text box into the form by clicking the "TextBox" control from the "Toolbox," then drawing the desired text box size. Make sure it's wide enough to hold input characters from the user.
Clear the text caption by erasing the word "Text1" next to the "Text" property at the "Properties" window on the right side of the screen.
Double-click the text box control to display the "Code" window. This is where you'll write the instructions or source codes that the program will execute at run-time. The source code you are going to write will validate user input and accepts only numeric characters, else it will display an error message.
Insert the following code within the "Text1_Change" event:
If Not IsNumeric(Text1.Text) Then
MsgBox "Numeric input only!", vbCritical, "Invalid Input"
Text1.Text = ""
End If
Press F5 or select "Run" then "Start" from the menu to switch to runtime-mode.
Test the program to check that it's running as it should. Type alphanumeric characters or combination of letters and numbers into the text box. You should see an error message letting you know the input is invalid. Now, type only numbers into the text box. If no error message pops up, the program is running correctly.
Save the program by selecting "Save Project" from the "File" menu. Provide a filename into the space provided, then click "Save."
A:Developer Fusion Navigate to the Developer Fusion website. Click “VB.NET” under the “From” label. Click “C#”under th...(more)
A: Open Visual Basic 6.0, click File and choose New Project. Select Standard EXE from the list of templates. Double-click the TextBox control i...(more)
A: Create a new file using a text editor such as Notepad or Wordpad. Insert the following text in the file: 1,2,3,4,5 Save the file as ...(more)
A: Set up your "includes." C includes are pre-existing files that contain function libraries. Add the following code to the beginning of your C...(more)
A: Create a new class file in your project called "DataTableHelper.vb". Copy the following copy into the new file: Imports System Imp...(more)
Added Successfully!
×Voted Successfully!
×You can't vote for yourself
×You can't choose your own answer
×